/* BASE RESET */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
}

/* HEADER NAVIGATION */
.header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 48px;
    background: linear-gradient(145deg, #f0e6ff, #e6d5ff);
    border-radius: 24px;
    margin: 16px;
    box-shadow:
        8px 8px 16px rgba(0, 0, 0, 0.15),
        -8px -8px 16px rgba(255, 255, 255, 0.8),
        inset 2px 2px 4px rgba(255, 255, 255, 0.6),
        inset -1px -1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.5);
    position: sticky;
    top: 10px;
    z-index: 1000;
    flex-wrap: wrap;
    gap: 16px;
}

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

.header-logo a {
    text-decoration: none;
    color: #6b4c9a;
    background: linear-gradient(145deg, #fff5f5, #ffe6e6);
    padding: 4px 16px 4px 4px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow:
        4px 4px 8px rgba(0, 0, 0, 0.1),
        -4px -4px 8px rgba(255, 255, 255, 0.9),
        inset 1px 1px 2px rgba(255, 255, 255, 0.8),
        inset -1px -1px 2px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
    white-space: nowrap;
    max-height: 80px;
}

.logo-image {
    height: 72px;
    width: auto;
    max-height: 72px;
    object-fit: contain;
    display: block;
    margin: 0;
    padding: 0;
    border-radius: 12px;
    flex: 0 0 auto;
}

.logo-text {
    font-size: 26px;
    font-weight: 700;
}

.header-logo a:hover {
    transform: translateY(-2px);
    box-shadow:
        6px 6px 12px rgba(0, 0, 0, 0.12),
        -6px -6px 12px rgba(255, 255, 255, 0.95),
        inset 1px 1px 2px rgba(255, 255, 255, 0.8),
        inset -1px -1px 2px rgba(0, 0, 0, 0.03);
}

/* HAMBURGER MENU BUTTON */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 32px;
    height: 24px;
    background: linear-gradient(145deg, #fff, #f0f0f0);
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
    border-radius: 10px;
    box-shadow:
        3px 3px 6px rgba(0, 0, 0, 0.1),
        -3px -3px 6px rgba(255, 255, 255, 0.9),
        inset 1px 1px 2px rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
}

.hamburger-menu:hover {
    transform: scale(1.05);
    box-shadow:
        4px 4px 8px rgba(0, 0, 0, 0.12),
        -4px -4px 8px rgba(255, 255, 255, 0.95);
}

.hamburger-menu .bar {
    display: block;
    width: 24px;
    height: 3px;
    background-color: #6b4c9a;
    border-radius: 3px;
    transition: all 0.3s ease;
    position: relative;
}

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

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

/* Hamburger Animation - Active State */
.hamburger-menu.active {
    background: linear-gradient(145deg, #fff0b3, #ffe066);
}

.hamburger-menu.active .bar {
    background-color: #5a3d7a;
}

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

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

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

/* MENU */
.header-menu {
    display: flex;
    gap: 12px;
    list-style: none;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
    align-items: center;
    flex-wrap: wrap;
}

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

.header-menu-link {
    text-decoration: none;
    color: #5a3d7a;
    font-weight: 500;
    font-size: 16px;
    padding: 12px 24px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(145deg, #e8f4f0, #d4f0e8);
    box-shadow:
        4px 4px 8px rgba(0, 0, 0, 0.1),
        -4px -4px 8px rgba(255, 255, 255, 0.8),
        inset 1px 1px 2px rgba(255, 255, 255, 0.7),
        inset -1px -1px 2px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.header-menu-link:hover {
    transform: translateY(-3px) scale(1.02);
    background: linear-gradient(145deg, #fff0b3, #ffe066);
    color: #6b4c9a;
    box-shadow:
        6px 6px 14px rgba(0, 0, 0, 0.12),
        -6px -6px 14px rgba(255, 255, 255, 0.9),
        inset 2px 2px 4px rgba(255, 255, 255, 0.8),
        inset -1px -1px 3px rgba(0, 0, 0, 0.05);
}

.header-menu-link:active {
    transform: translateY(0) scale(0.98);
    box-shadow:
        2px 2px 4px rgba(0, 0, 0, 0.1),
        -2px -2px 4px rgba(255, 255, 255, 0.7),
        inset 2px 2px 6px rgba(0, 0, 0, 0.08),
        inset -2px -2px 6px rgba(255, 255, 255, 0.5);
}

/* CART COUNT BADGE */
.header-cart-count {
    background: linear-gradient(145deg, #ff9a9e, #ff6b7a);
    color: white;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    min-width: 24px;
    text-align: center;
    box-shadow:
        3px 3px 6px rgba(0, 0, 0, 0.15),
        -2px -2px 4px rgba(255, 255, 255, 0.3),
        inset 1px 1px 2px rgba(255, 255, 255, 0.4),
        inset -1px -1px 2px rgba(0, 0, 0, 0.1);
    animation: header-bounce 2s ease-in-out infinite;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Bounce Animation for Cart Badge */
@keyframes header-bounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* RESPONSIVE STYLES */

/* Large Tablet */
@media (max-width: 1024px) {
    .header-nav {
        padding: 14px 32px;
    }

    .header-menu-link {
        padding: 10px 18px;
        font-size: 15px;
    }

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

    .logo-image {
        height: 56px;
    }

    .logo-text {
        font-size: 22px;
    }
}

/* Tablet */
@media (max-width: 900px) {
    .header-nav {
        padding: 14px 24px;
    }

    .header-menu {
        gap: 8px;
    }

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

    .logo-image {
        height: 48px;
    }

    .logo-text {
        font-size: 20px;
    }
}

/* Mobile Navigation Breakpoint */
@media (max-width: 768px) {
    .header-nav {
        padding: 12px 20px;
        margin: 12px;
        border-radius: 20px;
        position: sticky;
        top: 8px;
    }

    .hamburger-menu {
        display: flex;
        flex-shrink: 0;
        /* Keep menu button full size */
    }

    .header-menu {
        display: none;
        position: absolute;
        top: calc(100% + 12px);
        left: 12px;
        right: 12px;
        flex-direction: column;
        background: linear-gradient(145deg, #f8f4ff, #f0e8ff);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        padding: 20px;
        border-radius: 20px;
        box-shadow:
            8px 8px 20px rgba(0, 0, 0, 0.15),
            -8px -8px 20px rgba(255, 255, 255, 0.8),
            inset 2px 2px 4px rgba(255, 255, 255, 0.6);
        border: 1px solid rgba(255, 255, 255, 0.5);
        text-align: center;
        z-index: 999;
        gap: 10px;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all 0.3s ease;
    }

    .header-menu.active {
        display: flex;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        animation: slideDown 0.3s ease forwards;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .header-menu-item {
        width: 100%;
    }

    .header-menu-link {
        display: flex;
        width: 100%;
        padding: 14px 20px;
        font-size: 16px;
        border-radius: 14px;
        justify-content: center;
    }

    .header-menu-link:hover {
        transform: translateY(-2px) scale(1.01);
    }

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

    .header-logo a {
        padding: 4px 10px 4px 4px;
        border-radius: 14px;
        gap: 8px;
        max-width: 100%;
    }

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

    .logo-text {
        font-size: 18px;
        /* Scale down text */
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .header-nav {
        margin: 8px;
        padding: 10px 16px;
        border-radius: 18px;
        top: 6px;
    }

    .header-logo a {
        padding: 4px 8px 4px 4px;
        gap: 6px;
        border-radius: 12px;
    }

    .logo-image {
        height: 36px;
    }

    .logo-text {
        font-size: 16px;
    }

    .hamburger-menu {
        width: 44px;
        height: 44px;
        padding: 6px;
        border-radius: 12px;
    }

    .hamburger-menu .bar {
        width: 22px;
        height: 2.5px;
    }

    .header-menu {
        left: 8px;
        right: 8px;
        top: calc(100% + 10px);
        padding: 16px;
        border-radius: 18px;
        gap: 8px;
    }

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

    .header-cart-count {
        font-size: 11px;
        padding: 3px 8px;
        min-width: 20px;
    }
}

/* Extra Small Mobile */
@media (max-width: 360px) {
    .header-nav {
        margin: 6px;
        padding: 8px 12px;
    }

    .header-logo a {
        padding: 4px 6px 4px 4px;
    }

    .logo-image {
        height: 32px;
    }

    .logo-text {
        font-size: 14px;
    }

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

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

/* TOUCH DEVICE OPTIMIZATIONS */
@media (hover: none) {
    .header-menu-link:hover {
        transform: none;
    }

    .header-menu-link:active {
        transform: scale(0.97);
        background: linear-gradient(145deg, #fff0b3, #ffe066);
    }

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

    .hamburger-menu:hover {
        transform: none;
    }
}

/* LANDSCAPE MOBILE */
@media (max-width: 768px) and (orientation: landscape) {
    .header-nav {
        padding: 10px 24px;
        margin: 8px 12px;
    }

    .header-menu {
        max-height: 60vh;
        overflow-y: auto;
        padding: 16px;
    }

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

/* ACCESSIBILITY */
.hamburger-menu:focus {
    outline: 3px solid #6b4c9a;
    outline-offset: 2px;
}

.header-menu-link:focus {
    outline: 3px solid #6b4c9a;
    outline-offset: 2px;
}

.header-logo a:focus {
    outline: 3px solid #6b4c9a;
    outline-offset: 2px;
}

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

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