/* =========================================================
   ALFA SPORT — HEADER
   Fixed + transparente en Home
   ========================================================= */

.alfa-header {
    position: relative;

    z-index: var(--alfa-z-header);

    width: 100%;

    background: rgba(247, 245, 240, 0.98);

    border-bottom: 1px solid var(--alfa-border-light);

    box-shadow: none;

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    transition:
        background-color 350ms ease,
        border-color 350ms ease,
        box-shadow 350ms ease,
        backdrop-filter 350ms ease;
}


/* =========================================================
   PÁGINAS INTERIORES — STICKY
   ========================================================= */

.alfa-header--sticky {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    left: auto;
    right: auto;
    width: 100%;
    z-index: 1000;
}


/* =========================================================
   HOME — FIXED
   Solo la Home queda anclada sobre el hero.
   ========================================================= */

.alfa-header--home {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
}


/* =========================================================
   HOME — TRANSPARENTE ARRIBA
   ========================================================= */

.alfa-header--home:not(.is-scrolled) {
    background: transparent;

    border-bottom-color: transparent;

    box-shadow: none;

    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}


/* Texto blanco sobre hero */

.alfa-header--home:not(.is-scrolled)
.alfa-header__menu > li > a {
    color: #fff;
}

.alfa-header--home:not(.is-scrolled)
.alfa-header__icon-btn {
    color: #fff;
}

.alfa-header--home:not(.is-scrolled)
.alfa-header__mobile-toggle span {
    background: #fff;
}


/* Hover sobre hero */

.alfa-header--home:not(.is-scrolled)
.alfa-header__menu > li > a:hover {
    color: rgba(255, 255, 255, 0.72);
}

.alfa-header--home:not(.is-scrolled)
.alfa-header__icon-btn:hover {
    color: #fff;

    background: rgba(255, 255, 255, 0.10);
}


/* Activo sobre hero */

.alfa-header--home:not(.is-scrolled)
.alfa-header__menu >
.current-menu-item > a::after,

.alfa-header--home:not(.is-scrolled)
.alfa-header__menu >
.current-menu-ancestor > a::after {
    background: #fff;
}


/* =========================================================
   SCROLL / PÁGINAS INTERIORES
   ========================================================= */

.alfa-header.is-scrolled,
.alfa-header--solid {
    background: rgba(247, 245, 240, 0.98);

    border-bottom-color: var(--alfa-border-light);

    box-shadow:
        0 7px 28px
        rgba(0, 30, 25, 0.08);

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}


.alfa-header.is-scrolled
.alfa-header__menu > li > a,

.alfa-header--solid
.alfa-header__menu > li > a {
    color: var(--alfa-text-dark);
}


.alfa-header.is-scrolled
.alfa-header__icon-btn,

.alfa-header--solid
.alfa-header__icon-btn {
    color: var(--alfa-text-dark);
}


.alfa-header.is-scrolled
.alfa-header__mobile-toggle span,

.alfa-header--solid
.alfa-header__mobile-toggle span {
    background: var(--alfa-green-deep);
}


/* =========================================================
   HEADER INNER
   ALTURA ORIGINAL — NO CAMBIA EN SCROLL
   ========================================================= */

.alfa-header__inner {
    position: relative;

    display: grid;

    grid-template-columns:
        260px
        minmax(0, 1fr)
        260px;

    align-items: center;

    min-height: var(--alfa-header-height);
}


/* =========================================================
   LOGO
   ========================================================= */

.alfa-header__logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.alfa-header__logo-link {
    display: inline-flex;
    align-items: center;
}

.alfa-header__logo-img {
    width: auto;

    max-width: 205px;
    max-height: 78px;

    object-fit: contain;

    transition:
        filter 300ms ease,
        opacity 300ms ease;
}

.alfa-header__brand {
    color: var(--alfa-green);

    font-size: 23px;
    font-weight: 700;

    letter-spacing: 0.18em;
}


/*
 * Si usas el logo verde/oscuro actual,
 * en la Home transparente lo convierte visualmente en blanco.
 *
 * Si tu logo ya es blanco, elimina esta regla.
 */
.alfa-header--home:not(.is-scrolled)
.alfa-header__logo-img {
    filter: brightness(0) invert(1);
}


/* Brand textual */

.alfa-header--home:not(.is-scrolled)
.alfa-header__brand {
    color: #fff;
}


/* =========================================================
   DESKTOP NAV
   ========================================================= */

.alfa-header__nav {
    display: flex;
    align-items: center;
    justify-content: center;

    height: 100%;
}

.alfa-header__menu {
    display: flex;
    align-items: stretch;
    justify-content: center;

    height: var(--alfa-header-height);

    margin: 0;
    padding: 0;

    list-style: none;
}

.alfa-header__menu > li {
    position: relative;

    display: flex;
    align-items: stretch;

    margin: 0 18px;
}

.alfa-header__menu > li > a {
    position: relative;

    display: flex;
    align-items: center;

    padding: 0 3px;

    color: var(--alfa-text-dark);

    font-size: 13px;
    font-weight: 600;
    line-height: 1;

    text-transform: uppercase;
    letter-spacing: 0.025em;

    transition:
        color 300ms ease;
}

.alfa-header__menu > li > a:hover {
    color: var(--alfa-green);
}


/* active */

.alfa-header__menu > .current-menu-item > a::after,
.alfa-header__menu > .current-menu-ancestor > a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 25px;
    height: 1px;
    background: var(--alfa-green);
    transition:
        background-color 300ms ease;
}


/* =========================================================
   DESKTOP DROPDOWN
   ========================================================= */

.alfa-header__menu > .menu-item-has-children > a {
    gap: 8px;
}

.alfa-header__menu > .menu-item-has-children > a::before {
    content: "";

    width: 6px;
    height: 6px;

    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;

    transform:
        rotate(45deg)
        translateY(-2px);

    order: 2;
}

.alfa-header__menu .sub-menu {
    position: absolute;

    top: calc(100% - 13px);
    left: 50%;

    z-index: var(--alfa-z-dropdown);

    width: 245px;

    margin: 0;
    padding: 9px;

    background: var(--alfa-bg-white);

    border: 1px solid var(--alfa-border-light);
    border-radius: var(--alfa-radius-md);

    box-shadow: var(--alfa-shadow-md);

    list-style: none;

    opacity: 0;
    visibility: hidden;

    transform:
        translate(-50%, 10px);

    transition:
        opacity var(--alfa-transition),
        visibility var(--alfa-transition),
        transform var(--alfa-transition);
}

.alfa-header__menu li:hover > .sub-menu,
.alfa-header__menu li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;

    transform:
        translate(-50%, 0);
}

.alfa-header__menu .sub-menu a {
    display: flex;
    align-items: center;

    min-height: 44px;

    padding: 8px 13px;

    color: var(--alfa-text);

    border-radius: var(--alfa-radius-sm);

    font-size: 13px;
    font-weight: 500;

    transition:
        color var(--alfa-transition-fast),
        background-color var(--alfa-transition-fast);
}

.alfa-header__menu .sub-menu a:hover {
    color: var(--alfa-green);
    background: var(--alfa-bg-soft);
}


/* =========================================================
   HEADER ACTIONS
   ========================================================= */

.alfa-header__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 6px;
}

.alfa-header__icon-btn {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 44px;
    height: 44px;

    padding: 0;

    background: transparent;
    color: var(--alfa-text-dark);

    border: 0;
    border-radius: var(--alfa-radius-sm);

    cursor: pointer;

    transition:
        color 300ms ease,
        background-color 300ms ease;
}

.alfa-header__icon-btn:hover {
    color: var(--alfa-green);
    background: rgba(0, 60, 50, 0.06);
}

.alfa-header__icon-btn svg {
    width: 24px;
    height: 24px;

    fill: none;

    stroke: currentColor;

    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* =========================================================
   CART COUNT
   ========================================================= */

.alfa-header__cart-count {
    position: absolute;

    top: 0;
    right: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    min-width: 18px;
    height: 18px;

    padding: 0 5px;

    background: var(--alfa-green);
    color: #fff;

    border: 2px solid var(--alfa-bg);

    border-radius: var(--alfa-radius-pill);

    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}


/* En hero quitamos borde crema del contador */

.alfa-header--home:not(.is-scrolled)
.alfa-header__cart-count {
    border-color: transparent;
}


/* =========================================================
   SEARCH
   ========================================================= */

.alfa-header-search {
    position: absolute;

    top: 100%;
    left: 0;

    z-index: 500;

    width: 100%;

    background: var(--alfa-bg-white);

    border-bottom: 1px solid var(--alfa-border-light);

    box-shadow: var(--alfa-shadow-sm);

    opacity: 0;
    visibility: hidden;

    transform: translateY(-10px);

    transition:
        opacity var(--alfa-transition),
        visibility var(--alfa-transition),
        transform var(--alfa-transition);
}

.alfa-header-search.is-open {
    opacity: 1;
    visibility: visible;

    transform: translateY(0);
}

.alfa-header-search .alfa-container {
    padding-top: 24px;
    padding-bottom: 24px;
}

.alfa-header-search form {
    display: flex;

    width: 100%;
    max-width: 900px;

    margin-inline: auto;
}

.alfa-header-search input[type="search"] {
    width: 100%;
    height: 56px;

    padding: 0 20px;

    background: var(--alfa-bg);

    border: 1px solid var(--alfa-border);
    border-radius: var(--alfa-radius-md);

    outline: none;

    font-size: 15px;
    font-weight: 400;
}

.alfa-header-search input[type="search"]:focus {
    border-color: var(--alfa-green);

    box-shadow:
        0 0 0 3px
        rgba(0, 60, 50, 0.08);
}

.alfa-header-search button,
.alfa-header-search input[type="submit"] {
    min-width: 100px;

    margin-left: 10px;

    padding: 0 20px;

    background: var(--alfa-green);
    color: #fff;

    border: 0;
    border-radius: var(--alfa-radius-sm);

    font-weight: 700;

    cursor: pointer;
}


/* =========================================================
   HAMBURGER
   ========================================================= */

.alfa-header__mobile-toggle {
    display: none;

    width: 42px;
    height: 42px;

    padding: 9px;

    background: transparent;

    border: 0;
    border-radius: var(--alfa-radius-sm);

    cursor: pointer;
}

.alfa-header__mobile-toggle span {
    display: block;

    width: 22px;
    height: 1.5px;

    margin: 5px auto;

    background: var(--alfa-green-deep);

    border-radius: 10px;

    transition:
        transform var(--alfa-transition),
        opacity var(--alfa-transition),
        background-color 300ms ease;
}


/* =========================================================
   MOBILE OVERLAY
   ========================================================= */

.alfa-mobile-overlay {
    position: fixed;

    inset: 0;

    z-index: 998;

    display: none;

    background:
        rgba(0, 18, 15, 0.56);

    opacity: 0;
    visibility: hidden;

    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);

    transition:
        opacity 280ms ease,
        visibility 280ms ease;
}

.alfa-mobile-overlay.is-open {
    opacity: 1;
    visibility: visible;
}


/* =========================================================
   MOBILE MENU
   ========================================================= */

.alfa-mobile-menu {
    display: none;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1180px) {

    .alfa-header__inner {
        grid-template-columns:
            210px
            minmax(0, 1fr)
            190px;
    }

    .alfa-header__menu > li {
        margin-inline: 10px;
    }

    .alfa-header__menu > li > a {
        font-size: 12px;
    }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 920px) {

    /*
     * Páginas interiores: header normal.
     * Home: fixed también en móvil.
     */
    .alfa-header {
        z-index: 999;
        width: 100%;
    }

    .alfa-header--sticky {
        position: -webkit-sticky;
        position: sticky;
        top: 0;
        left: auto;
        right: auto;
    }

    .alfa-header--home {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
    }


    /* Home transparente también en móvil */

    .alfa-header--home:not(.is-scrolled) {
        background: transparent;

        border-bottom-color: transparent;

        box-shadow: none;
    }


    /* HEADER */

    .alfa-header__inner {
        position: relative;

        display: flex;
        align-items: center;
        justify-content: space-between;

        min-height: 78px;

        padding-inline:
            14px;
    }


    /* =====================================================
       HAMBURGER LEFT
       ===================================================== */

    .alfa-header__mobile-toggle {
        display: block;

        position: relative;
        z-index: 3;

        flex: 0 0 42px;
    }

    .alfa-header__mobile-toggle:hover {
        background:
            rgba(0, 60, 50, 0.055);
    }

    .alfa-header--home:not(.is-scrolled)
    .alfa-header__mobile-toggle:hover {
        background:
            rgba(255, 255, 255, 0.10);
    }


    /* =====================================================
       CENTER LOGO
       ===================================================== */

    .alfa-header__logo {
        position: absolute;
        top: 50%;
        left: 50%;
        z-index: 1;

        display: flex;
        align-items: center;
        justify-content: center;

        width: auto;
        min-width: 0;

        transform: translate(-50%, -50%);
    }

    .alfa-header__logo-link {
        display: flex;
        align-items: center;
        justify-content: center;

        width: auto;
    }

    .alfa-header__logo-img {
        display: block;
        width: auto;
        height: auto;

        max-width: 155px;
        max-height: 62px;
    }


    /* =====================================================
       DESKTOP NAV OFF
       ===================================================== */

    .alfa-header__nav {
        display: none;
    }


    /* =====================================================
       RIGHT ACTIONS
       ===================================================== */

    .alfa-header__actions {
        position: relative;
        z-index: 3;

        display: flex;
        align-items: center;

        gap: 0;

        margin-left: auto;
    }

    .alfa-header__icon-btn {
        width: 38px;
        height: 40px;
    }

    .alfa-header__icon-btn svg {
        width: 21px;
        height: 21px;

        stroke-width: 1.7;
    }


    /* cuenta visible */

    .alfa-header__account {
        display: inline-flex;
    }


    /* count */

    .alfa-header__cart-count {
        top: 1px;
        right: -1px;

        min-width: 17px;
        height: 17px;

        font-size: 9px;
    }


    /* =====================================================
       OVERLAY
       ===================================================== */

    .alfa-mobile-overlay {
        display: block;
    }


    /* =====================================================
       MENU PANEL
       90% width / full viewport
       ===================================================== */

    .alfa-mobile-menu {
        position: fixed;

        top: 0;
        left: 0;

        z-index: 999;

        display: flex;
        flex-direction: column;

        width: 90vw;
        max-width: 430px;

        height: 100vh;
        height: 100dvh;

        background:
            var(--alfa-bg);

        box-shadow:
            18px 0 55px
            rgba(0, 20, 16, 0.20);

        opacity: 0;
        visibility: hidden;

        transform:
            translateX(-102%);

        transition:
            transform 340ms
                cubic-bezier(.22,.61,.36,1),
            opacity 280ms ease,
            visibility 280ms ease;

        overflow: hidden;
    }

    .alfa-mobile-menu.is-open {
        opacity: 1;
        visibility: visible;

        transform:
            translateX(0);
    }


    /* =====================================================
       MOBILE MENU TOP
       ===================================================== */

    .alfa-mobile-menu__top {
        flex: 0 0 auto;

        display: flex;
        align-items: center;
        justify-content: space-between;

        min-height: 76px;

        padding:
            0
            20px;

        border-bottom:
            1px solid
            var(--alfa-border-light);
    }

    .alfa-mobile-menu__label {
        color: var(--alfa-green-deep);

        font-family:
            var(--alfa-font-display);

        font-size: 22px;
        font-weight: 700;
    }

    .alfa-mobile-menu__close {
        display: inline-flex;
        align-items: center;
        justify-content: center;

        width: 42px;
        height: 42px;

        padding: 0;

        background: transparent;
        color: var(--alfa-green-deep);

        border: 0;
        border-radius: var(--alfa-radius-sm);

        cursor: pointer;
    }

    .alfa-mobile-menu__close:hover {
        background:
            rgba(0, 60, 50, 0.06);
    }

    .alfa-mobile-menu__close svg {
        width: 24px;
        height: 24px;

        fill: none;

        stroke: currentColor;
        stroke-width: 1.5;
        stroke-linecap: round;
    }


    /* =====================================================
       INNER / SCROLL
       ===================================================== */

    .alfa-mobile-menu__inner {
        flex: 1;

        padding:
            15px
            20px
            25px;

        overflow-y: auto;

        overscroll-behavior: contain;
    }


    /* =====================================================
       MENU ITEMS
       ===================================================== */

    .alfa-mobile-menu__list,
    .alfa-mobile-menu__list .sub-menu {
        margin: 0;
        padding: 0;

        list-style: none;
    }

    .alfa-mobile-menu__list > li {
        position: relative;

        border-bottom:
            1px solid
            var(--alfa-border-light);
    }

    .alfa-mobile-menu__list > li > a {
        display: flex;
        align-items: center;

        min-height: 62px;

        padding-right: 52px;

        color:
            var(--alfa-text-dark);

        font-size: 15px;
        font-weight: 600;

        text-transform: uppercase;

        letter-spacing:
            0.025em;
    }

    .alfa-mobile-menu__list >
    .current-menu-item > a,
    .alfa-mobile-menu__list >
    .current-menu-ancestor > a {
        color:
            var(--alfa-green);

        font-weight: 700;
    }


    /* =====================================================
       SUBMENU TRIGGER
       ===================================================== */

    .alfa-mobile-submenu-toggle {
        position: absolute;

        top: 10px;
        right: 0;

        display: inline-flex;
        align-items: center;
        justify-content: center;

        width: 42px;
        height: 42px;

        padding: 0;

        background: transparent;
        color: var(--alfa-green-deep);

        border: 0;

        cursor: pointer;
    }

    .alfa-mobile-submenu-toggle svg {
        width: 19px;
        height: 19px;

        fill: none;

        stroke: currentColor;

        stroke-width: 1.7;
        stroke-linecap: round;
        stroke-linejoin: round;

        transition:
            transform
            var(--alfa-transition);
    }

    .submenu-open >
    .alfa-mobile-submenu-toggle svg {
        transform:
            rotate(180deg);
    }


    /* =====================================================
       SUBMENUS COLLAPSED
       ===================================================== */

    .alfa-mobile-menu__list .sub-menu {
        max-height: 0;

        padding-left: 15px;

        opacity: 0;

        overflow: hidden;

        transition:
            max-height 350ms ease,
            opacity 250ms ease,
            padding-bottom 350ms ease;
    }

    .alfa-mobile-menu__list
    .submenu-open > .sub-menu {
        max-height: 600px;

        padding-bottom: 14px;

        opacity: 1;
    }

    .alfa-mobile-menu__list
    .sub-menu li {
        border: 0;
    }

    .alfa-mobile-menu__list
    .sub-menu a {
        display: flex;
        align-items: center;

        min-height: 42px;

        color:
            var(--alfa-text-soft);

        font-size: 14px;
        font-weight: 500;

        transition:
            color
            var(--alfa-transition-fast);
    }

    .alfa-mobile-menu__list
    .sub-menu a:hover {
        color:
            var(--alfa-green);
    }


    /* =====================================================
       MENU FOOTER
       ===================================================== */

    .alfa-mobile-menu__footer {
        flex: 0 0 auto;

        display: flex;
        align-items: center;

        gap: 20px;

        padding:
            20px;

        background:
            var(--alfa-bg-soft);

        border-top:
            1px solid
            var(--alfa-border-light);
    }

    .alfa-mobile-menu__footer a {
        color:
            var(--alfa-green-deep);

        font-size: 12px;
        font-weight: 600;

        text-transform: uppercase;
    }


    /* =====================================================
       SEARCH MOBILE
       ===================================================== */

    .alfa-header-search {
        position: fixed;

        top: 78px;
        left: 0;

        z-index: 997;
    }

    .alfa-header-search .alfa-container {
        padding:
            18px
            16px;
    }

    .alfa-header-search form {
        gap: 8px;
    }

    .alfa-header-search input[type="search"] {
        height: 50px;

        font-size: 14px;
    }

    .alfa-header-search button,
    .alfa-header-search input[type="submit"] {
        min-width: auto;

        margin-left: 0;

        padding:
            0
            16px;

        font-size: 12px;
    }

}


/* =========================================================
   MOBILE SMALL
   ========================================================= */

@media (max-width: 520px) {

    .alfa-header__inner {
        min-height: 74px;

        padding-inline:
            10px;
    }

    .alfa-header__logo-img {
        max-width: 135px;
        max-height: 56px;
    }

    .alfa-header__icon-btn {
        width: 34px;
    }

    .alfa-header__icon-btn svg {
        width: 20px;
        height: 20px;
    }

    .alfa-header__mobile-toggle {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    .alfa-header__mobile-toggle span {
        width: 21px;
    }

    .alfa-mobile-menu {
        width: 90vw;
    }

}


/* =========================================================
   BODY LOCK
   ========================================================= */

body.alfa-menu-open {
    overflow: hidden;

    touch-action: none;
}