/* Header Styles - Shared across all pages */

/* Professional Color Variables */
:root {
    --primary-navy: #1e3a8a;
    --primary-slate: #334155;
    --accent-blue: #3b82f6;
    --accent-orange: #f59e0b;
    --text-white: #ffffff;
    --text-light: #f8fafc;
    --text-muted: #64748b;
    --nav-gradient: linear-gradient(135deg, #1e3a8a 0%, #334155 100%);
    --logo-gradient: linear-gradient(135deg, #3b82f6 0%, #1e3a8a 100%);
    --shadow-soft: 0 4px 20px rgba(30, 58, 138, 0.15);
    --shadow-strong: 0 8px 30px rgba(30, 58, 138, 0.25);
}

/* Language Switcher */
.language-switcher {
    position: fixed;
    top: 5px;
    right: 20px;
    z-index: 9999;
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.98);
    padding: 8px;
    border-radius: 25px;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(15px);
    transition: all 0.3s ease;
    border: 2px solid var(--accent-blue);
    visibility: visible;
    opacity: 1;
}

.language-switcher:hover {
    box-shadow: var(--shadow-strong);
    transform: translateY(-2px);
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: none;
    background: transparent;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    min-width: 50px;
    justify-content: center;
}

.lang-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
    transform: scale(1.05);
}

.lang-btn.active {
    background: var(--accent-blue);
    color: var(--text-white);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.flag-icon {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    object-fit: cover;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* RTL adjustments for language switcher */
body.rtl .language-switcher {
    right: 20px;
    left: auto;
}

/* RTL mobile adjustments - keep next to hamburger menu */
@media (max-width: 768px) {
    body.rtl .language-switcher {
        right: 15px;
        left: auto;
        transform: translateX(-80px);
    }
}

@media (max-width: 480px) {
    body.rtl .language-switcher {
        right: 10px;
        left: auto;
        transform: translateX(-70px);
    }
}

/* Navigation */
.navbar {
    background: var(--nav-gradient);
    box-shadow: var(--shadow-soft);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar.scrolled {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.95) 0%, rgba(51, 65, 85, 0.95) 100%);
    box-shadow: var(--shadow-strong);
    backdrop-filter: blur(10px);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: auto auto auto;
    align-items: flex-start;
    justify-content: center;
    height: 60px;
    gap: 2rem;
    position: relative;
    z-index: 50;
    padding-top: 9px;
}

.nav-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
    grid-column: 2;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.8rem 2rem 2rem 2rem;
    position: relative;
    text-decoration: none;
    color: inherit;
    background: var(--logo-gradient);
    border-radius: 0 0 80px 80px;
    box-shadow: var(--shadow-soft);
    transform: translateY(-10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.nav-logo:hover {
    transform: translateY(-20px) scale(1.05);
    box-shadow: var(--shadow-strong);
    border-color: rgba(255, 255, 255, 0.3);
}

.nav-logo.scrolled {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.95) 0%, rgba(30, 58, 138, 0.95) 100%);
    box-shadow: var(--shadow-strong);
    backdrop-filter: blur(10px);
}

.nav-logo img {
    height: 60px;
    width: auto;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
    z-index: 2;
    position: relative;
}


.nav-left {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 1rem;
    grid-column: 1;
}

.nav-right {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 1rem;
    grid-column: 3;
}

.nav-link {
    text-decoration: none;
    color: var(--text-white);
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.95rem;
    position: relative;
    border: 1px solid transparent;
}

.nav-link:hover {
    color: var(--text-light);
    transform: translateY(-1px) scale(1.05);
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-link.active {
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

/* Mobile Menu */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.hamburger:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.bar {
    width: 25px;
    height: 3px;
    background-color: #ffffff;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

.hamburger.active .bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active .bar:nth-child(2) {
    opacity: 0;
}

.hamburger.active .bar:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Main Content Spacing */
.main-content {
    margin-top: 120px;
    padding: 3rem 0;
}

/* Mobile menu - hidden by default on desktop */
.nav-mobile {
    display: none;
}

/* Debug mode - uncomment to test mobile menu visibility */
/*
.nav-mobile {
    display: flex !important;
    position: fixed !important;
    top: 80px !important;
    left: 0 !important;
    width: 100% !important;
    background: red !important;
    z-index: 9999 !important;
}
*/

/* Responsive Design */
@media (max-width: 768px) {
    .language-switcher {
        top: 15px;
        right: 15px;
        left: auto;
        padding: 4px;
        gap: 4px;
        z-index: 9999;
        position: fixed;
        display: flex;
        transform: translateX(-80px);
    }
    
    .lang-btn {
        padding: 4px 8px;
        font-size: 0.75rem;
        min-width: 40px;
    }
    
    .flag-icon {
        width: 16px;
        height: 12px;
    }
    
    .nav-container {
        grid-template-columns: 1fr auto;
        gap: 1rem;
    }
    
    .nav-logo {
        grid-column: 1;
        justify-self: start;
    }
    
    .nav-left,
    .nav-right {
        display: none;
    }
    
    .nav-mobile {
        display: flex;
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: auto;
        min-height: 300px;
        background: var(--nav-gradient);
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        padding: 2rem 0;
        transition: left 0.3s ease;
        grid-column: unset;
        list-style: none;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: var(--shadow-soft);
        z-index: 999;
        overflow-y: auto;
    }
    
    .nav-mobile.active {
        left: 0 !important;
        display: flex !important;
        z-index: 1000;
        visibility: visible !important;
        opacity: 1 !important;
        transform: translateX(0) !important;
    }
    
    .hamburger {
        display: flex;
        grid-column: 2;
        cursor: pointer;
        z-index: 1001;
        position: relative;
        background-color: rgba(255, 255, 255, 0.1);
        border-radius: 6px;
        padding: 8px;
        transition: background-color 0.3s ease;
    }
    
    .hamburger:hover {
        background-color: rgba(255, 255, 255, 0.2);
    }
    
    .hamburger:active {
        background-color: rgba(255, 255, 255, 0.3);
    }
    
    .nav-logo {
        padding: 0.8rem 1.5rem 1.5rem 1.5rem;
        border-radius: 15px 15px 40px 40px;
    }
    
    .nav-logo img {
        height: 45px;
    }
    
    /* Mobile menu items styling */
    .nav-mobile li {
        width: 100%;
        text-align: center;
    }
    
    .nav-mobile a {
        display: block;
        padding: 1rem 2rem;
        color: white;
        text-decoration: none;
        font-size: 1.1rem;
        font-weight: 500;
        transition: background-color 0.3s ease;
        border-radius: 8px;
        margin: 0.5rem 1rem;
    }
    
    .nav-mobile a:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }
}

@media (max-width: 480px) {
    .language-switcher {
        top: 5px;
        right: 10px;
        left: auto;
        padding: 3px;
        gap: 3px;
        z-index: 9999;
        position: fixed;
        display: flex;
        transform: translateX(-70px);
    }
    
    .lang-btn {
        padding: 3px 6px;
        font-size: 0.7rem;
        min-width: 35px;
    }
    
    .flag-icon {
        width: 14px;
        height: 10px;
    }
    
    .nav-logo {
        padding: 0.6rem 1.2rem 1.2rem 1.2rem;
        border-radius: 12px 12px 35px 35px;
    }
    
    .nav-logo img {
        height: 40px;
    }
}

/* Dropdown Menu Styles */
/* Desktop Dropdown Styles */
.nav-dropdown {
    position: relative;
}

.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Hide the small dropdown for mega-only products menu */
.nav-dropdown.mega-only .dropdown-menu {
    display: none !important;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    padding: 8px 0;
}

.dropdown-menu li {
    list-style: none;
    margin: 0;
}

.dropdown-menu a {
    display: block;
    padding: 12px 20px;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f3f4f6;
}

.dropdown-menu a:hover {
    background: #f8fafc;
    color: #2563eb;
    padding-left: 25px;
}

.dropdown-menu li:last-child a {
    border-bottom: none;
}

/* Mobile Dropdown Styles */
.nav-dropdown-mobile {
    position: relative;
}

.nav-dropdown-mobile .dropdown-menu-mobile {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #f8fafc;
    border-radius: 8px;
    margin: 8px 0;
}

.nav-dropdown-mobile.active .dropdown-menu-mobile {
    max-height: 300px;
}

.dropdown-menu-mobile li {
    list-style: none;
    margin: 0;
}

.dropdown-menu-mobile a {
    display: block;
    padding: 10px 20px;
    color: #374151;
    text-decoration: none;
    border-bottom: 1px solid #e5e7eb;
}

.dropdown-menu-mobile a:hover {
    background: #e5e7eb;
    color: #2563eb;
}

.dropdown-menu-mobile li:last-child a {
    border-bottom: none;
}

/* RTL Support for Dropdown */
[dir="rtl"] .dropdown-menu {
    left: auto;
    right: 0;
}

[dir="rtl"] .dropdown-menu a:hover {
    padding-left: 20px;
    padding-right: 25px;
}

/* Arrow indicator for dropdown */
.nav-dropdown > a::after {
    content: '▼';
    font-size: 10px;
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.nav-dropdown:hover > a::after {
    transform: rotate(180deg);
}

[dir="rtl"] .nav-dropdown > a::after {
    margin-left: 0;
    margin-right: 5px;
}

/* ========================= */
/* Products Mega Menu (Desktop) */
/* ========================= */
.mega-menu {
    position: absolute;
    top: 80px; /* below navbar */
    left: 0;
    right: 0;
    display: none;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.12);
    padding: 20px;
    z-index: 1100;
}

.navbar.mega-open .mega-menu {
    display: block;
}

.mega-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
}

.mega-col.categories {
    border-right: 1px solid #f1f5f9;
    padding-right: 16px;
}

[dir="rtl"] .mega-col.categories {
    border-right: none;
    border-left: 1px solid #f1f5f9;
    padding-right: 0;
    padding-left: 16px;
}

.mega-col.categories h4,
.mega-col.details h4 {
    margin: 0 0 10px 0;
    font-size: 0.95rem;
    color: #334155;
}

.mega-categories-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.mega-category-btn {
    width: 100%;
    text-align: left;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #111827;
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.05s ease;
}

.mega-category-btn:hover,
.mega-category-btn.active {
    background: #eef2ff;
    border-color: #c7d2fe;
}

[dir="rtl"] .mega-category-btn {
    text-align: right;
}

.mega-all-link {
    display: inline-block;
    margin-top: 10px;
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.mega-details-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.mega-products {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px;
}

.mega-products::-webkit-scrollbar {
    width: 6px;
}

.mega-products::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.mega-products::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.mega-products::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

[dir="rtl"] .mega-products {
    padding-right: 0;
    padding-left: 8px;
}

.mega-product-card {
    display: flex;
    gap: 10px;
    align-items: center;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px;
    text-decoration: none;
    color: #111827;
    background: #ffffff;
}

.mega-product-card img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #f1f5f9;
}

.mega-product-name {
    font-size: 0.9rem;
    line-height: 1.2;
}

/* Hide mega menu on mobile */
@media (max-width: 768px) {
    .mega-menu {
        display: none !important;
    }
}
