/* header.css - Reimagined Toy Universe Navigation */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

/* ============================================
   HEADER WRAPPER
   ============================================ */
.header-nav {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    padding: 0 56px;
    height: 80px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: none;
    gap: 0;
    font-family: 'Outfit', sans-serif;
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
    flex-wrap: nowrap;
    margin: 0;
}

.header-nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
            #ff6b6b 0%,
            #feca57 20%,
            #48dbfb 40%,
            #ff9ff3 60%,
            #54a0ff 80%,
            #ff6b6b 100%);
    background-size: 200% 100%;
    animation: rainbowSlide 8s linear infinite;
    z-index: 1;
}

@keyframes rainbowSlide {
    0% {
        background-position: 0% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.header-nav.scrolled {
    height: 68px;
    background: linear-gradient(135deg, #1a1a2eF2 0%, #16213eF2 50%, #0f3460F2 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25);
}

/* ============================================
   LOGO
   ============================================ */
.header-logo {
    font-family: 'Outfit', sans-serif;
    font-size: 28px;
    font-weight: 700;
    flex-shrink: 0;
    grid-column: 1;
}

.header-logo a {
    text-decoration: none;
    color: #ffffff;
    padding: 8px 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    white-space: nowrap;
    max-height: 80px;
    background: none;
    box-shadow: none;
    border-radius: 0;
    position: relative;
}

.logo-image {
    height: 64px;
    width: auto;
    max-height: 64px;
    object-fit: contain;
    display: block;
    margin: 0;
    padding: 0;
    border-radius: 12px;
    flex: 0 0 auto;
    filter: drop-shadow(0 2px 8px rgba(255, 107, 107, 0.3));
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

    /* Logo text has been removed as it is inside the image */

.header-logo a:hover {
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: none;
}

.header-logo a:hover .logo-image {
    filter: drop-shadow(0 4px 12px rgba(255, 107, 107, 0.5));
    transform: rotate(-3deg) scale(1.05);
}

/* ============================================
   NAVIGATION MENU
   ============================================ */
.header-menu {
    display: flex;
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
    align-items: center;
    justify-content: center;
    grid-column: 2;
}

/* ============================================
   MENU ITEMS
   ============================================ */
.header-menu-item {
    position: relative;
}

.header-menu-link {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    font-size: 15px;
    padding: 10px 22px;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: transparent;
    box-shadow: none;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    white-space: nowrap;
    letter-spacing: 0.02em;
    border: 1.5px solid transparent;
    position: relative;
    overflow: hidden;
}

.header-menu-link::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50px;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.15), rgba(72, 219, 251, 0.15));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.header-menu-link:hover {
    color: #ffffff;
    background: transparent;
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.header-menu-link:hover::after {
    opacity: 1;
    transform: none;
    width: auto;
    height: auto;
    bottom: auto;
    left: auto;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.15), rgba(72, 219, 251, 0.15));
}

.header-menu-link:active {
    transform: translateY(0);
    box-shadow: none;
    background: rgba(255, 255, 255, 0.08);
}

/* Menu Icon */
.header-menu-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.header-menu-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    transition: transform 0.3s ease;
}

.header-menu-link:hover .header-menu-icon svg {
    transform: scale(1.15);
}

/* ============================================
   CART LINK
   ============================================ */
.header-menu-link.header-cart-link {
    gap: 6px;
    padding: 10px 18px;
}

.header-cart-count {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 100px;
    min-width: 22px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(255, 107, 107, 0.4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.4;
    animation: none;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.header-menu-link.header-cart-link:hover .header-cart-count {
    transform: scale(1.15);
}

/* ============================================
   CTA BUTTON
   ============================================ */
.header-cta-link {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%) !important;
    color: #ffffff !important;
    padding: 11px 28px;
    border-radius: 50px;
    font-weight: 700;
    letter-spacing: 0.02em;
    border-color: transparent !important;
    box-shadow: 0 4px 20px rgba(255, 107, 107, 0.35);
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.header-cta-link:hover {
    background: linear-gradient(135deg, #ff8787 0%, #ff6b35 100%) !important;
    color: #ffffff !important;
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 28px rgba(255, 107, 107, 0.5);
    border-color: transparent !important;
}

.header-cta-link:active {
    transform: translateY(0) scale(1);
    box-shadow: 0 2px 12px rgba(255, 107, 107, 0.3);
}

.header-cta-link::after {
    display: none !important;
}

/* ============================================
   DIVIDER
   ============================================ */
.header-divider {
    width: 1px;
    height: 28px;
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    margin: 0 10px;
    list-style: none;
}

/* ============================================
   HAMBURGER MENU
   ============================================ */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 46px;
    height: 46px;
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    border-radius: 14px;
    box-shadow: none;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    gap: 5px;
    grid-column: 3;
}

.hamburger-menu:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.2);
    transform: none;
}

.hamburger-menu .bar {
    display: block;
    width: 20px;
    height: 2px;
    background-color: #ffffff;
    border-radius: 4px;
    transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
}

.hamburger-menu .bar:nth-child(1) {
    width: 20px;
    transform: translateY(0);
}

.hamburger-menu .bar:nth-child(2) {
    width: 14px;
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.hamburger-menu .bar:nth-child(3) {
    width: 17px;
    transform: translateY(0);
}

.hamburger-menu:hover .bar:nth-child(2) {
    width: 20px;
}

.hamburger-menu:hover .bar:nth-child(3) {
    width: 20px;
}

/* Hamburger Active */
.hamburger-menu.active {
    background: rgba(255, 107, 107, 0.2);
    border-color: rgba(255, 107, 107, 0.3);
}

.hamburger-menu.active .bar {
    background-color: #ff6b6b;
    width: 20px;
}

.hamburger-menu.active .bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger-menu.active .bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger-menu.active .bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ============================================
   RESPONSIVE — LARGE TABLET
   ============================================ */
@media (max-width: 1024px) {
    .header-nav {
        padding: 0 36px;
    }

    .header-menu-link {
        padding: 10px 16px;
        font-size: 14px;
    }

    .header-logo a {
        gap: 12px;
    }

    .logo-image {
        height: 54px;
    }
}

/* ============================================
   RESPONSIVE — TABLET
   ============================================ */
@media (max-width: 900px) {
    .header-nav {
        padding: 0 28px;
    }

    .header-menu {
        gap: 0;
    }

    .header-menu-link {
        padding: 10px 12px;
        font-size: 14px;
    }

    .logo-image {
        height: 48px;
    }
}

/* ============================================
   RESPONSIVE — MOBILE (768px)
   ============================================ */
@media (max-width: 768px) {
    .header-nav {
        grid-template-columns: 1fr auto;
        padding: 0 20px;
        height: 68px;
        border-bottom: none;
        position: sticky;
        top: 0;
        margin: 0;
        border-radius: 0;
    }

    .hamburger-menu {
        display: flex;
        flex-shrink: 0;
        grid-column: 2;
    }

    /* MOBILE MENU - FIXED VISIBILITY APPROACH */
    .header-menu {
        position: absolute;
        top: 100%;
        left: 12px;
        right: 12px;
        grid-column: 1 / -1;
        flex-direction: column;
        background: linear-gradient(170deg, #1a1a2e 0%, #16213e 100%);
        padding: 12px;
        border-radius: 20px;
        box-shadow:
            0 20px 60px rgba(0, 0, 0, 0.35),
            0 0 0 1px rgba(255, 255, 255, 0.06);
        border: none;
        text-align: center;
        z-index: 999;
        gap: 4px;

        /* HIDDEN STATE — no display:none, use clip + pointer-events */
        opacity: 0;
        visibility: hidden;
        transform: translateY(-12px) scale(0.97);
        pointer-events: none;
        clip-path: inset(0 0 100% 0);
        transition:
            opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1),
            visibility 0.35s cubic-bezier(0.22, 1, 0.36, 1),
            transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
            clip-path 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    }

    /* VISIBLE STATE */
    .header-menu.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0) scale(1);
        pointer-events: auto;
        clip-path: inset(0 0 -20px 0);
    }

    .header-menu-item {
        width: 100%;
        opacity: 0;
        transform: translateY(-8px);
        transition: opacity 0.3s ease, transform 0.3s ease;
    }

    .header-menu.active .header-menu-item {
        opacity: 1;
        transform: translateY(0);
    }

    .header-menu.active .header-menu-item:nth-child(1) {
        transition-delay: 0.05s;
    }

    .header-menu.active .header-menu-item:nth-child(2) {
        transition-delay: 0.08s;
    }

    .header-menu.active .header-menu-item:nth-child(3) {
        transition-delay: 0.11s;
    }

    .header-menu.active .header-menu-item:nth-child(4) {
        transition-delay: 0.14s;
    }

    .header-menu.active .header-menu-item:nth-child(5) {
        transition-delay: 0.17s;
    }

    .header-menu.active .header-menu-item:nth-child(6) {
        transition-delay: 0.20s;
    }

    .header-menu.active .header-menu-item:nth-child(7) {
        transition-delay: 0.23s;
    }

    .header-menu.active .header-menu-item:nth-child(8) {
        transition-delay: 0.26s;
    }

    .header-menu.active .header-menu-item:nth-child(9) {
        transition-delay: 0.29s;
    }

    .header-menu.active .header-menu-item:nth-child(10) {
        transition-delay: 0.32s;
    }

    .header-menu-link {
        display: flex;
        width: 100%;
        padding: 16px 32px;
        font-size: 16px;
        border-radius: 14px;
        justify-content: flex-start;
        color: rgba(255, 255, 255, 0.75);
    }

    .header-menu-link::after {
        display: none;
    }

    .header-menu-link:hover {
        background: rgba(255, 255, 255, 0.08);
        color: #ffffff;
        transform: none;
        border-color: transparent;
        box-shadow: none;
    }

    .header-cta-link {
        margin-top: 8px;
        padding: 14px 28px;
        font-size: 16px;
        justify-content: center;
    }

    .header-cta-link:hover {
        transform: none;
    }

    .header-divider {
        width: calc(100% - 32px);
        height: 1px;
        margin: 4px auto;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    }

    .header-logo {
        min-width: 0;
        flex: 1;
        overflow: hidden;
        grid-column: 1;
    }

    .header-logo a {
        gap: 10px;
        max-width: 100%;
    }

    .logo-image {
        height: 48px;
        flex-shrink: 0;
    }
}

/* ============================================
   RESPONSIVE — SMALL MOBILE
   ============================================ */
@media (max-width: 480px) {
    .header-nav {
        padding: 0 16px;
        height: 62px;
    }

    .header-logo a {
        gap: 8px;
    }

    .logo-image {
        height: 42px;
    }

    .hamburger-menu {
        width: 42px;
        height: 42px;
        border-radius: 12px;
    }

    .hamburger-menu .bar {
        width: 18px;
    }

    .hamburger-menu .bar:nth-child(2) {
        width: 12px;
    }

    .hamburger-menu .bar:nth-child(3) {
        width: 15px;
    }

    .header-menu {
        left: 8px;
        right: 8px;
        padding: 10px;
        border-radius: 18px;
    }

    .header-menu-link {
        padding: 14px 20px;
        font-size: 15px;
        border-radius: 12px;
    }

    .header-cart-count {
        font-size: 10px;
        padding: 2px 6px;
        min-width: 18px;
    }
}

/* ============================================
   RESPONSIVE — EXTRA SMALL
   ============================================ */
@media (max-width: 360px) {
    .header-nav {
        padding: 0 12px;
        height: 58px;
    }

    .logo-image {
        height: 38px;
    }

    .hamburger-menu {
        width: 38px;
        height: 38px;
    }

    .header-menu-link {
        padding: 12px 16px;
        font-size: 14px;
    }
}

/* ============================================
   TOUCH DEVICES
   ============================================ */
@media (hover: none) {
    .header-menu-link:hover {
        transform: none;
        background: transparent;
        color: rgba(255, 255, 255, 0.7);
        border-color: transparent;
        box-shadow: none;
    }

    .header-menu-link:hover::after {
        opacity: 0;
    }

    .header-menu-link:active {
        background: rgba(255, 255, 255, 0.1);
        color: #ffffff;
    }

    .header-logo a:hover {
        opacity: 1;
        transform: none;
    }

    .header-logo a:hover .logo-image {
        filter: drop-shadow(0 2px 8px rgba(255, 107, 107, 0.3));
        transform: none;
    }

    .hamburger-menu:hover {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.12);
    }

    .header-cta-link:hover {
        transform: none;
        box-shadow: 0 4px 20px rgba(255, 107, 107, 0.35);
    }
}

/* ============================================
   LANDSCAPE MOBILE
   ============================================ */
@media (max-width: 768px) and (orientation: landscape) {
    .header-nav {
        padding: 0 24px;
        height: 56px;
    }

    .header-menu {
        max-height: 55vh;
        overflow-y: auto;
        padding: 8px 12px;
    }

    .header-menu-link {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
.hamburger-menu:focus-visible {
    outline: 2px solid #48dbfb;
    outline-offset: 3px;
}

.header-menu-link:focus-visible {
    outline: 2px solid #48dbfb;
    outline-offset: 3px;
}

.header-logo a:focus-visible {
    outline: 2px solid #48dbfb;
    outline-offset: 3px;
}

.hamburger-menu:focus:not(:focus-visible) {
    outline: none;
}

.header-menu-link:focus:not(:focus-visible) {
    outline: none;
}

.header-logo a:focus:not(:focus-visible) {
    outline: none;
}

/* ============================================
   BODY SCROLL LOCK
   ============================================ */
body.menu-open {
    overflow: hidden;
}

@media (min-width: 769px) {
    body.menu-open {
        overflow: auto;
    }
}

/* ============================================
   MOBILE OVERLAY
   ============================================ */
.header-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 20, 0.45);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.35s ease;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.header-overlay.active {
    display: block;
    opacity: 1;
}