:root {
    --primary: #38bdf8;
    --primary-hover: #0ea5e9;
    --bg: #090d16;
    --card-bg: #111625;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #1e293b;
}

/* -------------------------------------------------------------
   1. تخصيص شريط التمرير الاحترافي (Custom Dark Orange Scrollbar)
   ------------------------------------------------------------- */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #0d0907; /* أسود دافئ بلمحة برتقالية داكنة جداً */
}

::-webkit-scrollbar-thumb {
    background: #7c2d12; /* برتقالي غامق فخم جداً */
    border-radius: 999px;
    border: 2px solid #0d0907; /* لإعطاء مظهر انسيابي رفيع وأنيق */
}

::-webkit-scrollbar-thumb:hover {
    background: #ea580c; /* برتقالي غامق نشط ومضيء عند التمرير */
}

/* التوافقية مع متصفح فايرفوكس */
html {
    scrollbar-color: #7c2d12 #0d0907;
    scrollbar-width: thin;
}

/* -------------------------------------------------------------
   2. التهيئات العامة وتنسيق الخطوط والصفحة
   ------------------------------------------------------------- */
html, body {
    overflow-x: hidden;
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*, *:before, *:after {
    box-sizing: inherit;
}

body { 
    font-family: 'Cairo', sans-serif; 
    background-color: var(--bg); 
    color: var(--text-main); 
    direction: rtl;
}

.container { 
    max-width: 1350px; 
    margin: 0 auto; 
    padding: 24px;
    width: 100%;
}

/* -------------------------------------------------------------
   3. شريط التنقل العلوي الموحد والمتجاوب (Responsive Navbar)
   ------------------------------------------------------------- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(to bottom, rgba(9, 13, 22, 0.95) 0%, rgba(9, 13, 22, 0.35) 60%, transparent 100%);
    border: none !important;
    border-bottom: none !important;
    border-radius: 0 !important;
    margin-bottom: 0 !important;
    padding: 24px 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-shadow: none !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.navbar.scrolled {
    background-color: rgba(11, 16, 29, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 14px 48px;
    border-bottom: none !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.navbar-content {
    width: 100%;
    max-width: 1350px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.navbar .logo {
    font-size: 16px;
    font-weight: 900;
    color: #ffffff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar .logo img {
    height: 34px;
    border-radius: 8px;
    object-fit: cover;
}

.navbar .logo span.icon {
    font-size: 20px;
}

/* نموذج البحث في الهيدر */
.search-form {
    flex: 1;
    max-width: 480px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-form input {
    width: 100%;
    background-color: #111625;
    border: 1px solid #1e293b;
    color: #e2e8f0;
    font-size: 11px;
    font-family: 'Cairo', sans-serif;
    border-radius: 9999px;
    padding: 10px 16px 10px 45px;
    transition: all 0.3s;
}

.search-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.search-form .search-btn {
    position: absolute;
    left: 15px;
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.search-form .search-btn:hover {
    color: var(--primary);
}

.search-form .search-btn svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.search-form .clear-search {
    position: absolute;
    left: 42px;
    font-size: 9px;
    font-weight: bold;
    color: #ef4444;
    background-color: rgba(239, 68, 68, 0.1);
    padding: 2px 8px;
    border-radius: 9999px;
    text-decoration: none;
}

/* روابط الهيدر المشتركة */
.navbar .links {
    display: flex;
    align-items: center;
    gap: 12px;
}

.navbar .links a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 11px;
    font-weight: 700;
    transition: color 0.2s;
}

.navbar .links a:hover {
    color: white;
}

.navbar .pill-item {
    background-color: rgba(15, 23, 42, 0.4);
    border: 1px solid #1e293b;
    padding: 8px 14px;
    border-radius: 9999px;
    color: #cbd5e1 !important;
    font-size: 11px !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
}

.navbar .pill-item:hover {
    background-color: #1e293b;
    color: white !important;
}

.navbar .btn-admin {
    background-color: #1e293b;
    border: 1px solid #334155;
    color: white !important;
    padding: 8px 18px;
    border-radius: 9999px;
    font-size: 11px !important;
    font-weight: 800;
    transition: all 0.2s;
}

.navbar .btn-admin:hover {
    background-color: #0284c7;
    border-color: #38bdf8;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.2);
}

/* القائمة المنسدلة (Dropdown Menu) */
.menu-dropdown {
    position: relative;
    display: inline-block;
}

.menu-dropdown-toggle {
    cursor: pointer;
    user-select: none;
    outline: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.menu-dropdown-content {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: 10px;
    background-color: #111625;
    border: 1px solid #1e293b;
    border-radius: 16px;
    min-width: 280px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
    z-index: 2000;
    padding: 12px;
    text-align: right;
    backdrop-filter: blur(8px);
}

.menu-dropdown-content.show {
    display: block;
    animation: fadeInMenu 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInMenu {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-link {
    display: block;
    color: #cbd5e1;
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
    margin-bottom: 2px;
}

.dropdown-link:hover {
    background-color: rgba(56, 189, 248, 0.1);
    color: var(--primary);
}

.dropdown-divider {
    height: 1px;
    background-color: #1e293b;
    margin: 8px 4px;
}

.dropdown-section-title {
    font-size: 10px;
    color: #64748b;
    font-weight: 800;
    padding: 4px 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.menu-category-item-container {
    margin-bottom: 4px;
}

.menu-category-main-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.menu-category-main-row .dropdown-link {
    flex-grow: 1;
    margin-bottom: 0;
}

.submenu-toggle-btn {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 8px 12px;
    font-size: 14px;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.submenu-toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
}

.submenu-toggle-btn.active {
    transform: rotate(180deg);
    color: var(--primary);
}

.submenu-container {
    padding-right: 14px;
    border-right: 1px dashed #1e293b;
    margin-right: 14px;
    margin-top: 2px;
    margin-bottom: 6px;
}

.submenu-link {
    font-size: 11px;
    color: #94a3b8;
}

/* -------------------------------------------------------------
   4. التصميم المتجاوب على الجوال والتابلت (Mobile Responsiveness)
   ------------------------------------------------------------- */
.mobile-nav-btn {
    display: none;
}

.mobile-search-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: #090d16;
    z-index: 10000;
    padding: 16px;
    animation: slideDownMobileSearch 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDownMobileSearch {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

.mobile-search-overlay.active {
    display: block;
}

.mobile-search-container {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    height: 100%;
    max-width: 1350px;
    margin: 0 auto;
}

.mobile-search-input-wrapper {
    position: relative;
    flex: 1;
}

.mobile-search-input-wrapper input {
    width: 100%;
    background-color: #111625;
    border: 1px solid #1e293b;
    color: #e2e8f0;
    font-size: 14px;
    font-family: 'Cairo', sans-serif;
    border-radius: 9999px;
    padding: 12px 45px 12px 16px;
    text-align: right;
    transition: all 0.2s;
}

.mobile-search-input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
}

.mobile-search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    pointer-events: none;
    display: flex;
    align-items: center;
}

.mobile-search-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2.5;
    fill: none;
}

.mobile-search-cancel {
    background: none;
    border: none;
    color: white;
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
}

.mobile-menu-overlay.active {
    display: block;
}

.mobile-menu-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    left: -100%;
    width: 320px;
    max-width: 85%;
    background-color: #111625;
    border-right: 1px solid #1e293b;
    z-index: 10001;
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 25px 0 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    text-align: right;
}

.mobile-menu-drawer.active {
    left: 0;
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #1e293b;
}

.drawer-title {
    font-size: 16px;
    font-weight: 800;
    color: white;
}

.drawer-close {
    background: none;
    border: none;
    color: #64748b;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

@media (max-width: 1024px) {
    .navbar {
        padding: 14px 16px !important;
        background: linear-gradient(to bottom, rgba(9, 13, 22, 0.95) 0%, rgba(9, 13, 22, 0.35) 60%, transparent 100%) !important;
        border-bottom: none !important;
    }
    .navbar.scrolled {
        padding: 10px 16px !important;
        background: rgba(11, 16, 29, 0.95) !important;
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
    }
    .navbar-content {
        position: relative !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        height: 48px !important;
        gap: 0 !important;
    }
    .mobile-menu-toggle {
        display: flex !important;
        position: absolute !important;
        left: 0 !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
    }
    .mobile-search-toggle {
        display: flex !important;
        position: absolute !important;
        right: 0 !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
    }
    .navbar .logo {
        position: absolute !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        margin: 0 !important;
        z-index: 10 !important;
    }
    .navbar .logo span.logo-text {
        display: none !important;
    }
    .navbar .logo span.icon {
        display: inline-block !important;
        font-size: 26px !important;
    }
    .navbar .logo img {
        height: 38px !important;
        max-height: 44px !important;
    }
    .navbar .search-form,
    .navbar .links {
        display: none !important;
    }
    .mobile-nav-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background-color: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.1);
        color: white;
        cursor: pointer;
        transition: all 0.2s;
        z-index: 15;
    }
    .mobile-nav-btn:hover {
        background-color: rgba(255, 255, 255, 0.15);
        transform: scale(1.05);
    }
    .mobile-nav-btn svg {
        width: 22px;
        height: 22px;
        stroke: currentColor;
        stroke-width: 2.5;
        fill: none;
    }
}

/* -------------------------------------------------------------
   5. سلة المشتريات المتجاوبة بالكامل (Responsive Hybrid Cart Modal)
   صندوق فخم منبثق على الكمبيوتر / ورقة تنزلق بانسيابية من الأسفل على الجوال
   ------------------------------------------------------------- */
.cart-btn {
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #f59e0b;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    box-shadow: 0 10px 15px -3px rgba(245, 158, 11, 0.2);
    font-size: 16px;
    padding: 0;
}

.cart-btn:hover {
    background: rgba(245, 158, 11, 0.2);
    transform: scale(1.05);
}

.cart-count-badge {
    position: absolute;
    top: -4px;
    left: -4px;
    background: #f59e0b;
    color: #090d16;
    font-weight: 900;
    font-size: 10px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #090d16;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.cart-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(9, 13, 22, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9998;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* الهجين: صندوق منبثق على الكمبيوتر */
.cart-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 90%;
    max-width: 550px;
    max-height: 85vh;
    background-color: #111625;
    border: 1px solid #1e293b;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.cart-modal.active {
    display: flex;
    transform: translate(-50%, -50%) scale(1);
}

/* الهجين: ورقة منزلقة من أسفل الشاشة على الجوال */
@media (max-width: 640px) {
    .cart-modal {
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        transform: translateY(100%) !important;
        width: 100% !important;
        max-width: 100% !important;
        max-height: 85vh !important;
        border-radius: 24px 24px 0 0 !important;
        border-bottom: none !important;
        box-shadow: 0 -15px 40px rgba(0, 0, 0, 0.6);
    }
    
    .cart-modal.active {
        transform: translateY(0) !important;
    }
}

.cart-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background-color: rgba(9, 13, 22, 0.4);
}

.cart-close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.cart-close-btn:hover {
    color: white;
}

.cart-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 16px;
}

.cart-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.cart-item-img {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    object-fit: cover;
    background-color: #090d16;
}

.cart-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: right;
}

.cart-item-title {
    font-size: 13px;
    font-weight: 700;
    color: white;
    line-clamp: 1;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cart-item-price {
    font-size: 12px;
    font-weight: 800;
    color: var(--primary);
}

.cart-item-remove {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.cart-item-remove:hover {
    background-color: #ef4444;
    color: white;
    transform: scale(1.05);
}

.cart-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: #64748b;
    gap: 12px;
}

.cart-empty-icon {
    font-size: 48px;
}

.cart-modal-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background-color: rgba(9, 13, 22, 0.4);
}

.cart-total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    color: white;
    font-weight: 700;
    margin-bottom: 16px;
}

.cart-total-row strong {
    font-size: 18px;
    color: var(--primary);
    font-weight: 900;
}

.cart-checkout-btn {
    width: 100%;
    background-color: #f59e0b;
    color: #030712;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 10px 15px -3px rgba(245, 158, 11, 0.2);
}

.cart-checkout-btn:hover {
    background-color: #d97706;
    transform: translateY(-2px);
}

/* -------------------------------------------------------------
   6. تذييل الموقع المؤسسي المتكامل (Corporate Footer Styles)
   ------------------------------------------------------------- */
.footer {
    background-color: #0b0f19;
    border-top: 1px solid rgba(15, 23, 42, 0.6);
    color: #94a3b8;
    padding: 48px 24px;
    margin-top: 60px;
    font-size: 13px;
    border-radius: 0;
    width: 100%;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    max-width: 1350px;
    margin: 0 auto;
}

@media(min-width: 768px) {
    .footer-grid {
        grid-template-columns: 1.5fr 1fr 1fr;
    }
}

.footer-col h4 {
    color: white;
    font-size: 15px;
    font-weight: 900;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-col p {
    line-height: 1.8;
    margin: 0 0 16px 0;
}

.footer-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.footer-tag {
    background-color: #111625;
    border: 1px solid #1e293b;
    color: #38bdf8;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-family: monospace;
}

.footer-bottom {
    max-width: 1350px;
    margin: 40px auto 0 auto;
    border-top: 1px solid #1e293b;
    padding-top: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-size: 11px;
    color: #64748b;
}

@media(min-width: 640px) {
    .footer-bottom {
        flex-direction: row;
    }
}
