/* public/css/main/shared/header.css */

/* ===================================
   Custom Navbar Styles
   =================================== */

.custom-navbar {
    background-color: transparent;
    padding: 0;
    transition: all 0.3s ease;
    z-index: 99999999999999912212;
}

.custom-navbar .container-fluid {
    padding: 0 5%;
}

/* Navbar Sections */
.navbar-left,
.navbar-center,
.navbar-right {
    display: flex;
    align-items: center;
}

.navbar-left {
    justify-content: flex-start;
    margin-left: 0;
}

.navbar-center {
    justify-content: center;
    flex: 1;
}

.navbar-right {
    justify-content: flex-end;
    margin-right: 0;
}

/* Logo */
.nav-logo img {
    width: 100px !important;
    height: 100px !important;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.nav-logo:hover img {
    transform: scale(1.05);
}

/* Dark Mode Switch */
.form-switch_dark {
    display: flex !important;
    align-items: center;
}

.form-switch_dark .form-check-input {
    width: 3rem;
    height: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: var(--bgColor);
    border: 2px solid var(--btnColor);
}

.form-switch_dark .form-check-input:checked {
    background-color: var(--btnColor);
    border-color: var(--btnColor);
}

.form-switch_dark .form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(170, 131, 24, 0.25);
    border-color: var(--btnColor);
}

/* Search Button */
.search_icon .btn-search {
    background-color: transparent;
    border: none;
    padding: 0.375rem 0.75rem;
    transition: all 0.3s ease;
}

.search_icon .btn-search i {
    color: var(--textColor);
    font-size: 1.1rem;
}

.search_icon .btn-search:hover i {
    color: var(--btnColor);
    transform: scale(1.1);
}

/* Language & Currency */
.lang_curanc {
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.25rem 0.5rem;
    border-radius: 5px;
}

.lang_curanc:hover {
    background-color: rgba(170, 131, 24, 0.1);
}

.lang_curanc h4 {
    font-size: 15px;
    color: var(--textColor);
    margin: 0 0 0 10px;
}

/* User, Cart, Wishlist Icons */
.navbar-right .user a,
.navbar-right .cart a {
    color: var(--textColor);
    font-size: 1.25rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.navbar-right .user a:hover,
.navbar-right .cart a:hover {
    color: var(--btnColor);
    transform: scale(1.1);
}

/* Cart & Fav Badges */
.cart-badge,
.fav-badge {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    top: -5px;
    right: -5px;
}

.cart-badge {
    background-color: var(--Secondary-color);
    color: var(--body_bgColor);
}

.fav-badge {
    background-color: #dc3545;
    color: #ffffff;
}

/* Logout Button */
.logout .btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.logout .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Mobile Menu Toggle */
.menu {
    cursor: pointer;
    color: var(--textColor);
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.menu:hover {
    color: var(--btnColor);
}

/* Fixed Navbar */
.fix {
    background: linear-gradient(90deg, 
        rgba(5, 6, 8, 0.5) 0%, 
        rgba(20, 16, 5, 0.95) 50%, 
        rgba(5, 6, 8, 0.5) 100%) !important;
    background-size: 200% auto !important;
    animation: slideDown 0.5s ease, glassGradientMove 5s ease infinite alternate !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    position: fixed !important;
    top: 0;
    right: 0;
    left: 0;
    height: 70px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    z-index: 99999999999999912212;
    transition: all 0.5s linear;
}

.fix .nav-logo img {
    width: 70px !important;
    height: 70px !important;
    top: 0;
}

@keyframes slideDown {
    from {
        transform: translateY(-100px);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes glassGradientMove {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

/* Dark Mode Styles for Navbar */
body.dark_mode .custom-navbar {
    background-color: transparent;
}

body.dark_mode .fix {
    background: linear-gradient(90deg, rgba(5, 6, 8, 0.5) 0%, rgba(20, 16, 5, 0.95) 50%, rgba(5, 6, 8, 0.5) 100%) !important;
}

body.dark_mode .lang_curanc:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Responsive */
@media (max-width: 991.98px) {
    .navbar-left,
    .navbar-right {
        flex: 0 0 auto;
    }

    .navbar-center {
        flex: 1;
    }

    .nav-logo img {
        width: 60px !important;
        height: 60px !important;
    }

    .fix .nav-logo img {
        width: 50px !important;
        height: 50px !important;
    }

    .lang_curanc {
        display: none !important;
    }

    .form-switch_dark .form-check-input {
        width: 2.5rem;
        height: 1.3rem;
    }
}

@media (max-width: 767.98px) {
    .custom-navbar .container-fluid {
        padding: 0 3%;
    }

    .navbar-left .gap-2,
    .navbar-right .gap-2 {
        gap: 0.5rem !important;
    }

    .search_icon .btn-search i {
        font-size: 1rem;
    }

    .navbar-right .user a,
    .navbar-right .cart a {
        font-size: 1.1rem;
    }
}

@media (max-width: 575.98px) {
    .custom-navbar .container-fluid {
        padding: 0 2%;
    }

    .nav-logo img {
        width: 50px !important;
        height: 50px !important;
    }

    .navbar-left .gap-2,
    .navbar-right .gap-2 {
        gap: 0.25rem !important;
    }

    .form-switch_dark .form-check-input {
        width: 2.2rem;
        height: 1.2rem;
    }
}

/* [أدوات مساعدة للهيدر] - تنسيقات الشارات والمواضع (Badges & Positioning) */
/* [لماذا هنا] - كانت موجودة كـ Inline CSS في ملف الهيدر، تم نقلها هنا لتوحيد التنسيقات */

/* Navbar Icon Button Style (Unified Premium Look) */
.nav-icon-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px; /* Circular */
    border: 1px solid rgba(212, 175, 55, 0.35); /* Subtle Gold Border */
    color: #e8e8e8; /* Light Text */
    background: transparent;
    transition: all 0.2s ease;
    font-size: 1.1rem;
    cursor: pointer;
}

.nav-icon-btn:hover,
.nav-icon-btn:focus,
.nav-icon-btn.active {
    color: #d4af37; /* Gold Text */
    border-color: #d4af37; /* Gold Border */
    background: rgba(212, 175, 55, 0.08); /* Slight Gold Background */
    transform: translateY(-1px);
}

/* Update Badge Positioning for new buttons */
.cart-badge,
.fav-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    background-color: #dc3545; /* Bootstrap Danger Red */
    color: #fff;
    border: 2px solid var(--bgColor); /* Border matches bg to create 'cutout' look */
}

/* Update Logo Container */
.nav-logo {
    display: flex;
    justify-content: center;
    align-items: center;
}

.nav-logo img {
    /* Increased size flexibility */
    max-width: 140px; 
    height: auto;
    max-height: 80px; 
    object-fit: contain;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.nav-logo:hover img {
    transform: scale(1.05); /* Slight Scale */
    filter: drop-shadow(0 0 5px rgba(212, 175, 55, 0.3)); /* Gold Glow */
}

/* --- Master Header Rebuild Styles --- */
/* Applied to .wolf-navbar to override others */
.wolf-navbar {
    background: linear-gradient(90deg, 
        rgba(5, 6, 8, 0.45) 0%, 
        rgba(20, 16, 5, 0.9) 50%, 
        rgba(5, 6, 8, 0.45) 100%) !important;
    background-size: 200% auto !important;
    animation: glassGradientMove 5s ease infinite alternate !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border-bottom: 1px solid rgba(212, 175, 55, 0.12);
    padding: 0.5rem 1rem;
    position: sticky;
    top: 0;
    z-index: 1020;
    width: 100%;
    transition: all 0.3s ease;
}

.wolf-navbar .dropdown-menu {
    background: #111;
    border: 1px solid rgba(212, 175, 55, 0.25);
    padding: 0.5rem;
}

.wolf-navbar .dropdown-item {
    color: #eee;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.wolf-navbar .dropdown-item:hover,
.wolf-navbar .dropdown-item:focus,
.wolf-navbar .dropdown-item.active {
    background: rgba(212, 175, 55, 0.15);
    color: #d4af37;
}

/* Zone Alignment Utility */
.nav-zone {
    flex: 1;
}

.nav-zone-start {
    justify-content: flex-start;
}

.nav-zone-center {
    justify-content: center;
}

.nav-zone-end {
    justify-content: flex-end;
}

/* RTL Specific Adjustments */
[dir="rtl"] .dropdown-menu-end {
    right: 0 !important;
    left: auto !important;
}

[dir="rtl"] .nav-zone-start {
    border-right: none !important;
}

/* Adjusted Logo for Bigger Visibility */
.wolf-navbar .nav-logo img,
.wolf-navbar .logo img {
    max-height: 54px !important; /* Increased from 40px */
    width: auto !important;
    max-width: 200px !important; /* Allow wider logo */
    object-fit: contain;
}

/* [تعديل] - تجميع الأيقونات في اليسار (Group Icons Left) */
.navbar-icons-left {
    display: flex;
    align-items: center;
    gap: 0.5rem; /* Consistent gap */
    white-space: nowrap;
    flex-wrap: nowrap;
}

/* Ensure Profile Button matches others exactly */
.wolf-navbar #profileDropdown.nav-icon-btn {
    border: 1px solid rgba(212, 175, 55, 0.35) !important;
    border-radius: 50% !important;
    width: 44px !important;
    height: 44px !important;
    background: transparent !important;
}

/* [تعديل] تنسيق لوجو أكبر ومتدلي */
.nav-logo-container {
    position: relative;
    z-index: 1000;
}

.main-logo {
    max-height: 70px !important; /* Ensure override */
    width: auto;
    transition: transform 0.3s ease;
    /* السماح للوجو بالخروج عن حدود النافبار */
    position: relative;
    top: 5px; /* يدفع اللوجو للأسفل قليلاً */
}

/* [تعديل] تنسيق أزرار النافبار */
.nav-icon-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(212, 175, 55, 0.5); /* حدود ذهبية خفيفة */
    background: transparent;
    color: #fff; /* أو لون من الثيم */
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0;
}

.nav-icon-btn:hover, .nav-icon-btn:focus {
    background-color: rgba(212, 175, 55, 0.2);
    border-color: #d4af37;
    color: #d4af37;
}

/* [تعديل] قائمة البحث المنسدلة العائمة */
.search-container {
    position: relative;
}

.search-dd-panel {
    position: absolute;
    top: calc(100% + 15px);
    right: 0; /* أو left حسب الاتجاه، الـ HTML dir يديره */
    width: 300px;
    background-color: #1a1a1a;
    border: 1px solid #d4af37;
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    z-index: 9999;
}
/* سهم صغير للأعلى (اختياري) */
.search-dd-panel::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 15px; /* محاذاة مع أيقونة البحث */
    width: 10px;
    height: 10px;
    background-color: #1a1a1a;
    border-left: 1px solid #d4af37;
    border-top: 1px solid #d4af37;
    transform: rotate(45deg);
}

.search-submit-btn {
    background: #d4af37;
    border: none;
    color: #000;
    padding: 0 15px;
    border-radius: 0 5px 5px 0;
    height: 38px;
    transition: background 0.3s;
}

.search-submit-btn:hover {
    background: #b59021;
}

.search-input {
    border-radius: 5px 0 0 5px;
    border: 1px solid #444;
    background: #2a2a2a;
    color: #fff;
    height: 38px;
}

.search-input:focus {
    background: #333;
    color: #fff;
    border-color: #d4af37;
    box-shadow: none;
}

/* [تعديل] إصلاح الخط الذهبي أسفل النافبار */
/* تأكد من أن الكونتينر لا يملك border-bottom يؤثر على العناصر المتدلية */
.wolf-navbar {
    box-shadow: 0 2px 10px rgba(0,0,0,0.2) !important;
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
    /* border-bottom: 1px solid rgba(212, 175, 55, 0.1);  يمكن إزالته إذا كان مزعجاً */
}

/* [جديد] تنسيق لوحة البحث العائمة تحت اللوجو */
.nav-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2147483647; /* Ensure it is absolutely on top */
    background: rgba(0, 0, 0, 0.2); /* Slight dim for focus, optional */
}

.nav-search-panel {
    position: fixed; /* JS sets top/left */
    background: #0b0b0b;
    border: 1px solid rgba(212, 175, 55, 0.5);
    border-radius: 99px; /* Pill shape for modern look */
    padding: 8px 15px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 2001;
    /* Initial state hidden handled by inline style */
}

.nav-search-input {
    background: transparent;
    border: none;
    color: #eee;
    outline: none;
    width: 100%;
    font-size: 1rem;
    padding: 5px;
}

.nav-search-input::placeholder {
    color: #666;
}

.nav-search-submit {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: #d4af37;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* [تعديل] تنسيق اللوجو "نصف متدلي" - تكبير الحجم بشكل ملحوظ */
.nav-logo-hang {
    position: relative;
    height: 60px; /* ارتفاع ثابت للكونتينر */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible; /* السماح للصورة بالخروج */
    z-index: 1002;
    margin-top: 5px;
}

.nav-logo-img {
    max-height: 130px !important; /* تكبير اللوجو  */
    width: auto;
    object-fit: contain;
    transform: translateY(35px); /* تعليق اللوجو */
    transition: transform 0.3s ease;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
}

.nav-logo-img:hover {
    transform: translateY(35px) scale(1.05);
}

/* [تعديل] توحيد أزرار الأيقونات */
.nav-icon-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important; /* فرض الدائرة */
    border: 1px solid rgba(212, 175, 55, 0.5); 
    background: transparent;
    color: #fff;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0;
    margin: 0;
}

/* تنسيق زر الوضع الليلي داخل القائمة المنسدلة */
#darkModeToggle.dropdown-item {
    cursor: pointer;
    transition: background 0.2s;
}
#darkModeToggle.dropdown-item:active {
    background-color: #333;
    color: #d4af37;
}

/* تحديث حقل البحث ليملأ المساحة */
.nav-search-input {
    flex: 1; 
    padding: 0 10px;
}

/* =========================================
   [NEW] Master Fixes: Dropdowns, Links, Logo
   ========================================= */

/* 1. Dropdown Positioning Safety */
.dropdown-menu {
    margin-top: 10px !important; /* Gap from button */
    border: 1px solid rgba(212, 175, 55, 0.2);
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    background-color: #111;
    z-index: 1050; /* Above everything */
    min-width: 160px;
}

/* Hide default Bootstrap arrow for icon buttons */
.hide-arrow::after {
    display: none !important;
}

/* RTL Support for Dropdowns */
/* [REMOVED global override to fix RTL positioning bug] */


/* 2. Top InfoBar Links (Inline, Gold Hover, Zoom) */
.top-infobar-links {
    margin-left: 30px; /* Spacing from icons */
    white-space: nowrap;
}

/* RTL spacing */
[dir="rtl"] .top-infobar-links {
    margin-left: 0;
    margin-right: 30px;
}

/* [NEW] Nav Switchers Adjustment (Move down) */
.nav-switchers {
    transform: translateY(8px);
}

.top-link {
    color: #e0e0e0;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
    transition: all 0.3s ease;
    padding: 5px 0;
}

.top-link:hover {
    color: #d4af37; /* Gold */
    transform: scale(1.05); /* Zoom In */
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.4); /* Subtle Glow */
}

/* Animated Underscore */
.top-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: 0;
    left: 50%;
    background-color: #d4af37;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.top-link:hover::after {
    width: 100%;
}

/* 3. Logo Fire/Glow Animation */
@keyframes goldPulse {
    0% { filter: drop-shadow(0 0 2px rgba(212, 175, 55, 0.2)); }
    50% { filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.5)); }
    100% { filter: drop-shadow(0 0 2px rgba(212, 175, 55, 0.2)); }
}

@keyframes fireGlow {
    0% { filter: drop-shadow(0 0 5px rgba(212, 175, 55, 0.6)); transform: translateY(35px) scale(1.05); }
    50% { filter: drop-shadow(0 -5px 15px rgba(255, 140, 0, 0.6)); transform: translateY(34px) scale(1.06); }
    100% { filter: drop-shadow(0 0 5px rgba(212, 175, 55, 0.6)); transform: translateY(35px) scale(1.05); }
}

.nav-logo-img {
    animation: goldPulse 3s infinite ease-in-out; /* Idle Animation */
}

.nav-logo-img:hover {
    animation: fireGlow 1.5s infinite alternate; /* Hover Fire Effect */
}

/* 4. Search Overlay Fixes */
.nav-search-overlay {
    background: rgba(0, 0, 0, 0.4); /* Dim background */
    backdrop-filter: blur(2px); /* Modern blur */
}

.nav-search-panel {
    border: 1px solid #d4af37; /* Stronger Gold Border */
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
}

/* =========================================
   [NEW] Live Fire Loop Animation (Continuous)
   ========================================= */

/* تعليق عربي: ضمان ظهور تأثير النار وعدم قصّه بسبب overflow أو ترتيب الطبقات */
.logo-fire {
    position: relative;
    display: inline-block;
    isolation: isolate;
    overflow: visible !important;
    z-index: 2;
}

/* طبقة وهج/حرارة خلف اللوجو */
.logo-fire::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 55%;
    width: 160%;
    height: 170%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 1;

    background:
        radial-gradient(closest-side at 50% 78%, rgba(255, 200, 80, 0.55), transparent 70%),
        radial-gradient(closest-side at 35% 85%, rgba(255, 120, 0, 0.45), transparent 72%),
        radial-gradient(closest-side at 65% 85%, rgba(255, 50, 0, 0.35), transparent 75%);
    filter: blur(14px);
    mix-blend-mode: screen;
    opacity: 0.95;

    animation: fireGlow 1.8s infinite ease-in-out;
}

/* طبقة لهب متحركة (لسانات نار) */
.logo-fire::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 25%;
    width: 140%;
    height: 150%;
    transform: translate(-50%, -10%);
    pointer-events: none;
    z-index: 1;

    background:
        radial-gradient(closest-side at 50% 100%, rgba(255, 210, 90, 0.55), transparent 65%),
        radial-gradient(closest-side at 40% 100%, rgba(255, 120, 0, 0.55), transparent 70%),
        radial-gradient(closest-side at 60% 100%, rgba(255, 40, 0, 0.35), transparent 72%);

    filter: blur(9px);
    mix-blend-mode: screen;
    opacity: 0.92;

    clip-path: polygon(
        50% 0%,
        62% 12%,
        70% 26%,
        66% 40%,
        78% 55%,
        60% 68%,
        68% 86%,
        50% 100%,
        32% 86%,
        40% 68%,
        22% 55%,
        34% 40%,
        30% 26%,
        38% 12%
    );

    animation: fireRise 1.1s infinite ease-in-out;
}

/* اللوجو نفسه فوق النار */
.logo-fire .nav-logo-img {
    position: relative;
    z-index: 2;
    animation: logoFlicker 1.35s infinite ease-in-out;
    filter:
        drop-shadow(0 0 6px rgba(212, 175, 55, 0.45))
        drop-shadow(0 0 16px rgba(255, 140, 0, 0.25));
}

/* Animations (Overwriting previous matches if any, or separate) */
@keyframes fireGlow {
    0%   { transform: translate(-50%, -50%) scale(1);    opacity: 0.85; filter: blur(14px); }
    50%  { transform: translate(-50%, -52%) scale(1.06); opacity: 1;    filter: blur(16px); }
    100% { transform: translate(-50%, -50%) scale(1);    opacity: 0.88; filter: blur(14px); }
}

@keyframes fireRise {
    0%   { transform: translate(-50%, -10%) scale(1);    opacity: 0.75; }
    50%  { transform: translate(-50%, -18%) scale(1.08); opacity: 0.92; }
    100% { transform: translate(-50%, -10%) scale(1);    opacity: 0.78; }
}

@keyframes logoFlicker {
    0%   { filter: drop-shadow(0 0 6px rgba(212,175,55,.45)) drop-shadow(0 0 16px rgba(255,140,0,.25)); }
    40%  { filter: drop-shadow(0 0 8px rgba(212,175,55,.55)) drop-shadow(0 0 20px rgba(255,140,0,.35)); }
    70%  { filter: drop-shadow(0 0 5px rgba(212,175,55,.40)) drop-shadow(0 0 14px rgba(255,140,0,.22)); }
    100% { filter: drop-shadow(0 0 6px rgba(212,175,55,.45)) drop-shadow(0 0 16px rgba(255,140,0,.25)); }
}

/* احترام إعدادات تقليل الحركة */
@media (prefers-reduced-motion: reduce) {
    .logo-fire::before,
    .logo-fire::after,
    .logo-fire .nav-logo-img {
        animation: none !important;
    }
}

/* ===================================
   Radial Menu Styles (Logo Click)
   =================================== */

/* تعليق عربي: طبقة خلفية لإغلاق القائمة عند الضغط خارجها */
.logo-radial-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
    z-index: 9998;
}

/* تعليق عربي: حاوية القائمة الدائرية حول اللوجو */
.logo-radial-menu {
    position: fixed;
    left: 0;
    top: 0;
    transform: translate(-50%, -50%);
    z-index: 9999;
    pointer-events: none;
    width: 300px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* تعليق عربي: منع تسريب أزرار الـ radial menu عند (0,0) على الصفحات الـ standalone مثل manual_pay عند فشل تهيئة الـ JS */
.logo-radial-menu:not(.radial-positioned) .radial-item{
  display: none !important;
}

/* arc - تمت إزالته بناء على طلب العميل */

/* items container */
.logo-radial-items {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    pointer-events: auto;
}

/* items default hidden at center */
.logo-radial-items .radial-item {
    position: absolute;
    left: 0;
    top: 0;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: transform 400ms cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 300ms ease, background 0.2s, border-color 0.2s;
    cursor: pointer;
    text-decoration: none;
}

.logo-radial-items .radial-item:hover {
    background: #2a2a2a;
    border-color: #d4af37;
    color: #d4af37;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.25);
    z-index: 10;
}

/* open state uses CSS variables set by JS */
.logo-radial-menu.is-open .logo-radial-items .radial-item {
    opacity: 1;
    /* Translate to position, then translate -50% -50% for centering */
    transform: translate(calc(var(--x) - 50%), calc(var(--y) - 50%)) scale(1);
}

/* Staggered delay for items */
.logo-radial-menu.is-open .radial-item:nth-child(1) { transition-delay: 50ms; }
.logo-radial-menu.is-open .radial-item:nth-child(2) { transition-delay: 100ms; }
.logo-radial-menu.is-open .radial-item:nth-child(3) { transition-delay: 150ms; }
.logo-radial-menu.is-open .radial-item:nth-child(4) { transition-delay: 200ms; }
.logo-radial-menu.is-open .radial-item:nth-child(5) { transition-delay: 250ms; }

/* ===================================
   Text Dropdowns (Lang/Currency)
   =================================== */

/* تعليق عربي: ستايل Dropdown نصي للغة/العملة مثل الريفرنس */
.nav-text-dds {
    gap: 14px;
    margin-inline-start: 18px;
    margin-inline-end: 18px;
}

.nav-text-dd-trigger {
    background: transparent;
    border: 0;
    color: rgba(255, 255, 255, 0.92);
    font-size: 13px;
    letter-spacing: 0.3px;
}

/* ===================================
   Top Bar (Language & Currency)
   =================================== */

/* [تعديل] Topbar رفيع فوق الـ Navbar لنقل اللغة والعملة مثل الريفرنس */
.topbar {
    height: 32px;
    background: rgba(0, 0, 0, 0.35);
    border-bottom: 1px solid rgba(212, 175, 55, 0.25);
    backdrop-filter: blur(6px);
    position: relative;
    z-index: 1030;
}

/* =========================================
   [تعليق عربي] إصلاح الفراغ الزائد فوق التوب بار للديسكتوب
   Desktop-only Topbar Gap Fix
   ========================================= */
@media (min-width: 992px) {
    /* [تعليق عربي] إزالة أي هوامش علوية زائدة قد تسبب شريط أسود فارغ في أعلى الشاشة */
    body {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    .topbar {
        margin-top: 0 !important;
        top: 0 !important;
    }
}

.topbar-right {
    margin-inline-start: auto;
}

/* [تعديل] Dropdown button text-style (no circles) */
.topbar-dd-btn {
    background: transparent;
    border: 0;
    color: #eaeaea;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease;
}

.topbar-dd-btn:hover {
    color: #d4af37;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.25);
}

.topbar-dd-text {
    font-weight: 500;
    letter-spacing: 0.3px;
}

.topbar-dd-menu {
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid rgba(212, 175, 55, 0.25);
    backdrop-filter: blur(10px);
    margin-top: 8px !important;
    z-index: 2000;
    min-width: 160px;
    padding: 6px 0;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.topbar-dd-menu .dropdown-item {
     color: rgba(255, 255, 255, 0.9);
     font-size: 13px;
     padding: 6px 16px;
}

.topbar-dd-menu .dropdown-item:hover,
.topbar-dd-menu .dropdown-item.active {
    background: rgba(212, 175, 55, 0.15);
    color: #d4af37;
}

/* RTL Safety */
[dir="rtl"] .topbar .dropdown-menu-end {
    right: auto !important;
    left: 0 !important;
}

.nav-text-dd-trigger:hover {
    color: #d4af37;
    transform: translateY(-1px);
}

.nav-dd-sep {
    color: rgba(255, 255, 255, 0.25);
}

/* ===================================
   Center Hanging Logo
   =================================== */

/* [تعديل] حاوية وسطية لضمان توسيط اللوجو داخل الـ Navbar */
.nav-zone-center {
    flex: 1 1 auto;
    position: relative;
    pointer-events: none; /* يمنع تغطية النقر على العناصر خلفه */
}

.nav-zone-center .nav-logo-link {
    pointer-events: auto; /* إعادة النقر للوجو فقط */
}

/* [تعديل] تأثير "نص طاير/متدلّي" للوجو */
.nav-logo-hang {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    z-index: 50;
}

.nav-logo-img {
    height: auto;
    max-height: 120px;           /* تكبير واضح */
    width: auto;
    transform: translateY(26px); /* تدلي نصفه لأسفل */
    filter: drop-shadow(0 6px 14px rgba(0,0,0,0.45));
    transition: transform 0.3s ease;
}

/* [تعديل] ضمان أن الـ Navbar يسمح بخروج اللوجو لأسفل */
.custom-navbar, .wolf-navbar, .navbar.custom-navbar {
    overflow: visible !important;
}

/* Responsive adjustment if needed */
@media (max-width: 992px) {
    .nav-logo-img {
        max-height: 90px;
        transform: translateY(18px);
    }
}

.dd-flag {
    font-size: 14px;
    line-height: 1;
}

.dd-caret {
    font-size: 11px;
    opacity: .85;
}

/* تعليق عربي: ضبط مكان القوائم المنسدلة ومنع ظهورها في مكان غريب */
.nav-text-dd-menu {
    min-width: 190px;
    margin-top: 10px !important;
    z-index: 1055;
    background: rgba(20, 20, 20, 0.98);
    border: 1px solid rgba(212, 175, 55, 0.25);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
}

/* Hover items inside dropdown */
.nav-text-dd-menu .dropdown-item {
    color: rgba(255, 255, 255, 0.9);
}

.nav-text-dd-menu .dropdown-item:hover {
    color: #d4af37;
    background: rgba(212, 175, 55, 0.08);
}

/* RTL safety: keep text-dd strip readable */
[dir="rtl"] .nav-text-dds {
    direction: ltr;
}

/* تعليق عربي: تثبيت اتجاه dropdown-menu-end مع RTL */
[dir="rtl"] .nav-text-dd-menu.dropdown-menu-end {
    right: auto !important;
    left: 0 !important;
}

/* =========================================
   Navbar Dropdown Theme (Dark + Gold)
   ========================================= */
.wolf-navbar .dropdown-menu.nav-dd-menu {
    background: #0b0b0b;
    background: linear-gradient(180deg, #0b0b0b 0%, #151515 100%);
    border: 1px solid rgba(212, 175, 55, 0.45);
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
    padding: 10px 0;
    min-width: 180px;
    margin-top: 10px; /* Slight offset from toggle */
}

/* Dropdown Items */
.wolf-navbar .dropdown-menu.nav-dd-menu .dropdown-item {
    color: #fff;
    padding: 10px 16px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wolf-navbar .dropdown-menu.nav-dd-menu .dropdown-item:hover,
.wolf-navbar .dropdown-menu.nav-dd-menu .dropdown-item:focus,
.wolf-navbar .dropdown-menu.nav-dd-menu .dropdown-item.active {
    background: rgba(212, 175, 55, 0.12);
    color: #d4af37;
    transform: translateX(4px); /* Hover effect */
}

/* Divider */
.wolf-navbar .dropdown-menu.nav-dd-menu .dropdown-divider {
    border-top: 1px solid rgba(212, 175, 55, 0.22);
    margin: 6px 0;
}

/* Scrollbar for long lists */
.wolf-navbar .dropdown-menu.nav-dd-menu::-webkit-scrollbar {
    width: 6px;
}
.wolf-navbar .dropdown-menu.nav-dd-menu::-webkit-scrollbar-track {
    background: #0b0b0b;
    border-radius: 0 12px 12px 0;
}
.wolf-navbar .dropdown-menu.nav-dd-menu::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.4);
    border-radius: 10px;
}
.wolf-navbar .dropdown-menu.nav-dd-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.7);
}

/* Multi-level Dropdown Styles */
.dropdown-submenu {
    position: relative;
}

.wolf-navbar .dropdown-submenu > .dropdown-menu {
    top: 0;
    margin-top: -6px;
    border-radius: 12px;
    background: #0b0b0b;
    background: linear-gradient(180deg, #0b0b0b 0%, #151515 100%);
    border: none !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: none;
    min-width: 180px;
    position: absolute;
    z-index: 1000;
}

/* Base side to open (Open to the Right visually) */
/* For RTL, left: 100% moves the box to the logical left side of the parent menu block. 
   But since it's opening opposite of what they want, let's set right: auto and left: -100% or something?
   Wait, if it's RTL, the menu aligns to the right. 
   If they want it to open to the left visually (away from screen edge), right: 100% / left: auto works.
   If they want it to open to the right visually, left: 100% / right: auto works.
   Let's set left: 100% and right: auto!important for RTL as they said it opens opposite. */
.wolf-navbar .dropdown-submenu > .dropdown-menu {
    left: auto !important;
    right: 100% !important;
    margin-left: 0;
}

/* If screen is small or it needs to open to the left, we can add a class but user wants right. 
   However, in RTL, left:100% pushes it to the right visually, which is correct. */

html[dir="rtl"] .wolf-navbar .dropdown-submenu > .dropdown-menu,
[dir="rtl"] .wolf-navbar .dropdown-submenu > .dropdown-menu,
body[dir="rtl"] .wolf-navbar .dropdown-submenu > .dropdown-menu {
    left: 100% !important;
    right: auto !important;
}

/* Force show on hover with !important to override any bootstrap styles */
.wolf-navbar .dropdown-submenu:hover > .dropdown-menu {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.wolf-navbar .dropdown-submenu > a::after {
    display: block;
    content: " ";
    float: right; 
    width: 0;
    height: 0;
    border-color: transparent;
    border-style: solid;
    border-width: 5px 0 5px 5px;
    border-right-color: transparent;
    border-left-color: #d4af37;
    margin-top: 5px;
    margin-right: -5px;
}

html[dir="rtl"] .wolf-navbar .dropdown-submenu > a::after,
[dir="rtl"] .wolf-navbar .dropdown-submenu > a::after {
    float: left;
    border-width: 5px 0 5px 5px; /* Points right */
    border-left-color: #d4af37;  /* Points right */
    border-right-color: transparent; 
    margin-left: -5px;
    margin-right: auto;
}

/* Prevent parent clipping */
.wolf-navbar,
.wolf-navbar .container,
.wolf-navbar .container-fluid {
    overflow: visible !important;
}

/* =========================================
   [تعليق عربي] Mobile/Tablet 3-Zone Navbar Layout
   Mobile: max-width 767px | Tablet: 768px-1024px
   هذا الكود مسؤول نهائياً عن اللوجو في المنتصف على الموبايل والتابلت
   ========================================= */

/* --- Global overflow prevention (mobile/tablet only) --- */
@media (max-width: 1024px) {
    body {
        overflow-x: hidden;
    }
    .wolf-navbar {
        overflow: visible !important; /* نحتاج overflow:visible لتأثير التدلي */
    }
}

/* =============================================
   Mobile Navbar Shell (المظهر الكامل للموبايل)
   ============================================= */
@media (max-width: 767px) {
    /* ارتفاع الـ Navbar على الموبايل */
    .wolf-navbar {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        min-height: 60px;
    }

    /* الكونتينر يصبح relative ليحتوي على الـ absolute logo */
    .wolf-navbar .container-fluid {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* Shell الرئيسي: يتمدد لكامل عرض الـ navbar */
    .mobile-navbar-shell {
        width: 100%;
        min-height: 60px;
        position: relative;
        padding: 0 12px;
    }

    /* NAV-LEFT: reserved space (يعادل عرض nav-right لضمان توسيط حقيقي) */
    .mob-nav-left {
        min-width: 96px; /* يجب أن يساوي تقريباً عرض mob-nav-right */
        flex-shrink: 0;
    }

    /* NAV-CENTER: container للوجو المتمركز بشكل مطلق */
    .mob-nav-center {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        z-index: 10;
        display: flex;
        align-items: center;
        justify-content: center;
        pointer-events: auto;
    }

    /* اللوجو داخل mob-nav-center: بنرجعه متدلي وأكبر نسبياً */
    .mob-nav-center .nav-logo-hang {
        height: auto !important;
        margin-top: 0 !important;
        overflow: visible;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
    }

    .mob-logo-img {
        max-height: 85px !important; /* تكبير اللوجو ليكون بارزاً */
        max-width: 150px !important;
        width: auto !important;
        transform: translateY(18px) !important; /* تدلي لأسفل زي الديسكتوب */
        object-fit: contain;
        filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4)); /* ظل خفيف لإبرازه */
    }

    /* NAV-RIGHT (DOM-first = visual right in RTL): Back button + Hamburger */
    /* margin-inline-end: auto pushes this element toward the logical start = visual right in RTL */
    .mob-nav-right {
        margin-inline-end: 0; /* stays at visual right (DOM-first in RTL flex) */
        gap: 8px;
        flex-shrink: 0;
    }

    /* NAV-LEFT (DOM-last = visual left in RTL): Cart Icon */
    .mob-nav-left {
        flex-shrink: 0;
    }
    /* أزرار الـ navbar: touch-friendly */
    .mob-back-btn,
    .mob-hamburger-btn {
        min-width: 44px !important;
        min-height: 44px !important;
        width: 44px !important;
        height: 44px !important;
        padding: 0 !important;
        flex-shrink: 0;
    }

    /* badges */
    .cart-badge, .fav-badge {
        width: 18px !important;
        height: 18px !important;
        font-size: 10px !important;
        top: -3px !important;
        right: -3px !important;
    }
}

/* ====================================================
   NEW 3-ZONE MOBILE NAVBAR (<= 991px)
   ==================================================== */
.nav-mobile-row {
    display: none; /* Hidden on desktop */
}

@media (max-width: 991px) {
    .wolf-navbar .container-fluid {
        padding: 0 !important;
    }

    .nav-mobile-row {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        height: 64px;
        width: 100%;
        padding: 0 8px; /* تقليل البادينج قليلاً لمساحة أكبر */
        position: relative;
    }

    .nav-right, .nav-left {
        width: auto; /* تغيير من 92px ليكون مرن حسب عدد الأيقونات */
        display: flex;
        align-items: center;
        flex-shrink: 0;
    }

    /* RTL: nav-right is Hamburger at the far right */
    .nav-right {
        justify-content: flex-end;
    }

    /* RTL: nav-left remains flexible */
    .nav-left {
        justify-content: flex-start;
        gap: 12px; /* زيادة المسافة قليلاً ليكون الشكل احترافي */
        position: relative !important; 
    }

    .nav-center {
        flex: 1;
        display: flex;
        justify-content: center;
        position: relative;
    }

    /* Standardize Icons hit-area and add Ring (Border) */
    .nav-icon-btn {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        border-radius: 50% !important;
        font-size: 17px !important;
        padding: 0 !important;
        border: 1.5px solid rgba(212, 175, 55, 0.6) !important; /* رينج ذهبي أوضح */
        background: rgba(0, 0, 0, 0.4) !important;
        color: #d4af37 !important;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
    }

    .nav-icon-btn:active {
        background: rgba(212, 175, 55, 0.3) !important;
        transform: scale(0.9);
        border-color: #d4af37 !important;
    }

    /* Mobile Overlay Backdrop (Glassmorphism bg) */
    .mobile-overlay-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        z-index: 99998;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .mobile-overlay-backdrop.is-open {
        display: block;
        opacity: 1;
    }

    /* Central Profile Overlay - PREMIUM UPGRADE */
    .mobile-profile-overlay {
        display: none;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -40%); /* يبدأ من تحت قليلاً للحركة */
        width: 85%;
        max-width: 320px;
        background: rgba(15, 15, 15, 0.85);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1.5px solid rgba(212, 175, 55, 0.6);
        border-radius: 25px;
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.9), 0 0 30px rgba(212, 175, 55, 0.1);
        padding: 0;
        z-index: 99999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    .mobile-profile-overlay.is-open {
        display: block;
        opacity: 1;
        visibility: visible;
        transform: translate(-50%, -50%);
    }

    /* Overlay Header */
    .overlay-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 20px 25px;
        border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    }

    .overlay-title {
        color: #d4af37;
        font-weight: 700;
        font-size: 1.1rem;
        letter-spacing: 1px;
    }

    .overlay-close {
        background: none;
        border: none;
        color: #fff;
        font-size: 28px;
        line-height: 1;
        padding: 0;
        cursor: pointer;
        opacity: 0.7;
        transition: opacity 0.2s;
    }

    .overlay-close:hover {
        opacity: 1;
        color: #d4af37;
    }

    .overlay-content {
        padding: 15px 0;
    }

    .mob-dd-item {
        display: flex;
        align-items: center;
        gap: 15px;
        padding: 15px 25px;
        color: #efefef;
        text-decoration: none;
        font-size: 15px;
        font-weight: 500;
        transition: all 0.3s ease;
    }

    .mob-dd-item:active {
        background: rgba(212, 175, 55, 0.2);
        color: #d4af37;
    }

    .mob-dd-item i {
        color: #d4af37;
        width: 20px;
        font-size: 18px;
        text-align: center;
    }

    .mob-dd-divider {
        height: 1px;
        background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.3), transparent);
        margin: 10px 0;
    }
}
