/**
 * Header Navigation Bar - Enhanced UI/UX
 * Fixes alignment, spacing, and responsiveness
 */

/* ========== NAVBAR BASE STYLES ========== */
.navbar {
    background: rgba(0, 0, 0, 0.95) !important;
    /* backdrop-filter removed for Safari */
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 1030;
    transition: transform 0.3s ease, opacity 0.3s ease;
    will-change: transform;
}

.navbar.scrolled {
    background: rgba(0, 0, 0, 0.98) !important;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    padding: 0.5rem 0;
}

/* ========== NAVBAR CONTAINER ========== */
.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

/* ========== NAVBAR BRAND ========== */
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-gold, #d4af37) !important;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0.5rem 0;
}

.navbar-brand:hover {
    color: var(--gold-light, #f0d98d) !important;
    transform: translateY(-2px);
}

.navbar-brand img {
    height: 50px;
    width: auto;
    transition: all 0.3s ease;
    object-fit: contain;
}

.navbar-brand:hover img {
    transform: scale(1.1);
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.5));
}

/* ========== NAVBAR TOGGLER (Hamburger) ========== */
.navbar-toggler {
    border: 2px solid var(--primary-gold, #d4af37);
    background: transparent;
    padding: 0.5rem 0.75rem;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.navbar-toggler:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--gold-light, #f0d98d);
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(212, 175, 55, 0.25);
    outline: none;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(212, 175, 55, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    width: 1.5rem;
    height: 1.5rem;
}

/* ========== NAVBAR COLLAPSE ========== */
.navbar-collapse {
    flex-grow: 1;
    align-items: center;
}

/* ========== NAVBAR NAV (Menu Items) ========== */
.navbar-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.navbar-nav.ms-auto {
    margin-left: auto !important;
}

/* ========== NAV ITEMS ========== */
.nav-item {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    font-size: 1rem;
    padding: 0.5rem 1rem !important;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--primary-gold, #d4af37) !important;
    background: rgba(212, 175, 55, 0.1);
    transform: translateY(-2px);
}

.nav-link:active,
.nav-link.active {
    color: var(--primary-gold, #d4af37) !important;
    background: rgba(212, 175, 55, 0.15);
}

/* ========== DROPDOWN MENU ========== */
.nav-item.dropdown {
    position: relative;
}

.dropdown-toggle::after {
    margin-left: 0.5rem;
    vertical-align: middle;
}

.dropdown-menu {
    background: #1a1a1a !important;
    border: 1px solid var(--primary-gold, #d4af37) !important;
    border-radius: 8px;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.8);
    min-width: 200px;
}

.dropdown-item {
    color: #ffffff !important;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: transparent;
}

.dropdown-item:hover {
    background: rgba(212, 175, 55, 0.15) !important;
    color: var(--primary-gold, #d4af37) !important;
}

.dropdown-divider {
    border-color: rgba(212, 175, 55, 0.3);
    margin: 0.5rem 0;
}

/* ========== CART BADGE ========== */
.cart-badge {
    position: absolute;
    top: -5px;
    right: -10px;
    background: var(--primary-gold, #d4af37);
    color: var(--primary-black, #000);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* ========== LANGUAGE SWITCHER ========== */
.language-switcher {
    background: transparent !important;
    border: 1px solid var(--primary-gold, #d4af37) !important;
    color: var(--white, #fff) !important;
    padding: 0.5rem 1rem !important;
    font-size: 0.9rem !important;
    border-radius: 5px !important;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
}

.language-switcher:hover {
    background: rgba(212, 175, 55, 0.1) !important;
    border-color: var(--gold-light, #f0d98d) !important;
}

.language-switcher:focus {
    box-shadow: 0 0 0 0.2rem rgba(212, 175, 55, 0.25);
    outline: none;
}

.language-switcher option {
    background: #1a1a1a;
    color: #fff;
}

/* ========== RTL SUPPORT ========== */
[dir="rtl"] .navbar-brand {
    flex-direction: row-reverse;
}

[dir="rtl"] .navbar-brand img {
    margin-left: 10px;
    margin-right: 0;
}

[dir="rtl"] .navbar-nav {
    margin-left: 0 !important;
    margin-right: auto !important;
}

[dir="rtl"] .nav-link {
    text-align: right;
}

[dir="rtl"] .dropdown-toggle::after {
    margin-left: 0;
    margin-right: 0.5rem;
}

[dir="rtl"] .cart-badge {
    right: auto;
    left: -10px;
}

/* ========== RESPONSIVE DESIGN ========== */

/* Tablet and below */
@media (max-width: 991px) {
    .navbar {
        padding: 0.75rem 0;
    }

    .navbar-brand {
        font-size: 1.3rem;
    }

    .navbar-brand img {
        height: 45px;
    }

    .navbar-collapse {
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(212, 175, 55, 0.2);
    }

    .navbar-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        width: 100%;
    }

    .nav-item {
        width: 100%;
    }

    .nav-link {
        padding: 0.75rem 1rem !important;
        border-radius: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-link:hover {
        transform: translateX(5px);
        background: rgba(212, 175, 55, 0.1);
    }

    [dir="rtl"] .nav-link:hover {
        transform: translateX(-5px);
    }

    .dropdown-menu {
        position: static !important;
        transform: none !important;
        border: none;
        border-left: 3px solid var(--primary-gold, #d4af37);
        border-radius: 0;
        margin: 0;
        padding-left: 1rem;
        background: rgba(0, 0, 0, 0.5);
    }

    [dir="rtl"] .dropdown-menu {
        border-left: none;
        border-right: 3px solid var(--primary-gold, #d4af37);
        padding-left: 0;
        padding-right: 1rem;
    }

    .language-switcher {
        width: 100%;
        margin-top: 0.5rem;
    }
}

/* Mobile */
@media (max-width: 576px) {
    .navbar {
        padding: 0.5rem 0;
    }

    .navbar-brand {
        font-size: 1.1rem;
    }

    .navbar-brand img {
        height: 40px;
    }

    .nav-link {
        font-size: 0.95rem;
        padding: 0.65rem 0.75rem !important;
    }
}

/* ========== SMOOTH TRANSITIONS ========== */
.navbar,
.navbar-brand,
.navbar-brand img,
.nav-link,
.dropdown-menu,
.dropdown-item,
.language-switcher {
    transition: all 0.3s ease;
}

/* ========== ACCESSIBILITY ========== */
.nav-link:focus,
.navbar-toggler:focus,
.language-switcher:focus {
    outline: 2px solid var(--primary-gold, #d4af37);
    outline-offset: 2px;
}

/* ========== PREVENT OVERLAPPING ========== */
body {
    padding-top: 80px;
    /* Space for fixed navbar */
}

@media (max-width: 991px) {
    body {
        padding-top: 70px;
    }
}

@media (max-width: 576px) {
    body {
        padding-top: 60px;
    }
}

/* ========== LOADING STATE ========== */
.navbar.loading {
    opacity: 0.7;
    pointer-events: none;
}