.header {
    position: sticky;
    top: 0;
    z-index: 80;
    width: 100%;
    border-bottom: 1px solid rgba(185, 216, 229, 0.75);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.header-main {
    width: 100%;
}

.header-inner {
    min-height: 72px;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    gap: 10px;
}

.header-brand {
    display: flex;
    justify-content: center;
    min-width: 0;
}

.header-logo,
.custom-logo-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.brand-logo-image,
.header-logo img,
.custom-logo {
    display: block;
    max-width: 150px;
    object-fit: contain;
}

.header-menu-toggle,
.cart-button {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-blue);
    color: var(--navy);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.header-menu-toggle:hover,
.cart-button:hover {
    background: var(--brand-soft);
    border-color: var(--border-strong);
}

.header-menu-toggle:active,
.cart-button:active {
    transform: scale(0.97);
}

.menu-label,
.cart-label {
    display: none;
}

.menu-icon {
    width: 20px;
    height: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.menu-icon span {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transform-origin: center;
    transition: transform 180ms ease, opacity 180ms ease;
}

.header-menu-toggle[aria-expanded="true"] .menu-icon span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.header-menu-toggle[aria-expanded="true"] .menu-icon span:nth-child(2) {
    opacity: 0;
}

.header-menu-toggle[aria-expanded="true"] .menu-icon span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.header-actions {
    display: flex;
    justify-content: flex-end;
}

.cart-icon {
    position: relative;
    width: 24px;
    height: 24px;
}

.cart-icon svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: var(--accent-strong);
    color: #fff;
    font-size: 13px;
    line-height: 16px;
    font-weight: 900;
    text-align: center;
}

.desktop-nav {
    display: none;
}

.mobile-nav {
    position: fixed;
    inset: 72px 0 auto 0;
    z-index: 79;
    padding: 12px 18px 22px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 20px 40px rgba(9, 58, 90, 0.12);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 180ms ease, opacity 180ms ease, visibility 180ms ease;
}

.mobile-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.nav-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.mobile-list {
    display: grid;
    gap: 8px;
}

.mobile-list a {
    min-height: 52px;
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: var(--brand-pale);
    color: var(--navy);
    font-size: 16px;
    font-weight: 750;
}

.mobile-list a:hover,
.mobile-list .current-menu-item > a {
    border-color: var(--border-strong);
    background: var(--brand-soft);
    color: var(--brand-active);
}

@media (min-width: 768px) {
    .header-inner {
        min-height: 82px;
        grid-template-columns: auto 1fr auto;
        grid-template-areas: "brand nav actions";
        gap: 28px;
    }

    .header-menu-toggle,
    .mobile-nav {
        display: none;
    }

    .header-brand {
        grid-area: brand;
        justify-content: flex-start;
    }

    .brand-logo-image,
    .header-logo img,
    .custom-logo {
        max-width: 190px;
    }

    .desktop-nav {
        grid-area: nav;
        display: flex;
        justify-content: center;
        min-width: 0;
    }

    .desktop-list {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        flex-wrap: wrap;
    }

    .desktop-list a {
        position: relative;
        display: inline-flex;
        align-items: center;
        min-height: 42px;
        padding: 9px 13px;
        border-radius: 999px;
        color: var(--text);
        font-size: 15px;
        font-weight: 700;
        transition: color 160ms ease, background-color 160ms ease;
    }

    .desktop-list a:hover,
    .desktop-list .current-menu-item > a {
        background: var(--brand-pale);
        color: var(--brand-active);
    }

    .header-actions {
        grid-area: actions;
    }

    .cart-button {
        width: auto;
        min-width: 48px;
        padding: 0 13px;
        gap: 8px;
    }

    .cart-label {
        display: inline;
        font-size: 14px;
        font-weight: 800;
    }
}

@media (min-width: 1280px) {
    .header-inner {
        min-height: 88px;
        gap: 44px;
    }

    .brand-logo-image,
    .header-logo img,
    .custom-logo {
        height: 58px;
        max-width: 220px;
    }

    .desktop-list {
        gap: 12px;
    }

    .desktop-list a {
        padding-left: 16px;
        padding-right: 16px;
    }
}
