/* ============================================
   NAVBAR - Professional Navigation Component
   ============================================ */

/* --- Base Navbar --- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 3px solid transparent;
    border-image: linear-gradient(90deg, var(--primary), var(--secondary), var(--primary)) 1;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    transition: box-shadow 0.3s ease;
}

/* --- Container Layout --- */
.navbar .container {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 30px;
    padding: 14px 30px;
    max-width: 1400px;
    margin: 0 auto;
}

/* ============================================
   BRAND / LOGO
   ============================================ */
.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.nav-brand h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 900;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 12px rgba(255, 71, 87, 0.4));
    transition: filter 0.3s ease;
}

.nav-brand:hover h1 {
    filter: drop-shadow(0 0 20px rgba(255, 71, 87, 0.7));
}

/* ============================================
   CENTER NAV LINKS
   ============================================ */
.nav-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.nav-center a {
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    white-space: nowrap;
    text-decoration: none;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.nav-center a::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 71, 87, 0.15), rgba(255, 165, 2, 0.15));
    opacity: 0;
    transition: opacity 0.25s ease;
    border-radius: inherit;
}

.nav-center a:hover {
    border-color: var(--primary);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 71, 87, 0.25);
}

.nav-center a:hover::before {
    opacity: 1;
}

.nav-center a.active {
    background: linear-gradient(135deg, rgba(255, 71, 87, 0.2), rgba(255, 165, 2, 0.2));
    border-color: var(--primary);
    color: #fff;
}

/* ============================================
   RIGHT NAV ACTIONS
   ============================================ */
.nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-right a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    white-space: nowrap;
    text-decoration: none;
    transition: all 0.25s ease;
}

.nav-right a:hover {
    background: linear-gradient(135deg, rgba(255, 71, 87, 0.15), rgba(255, 165, 2, 0.15));
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 71, 87, 0.25);
}

/* --- Cart Icon with Badge --- */
.nav-right .cart-link {
    position: relative;
}

.cart-badge {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    font-size: 10px;
    font-weight: 900;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 999px;
    border: 2px solid #16213e;
    box-shadow: 0 2px 10px rgba(255, 71, 87, 0.5);
    pointer-events: none;
}

/* --- Variant Button States --- */
.btn-login {
    color: #22c55e !important;
    border-color: rgba(34, 197, 94, 0.25) !important;
}

.btn-login:hover {
    background: rgba(34, 197, 94, 0.12) !important;
    border-color: #22c55e !important;
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.2) !important;
}

.btn-register {
    color: #3b82f6 !important;
    border-color: rgba(59, 130, 246, 0.25) !important;
}

.btn-register:hover {
    background: rgba(59, 130, 246, 0.12) !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.2) !important;
}

.btn-logout {
    color: #ef4444 !important;
    border-color: rgba(239, 68, 68, 0.25) !important;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.12) !important;
    border-color: #ef4444 !important;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.2) !important;
}

/* --- Dashboard CTA Button --- */
.dashboard-link {
    background: linear-gradient(135deg, var(--primary), var(--secondary)) !important;
    border-color: transparent !important;
    color: #fff !important;
    box-shadow: 0 4px 20px rgba(255, 71, 87, 0.45) !important;
}

.dashboard-link:hover {
    transform: translateY(-2px) scale(1.04) !important;
    box-shadow: 0 8px 28px rgba(255, 71, 87, 0.7) !important;
    filter: brightness(1.1);
}

/* ============================================
   RESPONSIVE - Tablet & Mobile
   ============================================ */
@media (max-width: 1200px) {
    .navbar .container {
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        gap: 12px;
        padding: 14px 20px;
    }

    .nav-brand  { grid-column: 1; grid-row: 1; }
    .nav-right  { grid-column: 2; grid-row: 1; justify-content: flex-end; }
    .nav-center { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; }
}

@media (max-width: 768px) {
    .navbar .container {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 12px 16px;
    }

    .nav-brand  { justify-content: center; }
    .nav-right  { justify-content: center; flex-wrap: wrap; }
    .nav-center { justify-content: center; }

    .nav-brand h1 { font-size: 22px; }

    .nav-center a,
    .nav-right a  { font-size: 12px; padding: 8px 14px; }
}


/* ============================================
   DROPDOWN MENU
   ============================================ */
.nav-dropdown {
    position: relative;
}

.nav-dropdown > a {
    display: flex;
    align-items: center;
    gap: 4px;
}

.dropdown-arrow {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.nav-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 220px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid rgba(255, 71, 87, 0.3);
    border-radius: 12px;
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    z-index: 1000;
}

.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: var(--text);
    text-decoration: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.dropdown-menu a:hover {
    background: linear-gradient(135deg, rgba(255, 71, 87, 0.15), rgba(255, 165, 2, 0.15));
    border-color: var(--primary);
    color: #fff;
    transform: translateX(-3px);
}

.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 6px 0;
}

/* ============================================
   CART ICON FIX
   ============================================ */
.cart-link svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

/* ============================================
   SCROLL EFFECTS
   ============================================ */
.navbar.scrolled {
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.9);
    border-bottom-width: 2px;
}

/* ============================================
   LOADING ANIMATION
   ============================================ */
@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.loading-shimmer {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* ============================================
   SMOOTH TRANSITIONS
   ============================================ */
* {
    scroll-behavior: smooth;
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
