/* =========================================================
   NEPCART NAVBAR
========================================================= */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --border-color: #e5e7eb;
    --container-width: 1200px;
    --container-padding: 20px;
}

/* ---------------------------------------------------------
   HEADER
--------------------------------------------------------- */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 72px;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* ---------------------------------------------------------
   NAVBAR
--------------------------------------------------------- */

.navbar {
    width: 100%;
    height: 100%;
}

/* ---------------------------------------------------------
   CONTAINER
--------------------------------------------------------- */

.nav-container {
    width: 100%;
    max-width: var(--container-width);
    height: 100%;
    margin: 0 auto;
    padding: 0 var(--container-padding);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ---------------------------------------------------------
   LOGO
--------------------------------------------------------- */

.logo {
    display: inline-flex;
    align-items: center;
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    white-space: nowrap;
    text-decoration: none;
    transition:
        color 0.2s ease,
        transform 0.2s ease;
}

.logo:hover {
    color: var(--primary-hover);
    transform: translateY(-1px);
}

/* ---------------------------------------------------------
   NAVIGATION LINKS
--------------------------------------------------------- */

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.35rem;
}

.nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 72px;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--primary-color);
}

/* ---------------------------------------------------------
   LINK UNDERLINE
--------------------------------------------------------- */

.nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: var(--primary-color);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.2s ease;
}

.nav-link:hover::after {
    transform: scaleX(1);
}

/* ---------------------------------------------------------
   CATEGORIES DROPDOWN
--------------------------------------------------------- */

.categories-dropdown {
    position: relative;
    height: 72px;
    display: flex;
    align-items: center;
}

/* ---------------------------------------------------------
   CATEGORIES TRIGGER
--------------------------------------------------------- */

.categories-trigger {
    height: 72px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    list-style: none;
    transition: color 0.2s ease;
}

/* Remove native details arrow */

.categories-trigger::-webkit-details-marker {
    display: none;
}

.categories-trigger::marker {
    display: none;
}

.categories-trigger:hover {
    color: var(--primary-color);
}

/* ---------------------------------------------------------
   CATEGORY ARROW
--------------------------------------------------------- */

.categories-arrow {
    font-size: 0.65rem;
    transition: transform 0.2s ease;
}

.categories-dropdown[open] .categories-arrow {
    transform: rotate(180deg);
}

/* ---------------------------------------------------------
   CATEGORY MENU
--------------------------------------------------------- */

.categories-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    min-width: 210px;
    max-width: 280px;
    padding: 8px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
    transform: translateX(-50%) translateY(-8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 0.2s ease,
        transform 0.2s ease,
        visibility 0.2s ease;
    z-index: 1100;
}

/* ---------------------------------------------------------
   OPEN CATEGORY MENU
--------------------------------------------------------- */

.categories-dropdown[open] .categories-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

/* ---------------------------------------------------------
   CATEGORY LINKS
--------------------------------------------------------- */

.category-link {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px 12px;
    border-radius: 7px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition:
        background 0.18s ease,
        color 0.18s ease,
        transform 0.18s ease;
}

.category-link:hover {
    background: #eff6ff;
    color: var(--primary-color);
    transform: translateX(2px);
}

/* ---------------------------------------------------------
   NO CATEGORIES
--------------------------------------------------------- */

.no-categories {
    display: block;
    padding: 12px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-align: center;
}

/* ---------------------------------------------------------
   CART
--------------------------------------------------------- */

.cart-link {
    gap: 6px;
}

.cart-icon {
    font-size: 0.95rem;
    line-height: 1;
}

/* ---------------------------------------------------------
   CART COUNT
--------------------------------------------------------- */

.cart-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    margin-left: 1px;
    border-radius: 999px;
    background: var(--primary-color);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    transform: translateY(-7px);
}

/* ---------------------------------------------------------
   PROFILE NAVIGATION
--------------------------------------------------------- */

.profile-nav-link {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    height: 72px;
    color: var(--text-primary) !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    text-decoration: none;
    white-space: nowrap;
}

.profile-nav-link:hover {
    color: var(--primary-color) !important;
}

.profile-nav-link::after {
    display: none !important;
}

/* ---------------------------------------------------------
   PROFILE AVATAR
--------------------------------------------------------- */

.profile-nav-avatar {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 50%;
    background: #eff6ff;
    color: #2563eb;
    font-size: 0.75rem;
    font-weight: 800;
    flex-shrink: 0;
}

.profile-nav-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-nav-name {
    display: inline-block;
}

/* ---------------------------------------------------------
   LOGIN
--------------------------------------------------------- */

.nav-login {
    color: var(--text-secondary);
}

/* ---------------------------------------------------------
   REGISTER
--------------------------------------------------------- */

.nav-register {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding: 0 17px;
    border-radius: 7px;
    background: var(--primary-color);
    color: #ffffff !important;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition:
        background 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.nav-register:hover {
    background: var(--primary-hover);
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}

/* ---------------------------------------------------------
   MOBILE MENU TOGGLE
--------------------------------------------------------- */

.nav-toggle {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.nav-toggle-label {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.nav-toggle-label:hover {
    background: #eff6ff;
}

.nav-toggle-label span {
    display: block;
    width: 21px;
    height: 2px;
    border-radius: 2px;
    background: var(--text-primary);
    transition:
        transform 0.2s ease,
        opacity 0.2s ease;
}

/* ---------------------------------------------------------
   MOBILE
--------------------------------------------------------- */

@media (max-width: 768px) {
    .site-header {
        height: 64px;
    }

    .nav-container {
        min-height: 64px;
        height: auto;
        padding: 0 20px;
        position: relative;
    }

    .logo {
        font-size: 1.4rem;
    }

    /* Mobile menu button */
    .nav-toggle-label {
        display: flex;
    }

    /* Mobile navigation */
    .nav-links {
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        width: 100%;
        padding: 14px 20px 18px;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: #ffffff;
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        pointer-events: none;
        transition:
            opacity 0.2s ease,
            transform 0.2s ease,
            visibility 0.2s ease;
        z-index: 1050;
    }

    /* Open mobile menu */
    .nav-toggle:checked ~ .nav-toggle-label {
        background: #eff6ff;
    }

    .nav-toggle:checked ~ .nav-toggle-label span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .nav-toggle:checked ~ .nav-toggle-label span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle:checked ~ .nav-toggle-label span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .nav-toggle:checked ~ .nav-links {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }

    /* Mobile links */
    .nav-link {
        width: 100%;
        height: auto;
        min-height: 44px;
        padding: 10px 4px;
        border-bottom: 1px solid #f1f5f9;
    }

    .nav-link::after {
        display: none;
    }

    /* Mobile Categories */
    .categories-dropdown {
        width: 100%;
        height: auto;
        display: block;
        border-bottom: 1px solid #f1f5f9;
    }

    .categories-trigger {
        width: 100%;
        height: 44px;
        padding: 10px 4px;
        justify-content: space-between;
    }

    .categories-menu {
        position: static;
        width: 100%;
        min-width: 0;
        max-width: none;
        padding: 0 0 8px;
        background: #f8fafc;
        border: none;
        border-radius: 7px;
        box-shadow: none;
        transform: none;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        display: none;
    }

    .categories-dropdown[open] .categories-menu {
        display: block;
        transform: none;
    }

    .category-link {
        padding: 9px 14px;
        font-size: 0.875rem;
    }

    .category-link:hover {
        transform: none;
    }

    /* Mobile Cart */
    .cart-link {
        gap: 7px;
    }

    /* Mobile Profile */
    .profile-nav-link {
        width: 100%;
        height: auto;
        min-height: 44px;
        padding: 7px 4px;
    }

    .profile-nav-name {
        font-size: 0.875rem;
    }

    /* Mobile Register */
    .nav-register {
        width: 100%;
        height: 40px;
        margin-top: 10px;
    }
}

/* ---------------------------------------------------------
   SMALL MOBILE
--------------------------------------------------------- */

@media (max-width: 480px) {
    .nav-container {
        padding: 0 15px;
    }

    .nav-links {
        padding-left: 15px;
        padding-right: 15px;
    }

    .logo {
        font-size: 1.3rem;
    }
}