/* ============================================================================
   ROSTA BASKET — HEADER v3
   Modern Sports Pro — Top Bar · Sliding Indicators · Frosted Glass
   ============================================================================ */

/* ---- Design Tokens ---- */
:root {
    --hdr-red:           #e5101a;
    --hdr-red-dark:      #c0000a;
    --hdr-red-light:     #f0343d;
    --hdr-red-glow:      rgba(229, 16, 26, 0.28);
    --hdr-bg:            rgba(255, 255, 255, 0.75);
    --hdr-surface:       rgba(0, 0, 0, 0.045);
    --hdr-surface-hover: rgba(0, 0, 0, 0.08);
    --hdr-border:        rgba(0, 0, 0, 0.07);
    --hdr-text:          #0f0f0f;
    --hdr-muted:         rgba(15, 15, 15, 0.46);
    --hdr-height:        68px;
    --hdr-height-sm:     56px;
    --topbar-height:     34px;
    --t:                 0.22s ease;
}

/* ============================================================================
   SKIP LINK (a11y)
   ============================================================================ */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    z-index: 9999;
    background: var(--hdr-red);
    color: #fff;
    padding: 8px 18px;
    border-radius: 0 0 8px 8px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.875rem;
    text-decoration: none;
    transition: top var(--t);
}

.skip-link:focus {
    top: 0;
}

/* ============================================================================
   TOP BAR  ·  fixed above main header
   ============================================================================ */
.header-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    height: var(--topbar-height);
    background: rgba(248, 248, 248, 0.88);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transform: translateY(0);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.header-topbar.scrolled-away {
    transform: translateY(-100%);
}

.topbar-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 28px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.topbar-announce {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Inter', 'Montserrat', sans-serif;
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--hdr-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.2px;
    margin: 0;
}

.topbar-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(229, 16, 26, 0.16);
    color: var(--hdr-red);
    font-family: 'Inter', 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.65rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid rgba(229, 16, 26, 0.28);
    flex-shrink: 0;
}

.topbar-sep {
    color: rgba(255, 255, 255, 0.18);
}

.topbar-social {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.topbar-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    color: var(--hdr-muted);
    font-size: 0.68rem;
    text-decoration: none;
    transition: color var(--t), background var(--t);
}

.topbar-social-link:hover {
    color: var(--hdr-text);
    background: var(--hdr-surface);
}

.topbar-social-link:focus-visible {
    outline: 2px solid var(--hdr-red);
    outline-offset: 2px;
}

/* ============================================================================
   SITE HEADER SHELL  ·  always frosted glass
   ============================================================================ */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--hdr-bg);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border-bottom: 1px solid var(--hdr-border);
    transition: box-shadow var(--t), background var(--t);
}

.site-header.scrolled {
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 1px 0 rgba(0, 0, 0, 0.06);
}

/* ============================================================================
   SCROLL PROGRESS BAR
   ============================================================================ */
.scroll-progress {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0%;
    height: 2px;
    background: linear-gradient(90deg, var(--hdr-red) 0%, var(--hdr-red-light) 100%);
    transition: width 0.08s linear;
    border-radius: 0 2px 2px 0;
    pointer-events: none;
}

/* ============================================================================
   INNER LAYOUT  ·  Logo | Nav (centered) | CTA (right)
   ============================================================================ */
.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 28px;
    height: var(--hdr-height);
    display: flex;
    align-items: center;
    transition: height var(--t);
}

.site-header.scrolled .header-inner {
    height: var(--hdr-height-sm);
}

/* ============================================================================
   LOGO + WORDMARK
   ============================================================================ */
.header-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    margin-right: 24px;
    transition: opacity var(--t);
}

.header-logo:hover {
    opacity: 0.85;
}

.header-logo:focus-visible {
    outline: 2px solid var(--hdr-red);
    outline-offset: 4px;
    border-radius: 6px;
}

.logo-img {
    height: 46px;
    width: auto;
    transition: height var(--t);
    filter: none;
}

.site-header.scrolled .logo-img {
    height: 36px;
}

.logo-wordmark {
    display: flex;
    flex-direction: column;
    line-height: 1;
    gap: 1px;
    pointer-events: none;
    user-select: none;
}

.logo-w1 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 0.86rem;
    letter-spacing: 3.5px;
    color: var(--hdr-text);
    text-transform: uppercase;
}

.logo-w2 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
    font-size: 0.66rem;
    letter-spacing: 3px;
    color: var(--hdr-muted);
    text-transform: uppercase;
}

/* ============================================================================
   DESKTOP NAVIGATION  ·  centered · no icons · sliding underline
   ============================================================================ */
.header-nav {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.header-nav .nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 8px 13px 12px;
    color: var(--hdr-muted);
    font-family: 'Inter', 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 0.76rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    border-radius: 6px;
    background: none;
    min-width: 0;
    transition: color var(--t);
}

/* Sliding underline indicator */
.header-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 13px;
    right: 13px;
    height: 2px;
    background: var(--hdr-red);
    border-radius: 1px;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.24s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-nav .nav-link:hover {
    color: var(--hdr-text);
    background: none;
}

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

.header-nav .nav-link.active {
    color: var(--hdr-text);
}

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

.header-nav .nav-link:focus-visible {
    outline: 2px solid var(--hdr-red);
    outline-offset: 2px;
}

/* ============================================================================
   CTA BUTTON  ·  pill · fill → outline on hover
   ============================================================================ */
.header-cta {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    padding: 10px 26px;
    background: var(--hdr-red);
    color: #fff;
    border-radius: 50px;
    border: 1.5px solid var(--hdr-red);
    font-family: 'Inter', 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 2px 14px rgba(229, 16, 26, 0.22);
    transition: background var(--t), color var(--t), box-shadow var(--t), transform var(--t);
    margin-left: 20px;
}

.header-cta:hover {
    background: transparent;
    color: var(--hdr-red);
    box-shadow: none;
    transform: translateY(-1px);
}

.header-cta.active {
    background: transparent;
    color: var(--hdr-red);
    box-shadow: none;
}

.header-cta:focus-visible {
    outline: 2px solid var(--hdr-red);
    outline-offset: 3px;
}

/* ============================================================================
   HAMBURGER TOGGLE  ·  mobile only
   ============================================================================ */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: var(--hdr-surface);
    border: 1px solid var(--hdr-border);
    border-radius: 10px;
    cursor: pointer;
    margin-left: auto;
    flex-shrink: 0;
    transition: background var(--t), border-color var(--t);
}

.nav-toggle:hover {
    background: var(--hdr-surface-hover);
    border-color: rgba(255, 255, 255, 0.13);
}

.nav-toggle:focus-visible {
    outline: 2px solid var(--hdr-red);
    outline-offset: 2px;
}

.toggle-bar {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--hdr-text);
    border-radius: 2px;
    transform-origin: center;
    transition: transform 0.28s ease, opacity 0.2s ease;
}

/* Hamburger → X animation */
.nav-toggle[aria-expanded="true"] .toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .toggle-bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

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

/* ============================================================================
   RESPONSIVE BREAKPOINTS
   ============================================================================ */
@media (max-width: 1100px) {
    .header-nav .nav-link { padding: 8px 10px 12px; font-size: 0.73rem; }
    .header-nav .nav-link::after { left: 10px; right: 10px; }
}

@media (max-width: 900px) {
    .header-nav .nav-link { padding: 8px 8px 12px; font-size: 0.71rem; }
    .header-nav .nav-link::after { left: 8px; right: 8px; }
}

@media (max-width: 768px) {
    .header-inner {
        padding: 0 16px;
        height: 60px;
    }

    .site-header.scrolled .header-inner {
        height: 56px;
    }

    .logo-img {
        height: 40px;
    }

    .site-header.scrolled .logo-img {
        height: 36px;
    }

    .header-nav,
    .header-cta { display: none; }
    .nav-toggle {
        display: flex;
        width: var(--touch-min, 44px);
        height: var(--touch-min, 44px);
    }
    .logo-wordmark { display: none; }
    .topbar-info-text { display: none; }
    .topbar-sep { display: none; }
}

@media (max-width: 480px) {
    .header-inner { padding: 0 12px; }
    .header-logo { margin-right: 12px; }
}

@media (min-width: 769px) {
    .nav-toggle { display: none !important; }
    .mobile-drawer,
    .mobile-backdrop { display: none !important; }
}

/* ============================================================================
   MOBILE BACKDROP
   ============================================================================ */
.mobile-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10048;
    background: oklch(12% 0.01 22 / 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
}

/* ============================================================================
   MOBILE DRAWER  ·  pannello destro, stile editoriale (allineato al header)
   ============================================================================ */
.mobile-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 10050;
    width: min(100%, 320px);
    max-width: 100%;
    background: oklch(99% 0.004 22);
    border-left: 1px solid oklch(0% 0.005 22 / 0.1);
    box-shadow: -12px 0 40px oklch(0% 0 0 / 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    padding-top: env(safe-area-inset-top, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.mobile-drawer.open {
    transform: translateX(0);
}

.drawer-handle {
    display: none;
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid oklch(0% 0.005 22 / 0.08);
    flex-shrink: 0;
}

.drawer-brand {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.drawer-eyebrow {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: oklch(54% 0.20 22 / 0.85);
    margin: 0;
}

.drawer-title {
    font-family: 'Oswald', Impact, 'Arial Narrow', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: oklch(15% 0.01 22);
    margin: 0;
    line-height: 1.1;
}

.drawer-logo {
    display: none;
}

.drawer-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: oklch(0% 0.005 22 / 0.04);
    border: 1px solid oklch(0% 0.005 22 / 0.1);
    border-radius: 10px;
    color: oklch(15% 0.01 22);
    cursor: pointer;
    font-size: 1rem;
    flex-shrink: 0;
    transition: background var(--t), border-color var(--t);
}

.drawer-close:hover {
    background: oklch(0% 0.005 22 / 0.07);
    border-color: oklch(54% 0.20 22 / 0.25);
}

.drawer-close:focus-visible {
    outline: 2px solid var(--hdr-red);
    outline-offset: 2px;
}

.drawer-nav {
    list-style: none;
    padding: 12px 14px;
    margin: 0;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.drawer-nav li {
    margin: 0 0 4px;
}

.drawer-link {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 12px 14px;
    border-radius: 8px;
    color: oklch(38% 0.01 22);
    font-family: 'Oswald', Impact, 'Arial Narrow', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    transition: background var(--t), color var(--t);
}

.drawer-link:hover {
    background: oklch(0% 0.005 22 / 0.04);
    color: oklch(15% 0.01 22);
}

.drawer-link.active {
    background: oklch(54% 0.20 22 / 0.1);
    color: var(--hdr-red);
}

.drawer-link:focus-visible {
    outline: 2px solid var(--hdr-red);
    outline-offset: 2px;
}

.drawer-cta-wrap {
    padding: 14px 16px 18px;
    border-top: 1px solid oklch(0% 0.005 22 / 0.08);
    flex-shrink: 0;
    background: oklch(97% 0.004 22);
}

.drawer-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 14px 20px;
    background: var(--hdr-red);
    color: oklch(99% 0.005 22);
    border-radius: 50px;
    border: 1.5px solid var(--hdr-red);
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    text-decoration: none;
    box-shadow: 0 2px 14px oklch(54% 0.20 22 / 0.22);
    transition: background var(--t), color var(--t), box-shadow var(--t);
}

.drawer-cta:hover {
    background: transparent;
    color: var(--hdr-red);
    box-shadow: none;
}

.drawer-cta:focus-visible {
    outline: 2px solid var(--hdr-red);
    outline-offset: 3px;
}

.drawer-social {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 14px 0 0;
}

.drawer-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: oklch(99% 0.004 22);
    border: 1px solid oklch(0% 0.005 22 / 0.12);
    color: oklch(45% 0.01 22);
    font-size: 0.95rem;
    text-decoration: none;
    transition: background var(--t), color var(--t), border-color var(--t);
}

.drawer-social-link:hover {
    background: oklch(54% 0.20 22 / 0.08);
    color: var(--hdr-red);
    border-color: oklch(54% 0.20 22 / 0.3);
}

.drawer-social-link:focus-visible {
    outline: 2px solid var(--hdr-red);
    outline-offset: 2px;
}

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

/* body offset: responsive.css (--site-header-offset) */

/* ============================================================================
   REDUCED MOTION
   ============================================================================ */
@media (prefers-reduced-motion: reduce) {
    .site-header,
    .logo-img,
    .header-nav .nav-link,
    .header-nav .nav-link::after,
    .header-cta,
    .nav-toggle,
    .toggle-bar,
    .mobile-drawer,
    .mobile-backdrop,
    .drawer-link,
    .skip-link,
    .scroll-progress {
        transition: none !important;
        animation: none !important;
    }
}
