/* ===== مكونات الموقع ===== */

/* ===== القائمة الجانبية ===== */
.sidebar {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 80px;
    height: auto;
    background: rgba(44, 44, 44, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    border-radius: 40px;
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    z-index: 2000;
    backdrop-filter: blur(10px);
    transition: transform 0.35s ease, opacity 0.35s ease, right 0.35s ease;
}

/* حالة الطي (إخفاء شبه كامل مع ترك المقبض) - سطح المكتب فقط */
.sidebar.collapsed { right: -56px; opacity: 0.98; }

/* مقبض إظهار/إخفاء القائمة */
/* مقبض كنتوء صغير بارز من جسم القائمة */
.sidebar-handle {
    position: absolute;
    left: -25px; /* تحريك السهم إلى اليسار أكثر */
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 56px;
    border-radius: 10px 0 0 10px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(44,44,44,0.92);
    color: #E1BF99;
    box-shadow: 0 6px 14px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1; /* تقليل z-index ليظهر أسفل الأيقونات */
    transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease, left 0.35s ease;
}

.sidebar-handle:hover { background: rgba(234,84,51,0.9); color: #fff; }

/* إخفاء المقـبض في الجوال حيث القائمة سفلية */
@media (max-width: 768px) {
  .sidebar-handle { display: none; }
  .sidebar {
    transition: transform 0.35s ease, opacity 0.35s ease, left 0.35s ease;
    position: fixed !important;
    bottom: 16px !important;
    top: auto !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    opacity: 1 !important;
    z-index: 2000 !important;
  }
  .sidebar.collapsed { left: 50% !important; } /* ألغ الطي في الجوال */
}

/* تحريك موضع المقبض عندما تكون القائمة مطوية */
.sidebar.collapsed .sidebar-handle { 
    left: -33px; 
    z-index: 1; /* تأكيد z-index منخفض في حالة الطي */
    background: rgba(234,84,51,0.9); /* لون أحمر في حالة الطي */
    color: #fff; /* لون النص أبيض */
}

.sidebar ul {
    list-style: none;
    width: 100%;
    position: relative;
    padding-top: 15px;
}

.sidebar ul li {
    width: 100%;
    height: 70px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 2;
}

.sidebar ul li a {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    color: #E1BF99;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    transition: all 0.4s ease;
    position: relative;
    z-index: 2;
    text-decoration: none;
    backdrop-filter: blur(10px);
    transform: translateX(0);
}

.sidebar ul li a:hover {
    background: rgba(234, 84, 51, 0.3);
    color: #fff;
    transform: scale(1.05) translateX(-5px);
}

/* المؤشر المخصص */
.indicator {
    position: absolute;
    right: 50%;
    top: 15px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #EA5433, #E1BF99);
    z-index: 1;
    transition: top 0.5s cubic-bezier(.68,-0.55,.27,1.55), left 0.5s cubic-bezier(.68,-0.55,.27,1.55);
    box-shadow: -8px 0 25px rgba(234, 84, 51, 0.5);
    transform: translateX(50%);
}

/* ضمان ظهور المؤشر في المكان الصحيح من البداية */
.sidebar ul li:first-child.active ~ .indicator,
.sidebar ul li:first-child.active + .indicator {
    top: 15px;
}

.indicator::after {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(234, 84, 51, 0.2);
    z-index: -1;
    transform: translateX(-15px);
}

.sidebar ul li.active a {
    color: #fff;
    background: linear-gradient(135deg, #EA5433, #E1BF99);
    box-shadow: -5px 0 20px rgba(234, 84, 51, 0.6);
    transform: translateX(-15px);
    border: 3px solid #fff;
}

/* ===== الشعار ===== */
.top-logo {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    padding: 20px;
    backdrop-filter: blur(15px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 0, 0, 0.6), 0 0 40px rgba(255, 0, 0, 0.4);
    border: 3px solid #ff0000;
    animation: logoGlow 2s ease-in-out infinite alternate;
    cursor: pointer;
    transition: all 0.3s ease;
}

.top-logo:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(255, 0, 0, 0.8), 0 0 60px rgba(255, 0, 0, 0.6);
}

@keyframes logoGlow {
    0% {
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 0, 0, 0.6), 0 0 40px rgba(255, 0, 0, 0.4);
        border-color: #ff0000;
    }
    100% {
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 30px rgba(255, 0, 0, 0.8), 0 0 60px rgba(255, 0, 0, 0.6);
        border-color: #ff3333;
    }
}

.top-logo .logo-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.4));
}

/* ===== الفوتر ===== */
.footer {
    background: linear-gradient(135deg, #2d1810 0%, #4a3728 100%);
    color: #faf8f5;
    padding: 60px 0 20px;
    margin-top: 80px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h3 {
    color: #E1BF99;
    font-size: 1.3rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.footer-section p {
    line-height: 1.8;
    margin-bottom: 15px;
    color: #faf8f5;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: #faf8f5;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: #E1BF99;
}

.contact-info p {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    color: #faf8f5;
}

.contact-info i {
    margin-left: 10px;
    color: #E1BF99;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(225, 191, 153, 0.1);
    color: #E1BF99;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(225, 191, 153, 0.3);
}

.social-links a:hover {
    background: #E1BF99;
    color: #2d1810;
    transform: translateY(-2px);
}

.footer-bottom {
    border-top: 1px solid rgba(225, 191, 153, 0.2);
    padding-top: 20px;
    text-align: center;
    color: #faf8f5;
}

/* ===== أنماط إضافية للتوافق ===== */

/* إخفاء الهيدر القديم إذا كان موجوداً */
.header {
    display: none !important;
}

/* ضمان عدم تداخل المكونات مع المحتوى */
main {
    padding-top: 20px;
    min-height: calc(100vh - 200px);
}

/* تحسين المسافات للصفحات */
.page-header {
    margin-top: 120px;
    padding: 60px 0;
    background: linear-gradient(135deg, rgba(44, 24, 16, 0.9) 0%, rgba(74, 55, 40, 0.8) 100%);
    color: #faf8f5;
    text-align: center;
}

.page-header h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #E1BF99;
}

.page-header p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}

/* تحسين الأقسام */
.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    color: #2d1810;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(135deg, #EA5433, #E1BF99);
    border-radius: 2px;
}

/* تحسين البطاقات */
.product-item,
.vm-card,
.value-card,
.team-member,
.contact-card {
    background: #fff;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(225, 191, 153, 0.2);
}

.product-item:hover,
.vm-card:hover,
.value-card:hover,
.team-member:hover,
.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: #E1BF99;
}

/* تحسين الأزرار */
.view-details-btn,
.add-to-cart-btn,
.cta-button {
    background: linear-gradient(135deg, #EA5433, #E1BF99);
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.view-details-btn:hover,
.add-to-cart-btn:hover,
.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(234, 84, 51, 0.3);
}

/* تحسين الشبكات */
.products-grid,
.vm-grid,
.values-grid,
.team-grid,
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

/* تحسين الصور */
.product-image img,
.story-image img,
.member-image img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.product-item:hover .product-image img,
.team-member:hover .member-image img {
    transform: scale(1.05);
}

/* تحسين الأيقونات */
.vm-icon,
.value-icon,
.contact-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #EA5433, #E1BF99);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: white;
    font-size: 24px;
}

/* ===== التجاوب للمكونات ===== */
@media (max-width: 768px) {
    .top-logo {
        top: 15px;
        right: 15px;
        padding: 15px;
    }

    .top-logo .logo-img {
        width: 70px;
        height: 70px;
    }

    /* القائمة الجانبية في الجوال - أسفل الشاشة */
    .sidebar {
        position: fixed;
        bottom: 16px;
        left: 50%;
        transform: translateX(-50%);
        top: auto;
        right: auto;
        width: min(520px, 92vw);
        height: auto;
        flex-direction: row;
        border-radius: 30px;
        padding: 10px 20px;
        z-index: 2000;
        display: flex;
        background: rgba(44, 44, 44, 0.9);
        backdrop-filter: blur(10px);
        box-shadow: 0 0 15px rgba(0,0,0,0.2);
        overflow: hidden;
    }

    .sidebar ul {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-evenly;
        gap: 10px;
        padding: 0;
        margin: 0;
        list-style: none;
        width: 100%;
    }

    .sidebar ul li {
        width: auto;
        height: auto;
        margin: 0;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .sidebar ul li a {
        width: 45px;
        height: 45px;
        font-size: 18px;
        margin: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        text-decoration: none;
        color: #E1BF99;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 50%;
        transition: all 0.4s ease;
    }

    .sidebar ul li.active a {
        transform: none;
        border: 2px solid #fff;
        color: #fff;
        background: rgba(255,255,255,0.08);
        box-shadow: 0 0 0 2px rgba(234,84,51,0.35) inset;
    }

    .sidebar ul li a:hover {
        transform: none;
        background: rgba(234, 84, 51, 0.3);
        color: #fff;
    }

    /* المؤشر في الجوال */
    .indicator {
        position: absolute;
        bottom: -5px;
        left: 50%;
        transform: translateX(-50%);
        top: auto;
        width: 35px;
        height: 4px;
        border-radius: 2px;
        background: linear-gradient(135deg, #EA5433, #E1BF99);
        box-shadow: 0 2px 10px rgba(234, 84, 51, 0.5);
        z-index: 1;
        transition: left 0.5s cubic-bezier(.68,-0.55,.27,1.55);
    }

    .indicator::after {
        display: none;
    }

    /* تحسين المساحة السفلية للمحتوى */
    body {
        padding-bottom: 100px;
    }

    /* ضمان ظهور القائمة الجانبية في الجوال */
    .sidebar {
        display: flex;
        visibility: visible;
        opacity: 1;
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
    }


}

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .page-header {
        margin-top: 100px;
        padding: 40px 0;
    }

    .page-header h1 {
        font-size: 2.5rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .products-grid,
    .vm-grid,
    .values-grid,
    .team-grid,
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .top-logo {
        top: 10px;
        right: 10px;
        padding: 12px;
    }

    .top-logo .logo-img {
        width: 60px;
        height: 60px;
    }

    /* تحسينات إضافية للقائمة الجانبية في الشاشات الصغيرة */
    .sidebar {
        bottom: 15px;
        padding: 8px 15px;
        border-radius: 25px;
        max-width: 85vw;
        min-width: 280px;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        visibility: visible;
        opacity: 1;
    }

    .sidebar ul {
        gap: 8px;
        justify-content: space-evenly;
    }

    .sidebar ul li a {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .sidebar ul li.active a {
        transform: translateY(-3px);
    }

    .sidebar ul li a:hover {
        transform: scale(1.05) translateY(-2px);
    }

    .indicator {
        width: 30px;
        height: 3px;
        bottom: -3px;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .product-item,
    .vm-card,
    .value-card,
    .team-member,
    .contact-card {
        padding: 20px;
    }

    /* تحسين المساحة السفلية للشاشات الصغيرة */
    body {
        padding-bottom: 80px;
    }
}