/**
 * Header & Navigation Styles
 * Modern Islamic Luxury Theme - Mahogany, Gold & Amber
 */

/* Modern Islamic Luxury Color Variables */
:root {
    --header-mahogany: #664131;
    --header-gold: #a88d5e;
    --header-amber: #e59756;
    --header-dark: #4a2f23;
    --header-light-gold: #c9a961;
}

/* ==========================================
   TOPBAR
   ========================================== */
.topbar {
    background: linear-gradient(135deg, var(--header-mahogany) 0%, var(--header-dark) 100%);
    color: white;
    padding: 10px 0;
    font-size: 0.9rem;
}

.topbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.topbar-left, .topbar-right {
    display: flex;
    gap: 25px;
    align-items: center;
    flex-wrap: wrap;
}

.topbar-contacts {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.topbar-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.topbar-link i {
    color: var(--header-amber);
    font-size: 1rem;
}

.topbar-link:hover {
    color: var(--header-amber);
}

.topbar-text {
    white-space: nowrap;
}

.topbar-divider {
    width: 1px;
    height: 15px;
    background: rgba(255, 255, 255, 0.3);
}

.topbar-whatsapp:hover i {
    animation: bounce 0.6s ease;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* ==========================================
   MAIN NAVIGATION
   ========================================== */
.navbar {
    background: white;
    box-shadow: 0 2px 20px rgba(102, 65, 49, 0.08);
    position: sticky;
    top: 0;
    z-index: 900;
    transition: all 0.3s ease;
    border-bottom: 2px solid rgba(168, 141, 94, 0.1);
}

.navbar .container {
    max-width: 100%;
    padding-left: 15px;
    padding-right: 15px;
}

@media (min-width: 1200px) {
    .navbar .container {
        max-width: 1400px; /* Wider container for more menu space */
    }
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    gap: 30px; /* Reduced gap between logo and menu */
    width: 100%;
}

/* Logo Styling - Bigger and on Left */
.navbar-brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.navbar-brand img {
    height: 65px; /* Optimized logo size */
    width: auto;
    transition: all 0.3s ease;
}

.navbar-brand:hover img {
    transform: scale(1.05);
}

/* Navigation Menu - Right Side */
.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2px; /* Reduced gap between menu items */
    align-items: center;
    margin-left: auto; /* Push menu to the right */
    flex-wrap: nowrap; /* Prevent wrapping */
}

/* Tablet/Desktop optimization - prevent menu wrapping */
@media (min-width: 993px) and (max-width: 1199px) {
    .nav-link {
        padding: 10px 12px;
        font-size: 0.88rem;
    }
    
    .navbar-content {
        gap: 20px;
    }
}

@media (min-width: 1200px) {
    .nav-link {
        padding: 10px 16px;
        font-size: 0.94rem;
    }
}

/* Hide menu by default on mobile - will be shown when .active is added */
@media (max-width: 992px) {
    .nav-menu {
        display: none !important;
    }
    
    .nav-menu.active {
        display: flex !important;
    }
}

/* Nav Items - Professional Styling */
.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 14px;
    color: var(--header-mahogany);
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    letter-spacing: 0.2px;
    white-space: nowrap; /* Prevent text wrapping */
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 14px;
    right: 14px;
    height: 2px;
    background: linear-gradient(90deg, var(--header-gold), var(--header-amber));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.nav-link:hover {
    color: var(--header-gold);
    background: rgba(168, 141, 94, 0.08);
}

.nav-link:hover::after {
    transform: scaleX(1);
}

.nav-item.active > .nav-link {
    color: var(--header-gold);
    background: linear-gradient(135deg, rgba(168, 141, 94, 0.12), rgba(229, 151, 86, 0.08));
    font-weight: 700;
}

/* Dropdown Icon */
.dropdown-icon {
    font-size: 0.65rem;
    margin-left: 2px;
    transition: transform 0.3s ease;
    color: var(--header-amber);
}

.nav-item.dropdown:hover .dropdown-icon {
    transform: rotate(180deg);
}

/* ==========================================
   MODERN DROPDOWN MENUS
   ========================================== */
.dropdown {
    position: relative;
}

.dropdown-menu {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 260px;
    background: white;
    border-radius: 14px;
    box-shadow: 0 15px 50px rgba(102, 65, 49, 0.18);
    padding: 12px 0;
    margin-top: 8px;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-15px);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    border: 2px solid rgba(168, 141, 94, 0.15);
}

.dropdown:hover > .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu .nav-item {
    display: block;
    width: 100%;
}

.dropdown-menu .nav-link {
    padding: 14px 24px;
    color: var(--header-mahogany);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 500;
    font-size: 0.92rem;
}

.dropdown-menu .nav-link::after {
    display: none;
}

.dropdown-menu .nav-link:hover {
    background: linear-gradient(90deg, rgba(168, 141, 94, 0.12), rgba(229, 151, 86, 0.08));
    color: var(--header-gold);
    padding-left: 28px;
}

.dropdown-menu .nav-link i {
    font-size: 0.85rem;
    opacity: 0.7;
    color: var(--header-amber);
}

/* Nested Dropdowns (Sub-menus) */
.dropdown-menu .dropdown {
    position: relative;
}

.dropdown-menu .dropdown > .nav-link::before {
    content: '\f054';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.65rem;
    margin-left: auto;
    color: var(--header-gold);
}

.dropdown-menu .dropdown-menu {
    left: 100%;
    top: 0;
    margin-top: 0;
    margin-left: 8px;
}

.dropdown-menu .dropdown:hover > .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* Depth Styling - Professional Modern Look */
.dropdown-menu.depth-1 {
    background: linear-gradient(135deg, #fdfcfb 0%, #f9f8f6 100%);
}

.dropdown-menu.depth-2 {
    background: linear-gradient(135deg, #faf9f8 0%, #f5f3f0 100%);
}

/* ==========================================
   MOBILE NAVIGATION - RESPONSIVE
   ========================================== */
.mobile-menu-toggle {
    display: none;
    background: linear-gradient(135deg, var(--header-gold), var(--header-amber));
    border: none;
    font-size: 1.4rem;
    color: white;
    cursor: pointer;
    padding: 12px 18px;
    border-radius: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(168, 141, 94, 0.25);
    position: relative;
    overflow: hidden;
}

.mobile-menu-toggle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.mobile-menu-toggle:active::before {
    width: 200px;
    height: 200px;
}

.mobile-menu-toggle:hover {
    background: linear-gradient(135deg, var(--header-mahogany), var(--header-dark));
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(102, 65, 49, 0.3);
}

.mobile-menu-toggle:active {
    transform: translateY(0);
}

.mobile-menu-toggle i {
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1;
}

.mobile-menu-toggle.active i {
    transform: rotate(90deg);
}

@media (max-width: 992px) {
    .mobile-menu-toggle {
        display: block;
        z-index: 950;
    }
    
    .navbar-content {
        gap: 20px;
        padding: 10px 0;
    }
    
    .navbar-brand img {
        height: 55px; /* Slightly smaller on mobile but still prominent */
    }
    
    .nav-menu {
        position: fixed;
        top: 85px;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, #ffffff 0%, #fdfcfb 100%);
        flex-direction: column;
        align-items: stretch;
        box-shadow: 0 10px 40px rgba(102, 65, 49, 0.2);
        padding: 20px 0;
        gap: 0;
        overflow-y: auto;
        max-height: calc(100vh - 85px);
        z-index: 900;
        border-top: 3px solid var(--header-gold);
    }
    
    .nav-menu.active {
        animation: slideDown 0.35s ease-out;
    }
    
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .nav-item {
        width: 100%;
        border-bottom: 1px solid rgba(168, 141, 94, 0.1);
    }
    
    .nav-link {
        width: 100%;
        border-radius: 0;
        padding: 18px 30px;
        font-size: 1rem;
    }
    
    .nav-link::after {
        display: none;
    }
    
    .nav-link:hover {
        background: linear-gradient(90deg, rgba(168, 141, 94, 0.15), transparent);
        padding-left: 38px;
    }
    
    /* Mobile Dropdowns - Override desktop hover behavior */
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        border-radius: 0;
        background: linear-gradient(135deg, rgba(168, 141, 94, 0.05), rgba(229, 151, 86, 0.03));
        margin-top: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-out;
    }
    
    .dropdown.active > .dropdown-menu {
        max-height: 600px;
    }
    
    /* Override desktop hover on mobile */
    .dropdown:hover > .dropdown-menu {
        max-height: 0;
    }
    
    .dropdown.active:hover > .dropdown-menu {
        max-height: 600px;
    }
    
    .dropdown-menu .nav-link {
        padding-left: 50px;
        font-size: 0.94rem;
        color: var(--header-mahogany);
    }
    
    .dropdown-menu .dropdown-menu .nav-link {
        padding-left: 70px;
        font-size: 0.88rem;
    }
    
    .dropdown > .nav-link {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .dropdown-icon {
        transform: none;
        transition: transform 0.3s ease;
        font-size: 0.75rem;
    }
    
    .dropdown.active > .nav-link .dropdown-icon {
        transform: rotate(180deg);
        color: var(--header-amber);
    }
    
    /* Active state styling on mobile */
    .nav-item.active > .nav-link {
        background: linear-gradient(90deg, rgba(168, 141, 94, 0.2), transparent);
        border-left: 4px solid var(--header-gold);
        font-weight: 700;
    }
}

/* ==========================================
   SEARCH BAR (Optional)
   ========================================== */
.nav-search {
    display: flex;
    align-items: center;
    margin-left: 20px;
}

.nav-search input {
    padding: 8px 15px;
    border: 2px solid #e8e8e8;
    border-radius: 20px;
    outline: none;
    transition: var(--transition-fast);
    width: 200px;
}

.nav-search input:focus {
    border-color: var(--primary-gold);
    width: 250px;
}

.nav-search button {
    background: var(--primary-gold);
    border: none;
    padding: 8px 15px;
    margin-left: -35px;
    border-radius: 20px;
    color: white;
    cursor: pointer;
}

/* ==========================================
   RESPONSIVE TOPBAR
   ========================================== */
@media (max-width: 768px) {
    .topbar {
        display: block !important;
        padding: 10px 0;
        font-size: 0.85rem;
        background: linear-gradient(135deg, var(--header-mahogany) 0%, var(--header-dark) 100%);
    }
    
    .topbar-content {
        justify-content: center;
        gap: 12px;
        flex-wrap: wrap;
    }
    
    .topbar-left, .topbar-right {
        gap: 12px;
        flex: 0 0 auto;
    }
    
    .topbar-contacts {
        gap: 12px;
        flex-wrap: nowrap;
    }
    
    .topbar-text {
        display: none;
    }
    
    .topbar-link {
        font-size: 1.15rem;
        padding: 5px 8px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 36px;
        min-height: 36px;
        border-radius: 6px;
        transition: all 0.3s ease;
    }
    
    .topbar-link:hover {
        background: rgba(255, 255, 255, 0.15);
        transform: translateY(-2px);
    }
    
    .topbar-link i {
        font-size: 1.15rem;
        margin: 0;
    }
    
    .topbar-divider {
        height: 16px;
        margin: 0 4px;
    }
    
    .navbar {
        padding: 8px 0;
    }
    
    .navbar-content {
        padding: 8px 0;
    }
    
    .navbar-brand img {
        height: 45px;
    }
}

@media (max-width: 576px) {
    .topbar {
        display: block !important;
        font-size: 0.8rem;
        padding: 8px 0;
        background: linear-gradient(135deg, var(--header-mahogany) 0%, var(--header-dark) 100%);
    }
    
    .topbar-content {
        gap: 10px;
        justify-content: center;
    }
    
    .topbar-left,
    .topbar-right {
        flex: 0 0 auto;
        justify-content: center;
    }
    
    .topbar-contacts {
        gap: 10px;
        flex-wrap: nowrap;
    }
    
    .topbar-link {
        padding: 4px 7px;
        font-size: 1.1rem;
        min-width: 34px;
        min-height: 34px;
        border-radius: 5px;
    }
    
    .topbar-link i {
        font-size: 1.1rem;
    }
    
    .topbar-divider {
        height: 14px;
        margin: 0 3px;
    }
    
    .navbar-brand img {
        height: 38px;
    }
    
    .mobile-menu-toggle {
        font-size: 1.2rem;
        padding: 9px 13px;
    }
}

@media (max-width: 400px) {
    .topbar {
        display: block !important;
        padding: 8px 0;
        background: linear-gradient(135deg, var(--header-mahogany) 0%, var(--header-dark) 100%);
    }
    
    .topbar-content {
        flex-direction: row;
        gap: 8px;
        justify-content: center;
    }
    
    .topbar-left,
    .topbar-right {
        width: auto;
        justify-content: center;
        flex: 0 0 auto;
    }
    
    .topbar-contacts {
        gap: 8px;
        flex-wrap: nowrap;
    }
    
    .topbar-link {
        min-width: 32px;
        min-height: 32px;
        padding: 3px 6px;
        font-size: 1rem;
    }
    
    .topbar-link i {
        font-size: 1rem;
    }
    
    .topbar-divider {
        height: 12px;
        margin: 0 2px;
    }
    
    .navbar-brand img {
        height: 35px;
    }
}

/* Prevent horizontal scroll */
@media (max-width: 992px) {
    body {
        overflow-x: hidden !important;
    }
    
    body.menu-open {
        overflow: hidden !important;
        height: 100vh !important;
    }
}
