/* 
 * Main Theme CSS for Gayar Plus
 * Unified file combining site-wide.css, modern-theme.css, and navbar-fix.css
 * Clean, organized, and optimized for performance
 */

/* ===== CSS VARIABLES ===== */
:root {
    --primary-navy: #1e3a8a;
    --primary-blue: #3b82f6;
    --accent-emerald: #059669;
    --pure-white: #ffffff;
    --light-gray: #f8fafc;
    --medium-gray: #e2e8f0;
    --dark-gray: #64748b;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== GLOBAL RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    direction: rtl !important;
    text-align: right !important;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
    background: var(--pure-white) !important;
    color: var(--text-primary) !important;
    line-height: 1.6 !important;
    overflow-x: hidden !important;
    direction: rtl !important;
    text-align: right !important;
    margin: 0 !important;
}

/* (Other sections like HERO, BUTTONS, SECTIONS, PRODUCT CARDS, FOOTER remain here) */


/* ========================================= */
/* ===== ACCESSORIES DROPDOWN STYLES ===== */
/* ========================================= */

.nav-menu {
    list-style: none;
    display: flex;
    gap: 30px; /* Adjust spacing between nav links */
}

.nav-item {
    position: relative; /* Crucial for dropdown positioning */
}

.nav-link {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    padding: 10px 0;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--primary-blue);
}

/* تنسيق القائمة المنسدلة ثلاثية الأعمدة */
.accessories-dropdown {
    position: absolute;
    /* تحديد موقع القائمة بالنسبة لعنصر القائمة (الملحقات) */
    right: 50%; 
    transform: translateX(50%) translateY(-10px); /* توسيط القائمة أفقياً */
    
    top: 100%;
    width: 900px; /* عرض كبير للقائمة ثلاثية الأعمدة */
    max-height: 500px;
    overflow: hidden; /* لمنع ظهور scrollbar غير مرغوب فيه على الحاوية الرئيسية */
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    
    /* حالة الإخفاء الأولية */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    z-index: 9999;
    margin-top: 5px;
    display: flex;
    flex-direction: row;
    pointer-events: none; /* لمنع تفاعلات الماوس عندما تكون مخفية */
}

/* حالة الظهور التي يتحكم بها JavaScript */
.accessories-dropdown.show-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(50%) translateY(0);
    pointer-events: auto; /* السماح بتفاعلات الماوس عندما تكون ظاهرة */
}


/* تنسيق الأعمدة */
.dropdown-column {
    flex: 1;
    border-right: 1px solid #f1f5f9; /* استخدم right لـ RTL */
    min-height: 300px;
    max-height: 450px;
    overflow-y: auto;
    padding-bottom: 10px;
}

.dropdown-column:first-child {
    border-right: none;
}

.column-brands {
    background: linear-gradient(180deg, #f8fafc, #f1f5f9) !important;
}

.column-series {
    background: linear-gradient(180deg, #ffffff, #fafafa) !important;
}

.column-models {
    background: linear-gradient(180deg, #f8fafc, #f1f5f9) !important;
}

/* شريط التمرير للأعمدة */
.dropdown-column::-webkit-scrollbar {
    width: 4px;
}

.dropdown-column::-webkit-scrollbar-track {
    background: transparent;
}

.dropdown-column::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

.dropdown-column::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* رأس العمود */
.dropdown-header {
    padding: 14px 16px;
    font-size: 13px;
    font-weight: 700;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #f1f5f9;
    text-align: right;
    background: #f9fafb;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* عناصر القائمة العامة */
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    text-decoration: none;
    color: #374151;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    transition: background 0.3s ease, color 0.3s ease;
    cursor: pointer !important;
    border-bottom: 1px solid #f1f5f9;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item i {
    font-size: 14px;
    width: 16px;
    color: var(--dark-gray);
    transition: color 0.2s;
}

.dropdown-item:hover i {
    color: white;
}

/* تنسيق البراندات */
.brand-item {
    font-size: 16px;
    font-weight: 600;
}

.brand-item:hover {
    background: #dcfce7 !important; /* لون أخضر فاتح */
    color: #16a34a !important; /* لون أخضر داكن */
}

.brand-item.active {
    background: #16a34a !important;
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.brand-item.active i {
    color: white;
}

/* تنسيق الفئات (Series) */
.series-item {
    font-size: 15px;
    font-weight: 500;
}

.series-item:hover {
    background: #eff6ff !important; /* لون أزرق فاتح جداً */
    color: #1e40af !important; /* لون أزرق داكن */
}

.series-item.active {
    background: #2563eb !important;
    color: #ffffff !important;
}

.series-item.active i {
    color: white;
}

/* تنسيق الموديلات */
.model-item {
    font-size: 14px;
    font-weight: 500;
}

.model-item:hover {
    background: #f1f5f9 !important;
    color: #334155 !important;
}

/* مؤشر التحميل */
.loading-placeholder {
    padding: 20px 16px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ====== MOBILE MEDIA QUERY (Added/Corrected from topnavbar.php) ====== */

@media (max-width: 768px) {
    /* Adjust dropdown width for mobile */
    .accessories-dropdown {
        width: 95vw;
        left: auto; /* Override old centering attempt */
        right: 2.5vw; /* Position 2.5% from the right edge */
        transform: translateY(-10px);
    }
    
    .accessories-dropdown.show-dropdown {
        transform: translateY(0);
    }
    
    /* Hide the 3 columns on small screens, users should use mobile menu */
    .accessories-dropdown {
        display: none !important;
        visibility: hidden !important;
    }
}

/* ========================================= */
/* ===== NAVBAR COMPLETE STYLING ===== */
/* ========================================= */

/* Reset and Base */
html, body {
    margin: 0;
}

body {
    padding-top: 70px;
}

html {
    scroll-padding-top: 70px;
}

* {
    box-sizing: border-box;
}

/* Main Navbar */
.gp-navbar {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.12);
    position: fixed !important;
    top: 0;
    right: 0;
    left: 0;
    width: 100%;
    z-index: 1500;
    direction: rtl;
}

/* Desktop Navigation Container */
.gp-nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.8rem;
    height: 70px;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between;
    gap: 1.5rem;
}

.gp-nav-container > * {
    display: flex !important;
    align-items: center !important;
    height: 70px !important;
}

/* Actions Section - Right side */
.gp-actions {
    flex-shrink: 0 !important;
    min-width: 120px !important;
    justify-content: flex-start !important;
    order: 3 !important;
}

/* Menu Section - Center */
.gp-menu {
    flex: 1 !important;
    justify-content: center !important;
    min-width: 400px !important;
    order: 2 !important;
}

/* Logo Section - Left side */
.gp-logo {
    flex-shrink: 0 !important;
    min-width: 200px !important;
    justify-content: flex-end !important;
    order: 1 !important;
}

/* Logo Link and Image */
.gp-logo-link {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    height: 70px !important;
    text-decoration: none;
    color: #0f172a;
    font-weight: 700;
    font-size: 1.5rem;
}

.gp-logo-image {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    object-fit: cover;
}

/* Navigation Links */
.gp-nav-list {
    display: flex !important;
    align-items: center !important;
    height: 70px !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none;
}

.gp-nav-item {
    display: flex !important;
    align-items: center !important;
    height: 70px !important;
}

.gp-nav-link {
    background: transparent;
    border: none;
    font-size: 0.975rem;
    font-weight: 600;
    color: #334155;
    padding: 0.5rem 0.75rem;
    border-radius: 999px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    text-decoration: none;
    height: 70px !important;
}

.gp-nav-link:hover,
.gp-nav-link:focus-visible {
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
    outline: none;
}

/* Action Buttons */
.gp-action-btn {
    background: transparent;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #334155;
    transition: all 0.2s ease;
    position: relative;
    cursor: pointer;
    text-decoration: none;
}

.gp-action-btn:hover,
.gp-action-btn:focus-visible {
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
    outline: none;
}

/* Cart Badge */
.gp-cart-badge {
    position: absolute;
    top: -6px;
    left: -6px;
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 20px;
    min-height: 20px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

/* Search Modal */
.gp-search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
}

.gp-search-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    cursor: pointer;
}

.gp-search-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    padding: 2rem;
}

.gp-search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.gp-search-header h3 {
    color: #1e293b;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.gp-search-close {
    background: #f1f5f9;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s ease;
}

.gp-search-close:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.gp-search-input-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    transition: all 0.2s ease;
}

.gp-search-input-group:focus-within {
    border-color: #3b82f6;
    background: white;
}

.gp-search-input-group i {
    color: #64748b;
    font-size: 1.1rem;
}

.gp-search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1rem;
    color: #1e293b;
    outline: none;
}

.gp-search-input::placeholder {
    color: #94a3b8;
}

.gp-search-submit {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gp-search-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* Dropdown Panel */
.gp-dropdown {
    position: relative;
}

.gp-dropdown-panel {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: clamp(320px, 60vw, 800px);
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 32px 80px rgba(15, 23, 42, 0.18);
    display: flex;
    gap: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    overflow: hidden;
    z-index: 1700;
    margin-top: 8px;
    pointer-events: none;
}

.gp-dropdown.open > .gp-dropdown-panel,
.gp-dropdown:hover > .gp-dropdown-panel,
.gp-dropdown-panel:hover {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.gp-dropdown.open > .gp-dropdown-panel {
    pointer-events: auto;
}

.gp-dropdown-column {
    flex: 1;
    border-left: 1px solid #f1f5f9;
    max-height: 420px;
    display: flex;
    flex-direction: column;
}

.gp-dropdown-column:first-child {
    border-left: none;
}

.gp-brands-column {
    background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
}

.gp-dropdown-header {
    padding: 0.9rem 1.2rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: rgba(148, 163, 184, 0.12);
}

.gp-dropdown-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.35rem 0;
}

.gp-dropdown-body::-webkit-scrollbar {
    width: 6px;
}

.gp-dropdown-body::-webkit-scrollbar-track {
    background: transparent;
}

.gp-dropdown-body::-webkit-scrollbar-thumb {
    background: #cbd5f5;
    border-radius: 999px;
}

.gp-dropdown-item {
    width: 100%;
    border: none;
    background: transparent;
    text-align: right;
    padding: 0.85rem 1.2rem;
    font-size: 0.95rem;
    color: #1f2937;
    font-weight: 600;
    gap: 0.7rem;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.gp-dropdown-item i {
    color: #2563eb;
    font-size: 1rem;
}

.gp-dropdown-item:hover,
.gp-dropdown-item:focus-visible,
.gp-dropdown-item.is-active {
    background: linear-gradient(90deg, rgba(59,130,246,0.08) 0%, rgba(59,130,246,0.02) 100%);
    color: #1d4ed8;
    outline: none;
}

.gp-placeholder,
.gp-dropdown-empty,
.gp-dropdown-error,
.gp-loading {
    color: #94a3b8;
    font-weight: 500;
    text-align: center;
    padding: 1rem;
}

.gp-loading {
    color: #3b82f6;
}

.gp-dropdown-error {
    color: #ef4444;
}

/* Mobile Navbar */
.mobile-navbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    height: 64px;
    background: #ffffff;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
    z-index: 1600;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    justify-content: space-between;
}

.mobile-menu-toggle,
.mobile-cart-icon {
    background: transparent;
    border: none;
    color: #475569;
    font-size: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 999px;
}

.mobile-logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    object-fit: cover;
}

.mobile-cart-icon {
    position: relative;
}

.mobile-cart-badge {
    position: absolute;
    top: -6px;
    left: -6px;
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 20px;
    min-height: 20px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

.mobile-menu-dropdown {
    position: fixed;
    top: 64px;
    right: 0;
    left: 0;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
    z-index: 1550;
}

.mobile-menu-dropdown.show {
    max-height: 420px;
}

.mobile-menu-header {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.mobile-menu-item {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.9rem 1.25rem;
    color: #1e293b;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid #f1f5f9;
    background: transparent;
    cursor: pointer;
    width: 100%;
    border: none;
    text-align: right;
}

.mobile-menu-item:hover {
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
}

.mobile-accessories-panel {
    position: fixed;
    top: 64px;
    bottom: 70px;
    right: 0;
    left: 0;
    background: #ffffff;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    z-index: 1650;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 48px rgba(15, 23, 42, 0.14);
}

.mobile-accessories-panel.open {
    transform: translateX(0);
}

.mobile-accessories-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #f8fafc;
}

.mobile-accessories-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.mobile-content-spacer {
    height: 64px;
}

.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0.75rem;
    z-index: 1600;
}

.bottom-nav-item {
    border: none;
    background: transparent;
    text-decoration: none;
    color: #64748b;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

/* Desktop/Mobile Toggle */
.desktop-only {
    display: none;
}

@media (min-width: 769px) {
    body {
        padding-top: 96px;
    }
    .desktop-only {
        display: block;
    }
    .mobile-only {
        display: none !important;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 108px;
    }
    .desktop-only {
        display: none !important;
    }
    .mobile-only {
        display: flex !important;
    }
}

/* (Rest of main-theme.css content remains here) */