/* Encabezado basado en la referencia móvil de 390 px:
   marca 85 px, navegación 27 px, promociones 27 px.
   El hero de referencia mide 710 x 715 px, prácticamente cuadrado. */
header.header-main[data-header-layout="classic"] {
    width: 100%;
    max-width: 1300px;
    height: 130px;
    padding: 0 18px;
    margin-left: auto;
    margin-right: auto;
    gap: 0;
    grid-template-columns: minmax(62px, 1fr) auto minmax(62px, 1fr);
    border: 0;
    background: #fff;
    color: #111;
}

header.header-main[data-header-layout="classic"] .header-zone {
    margin: 0;
    gap: 10px;
}

header.header-main[data-header-layout="classic"] .logo {
    font-size: 36px;
    line-height: 1;
    letter-spacing: -1.5px;
}

/* Logo gráfico de Pura Fragancia en el centro del header. */
header.header-main[data-header-layout="classic"] .logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    max-width: 100%;
    line-height: 0;
}

header.header-main[data-header-layout="classic"] .header-brand-logo {
    display: block;
    width: clamp(280px, 31vw, 390px);
    height: auto;
    max-height: 86px;
    object-fit: contain;
    filter: contrast(1.06) saturate(1.02);
}

.header-main .header-action {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    flex: 0 0 auto;
    width: auto;
    min-width: 36px;
    height: 44px;
    padding: 0;
    gap: 7px;
    white-space: nowrap;
    color: #111;
    border-radius: 0;
}

.header-main .header-action-label {
    display: inline-block;
    font-size: 12px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: .01em;
    white-space: nowrap;
}


@media (min-width: 901px) {
    .header-main .account-action,
    .header-main #openSearch {
        width: auto;
        min-width: 0;
    }

    .header-main .account-action {
        padding-right: 4px;
    }

    .header-main #openSearch {
        padding-left: 4px;
    }
}

.header-main .header-line-icon {
    display: block;
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.25;
    stroke-linecap: round;
    stroke-linejoin: round;
    transform: none;
}

.header-main .cart-count {
    top: 5px;
    right: 0;
    min-width: 13px;
    height: 13px;
    padding: 0 3px;
    background: #111;
    font: 700 8px/1 Arial, sans-serif;
}

.header-main .cart-count[hidden] {
    display: none !important;
}

/* Si el carrito muestra descripción, el contador sigue anclado al ícono y no al final del texto. */
.header-main .cart-action.header-label-visible .cart-count {
    right: auto;
    left: 15px;
}

.main-nav.storefront-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: center;
    width: 100%;
    max-width: none;
    height: 36px;
    padding: 0;
    gap: 0;
    margin: 0;
    background: #efefef;
    border: 0;
    border-bottom: 1px solid #e0e0e0;
    color: #111;
}

.storefront-nav > a,
.storefront-nav .desktop-products-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-width: 0;
    padding: 0 4px;
    font: 400 14px/1 Arial, Helvetica, sans-serif;
    letter-spacing: .15px;
    white-space: nowrap;
}

.storefront-nav .nav-new {
    font-weight: 700;
}

.storefront-nav .nav-sale {
    color: #8d171b;
}

.storefront-nav .desktop-products-menu {
    height: 100%;
    min-width: 0;
}

.storefront-nav .desktop-products-submenu {
    top: 100%;
    min-width: 220px;
    max-width: calc(100vw - 24px);
    text-align: left;
}

.top-red-bar {
    height: 36px;
    padding: 0;
    background: var(--promo-bar-color, #fff);
    color: var(--promo-bar-foreground, #111);
    font: 400 14px/36px Arial, Helvetica, sans-serif;
    letter-spacing: .15px;
    text-align: left;
}

.top-red-bar .top-red-track {
    animation-duration: 55s;
}

.top-red-bar .top-red-text {
    padding-right: 60px;
    font-family: Arial, Helvetica, sans-serif;
}

.hero-banner {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #e9e9e9;
}

.hero-banner picture {
    position: absolute;
    inset: 0;
}

.hero-banner picture,
.hero-banner img {
    display: block;
    width: 100%;
    height: 100%;
}

.hero-banner img {
    object-fit: cover;
    object-position: center;
}

.header-main .header-action:focus-visible,
.storefront-nav a:focus-visible,
.storefront-nav button:focus-visible {
    outline: 2px solid #111;
    outline-offset: -2px;
}

@media (max-width: 900px) {
    header.header-main[data-header-layout="classic"],
    header.header-main[data-header-layout="classic"].header-is-fixed {
        height: clamp(72px, 21.69vw, 104px);
        /* Pequeño colchón lateral en mobile para que los SVG extremos
           no rocen el borde de la pantalla. */
        padding: 0 10px;
        grid-template-columns: minmax(58px, 1fr) auto minmax(58px, 1fr);
    }

    header.header-main[data-header-layout="classic"] .header-zone {
        gap: 0;
    }

    header.header-main[data-header-layout="classic"] .logo {
        font-size: clamp(17px, 5.13vw, 24px);
        letter-spacing: -1px;
    }

    header.header-main[data-header-layout="classic"] .header-brand-logo {
        width: clamp(220px, 64vw, 290px);
        max-height: 62px;
    }

    .header-main .header-action {
        width: 24px;
        min-width: 24px;
        height: 44px;
        padding: 0;
    }

    .header-main .header-action-label {
        display: none !important;
    }

    .header-main .header-line-icon {
        width: 18px;
        height: 18px;
    }

    .header-main .cart-count {
        top: 8px;
        right: 0;
        min-width: 10px;
        height: 10px;
        padding: 0 2px;
        font-size: 7px;
    }

    .main-nav.storefront-nav {
        display: grid;
        height: 27px;
    }

    .storefront-nav > a,
    .storefront-nav .desktop-products-toggle {
        font-size: 10.5px;
    }

    .top-red-bar {
        height: 27px;
        padding: 0;
        font-size: 10.5px;
        line-height: 27px;
    }

    .hero-banner {
        aspect-ratio: 710 / 715;
    }
}

@media (prefers-reduced-motion: reduce) {
    .top-red-bar .top-red-track {
        animation: none;
    }
}

/* ==========================================================
   Encabezado configurable: protección de tamaño del logo.
   El PNG de marca es de alta resolución; fuera del modo clásico
   también debe quedar acotado para no desbordar el grid.
   ========================================================== */
header.header-main .header-zone {
    min-width: 0;
}

header.header-main .logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    max-width: 100%;
    line-height: 0;
}

header.header-main .header-brand-logo {
    display: block;
    width: min(100%, clamp(220px, 30vw, 360px));
    height: auto;
    max-width: 100%;
    max-height: 78px;
    object-fit: contain;
}

/* El modo compacto conserva la misma estructura horizontal del header.
   Puede reducir espacios y acciones, pero NO cambia el tamaño del logo. */
header.header-main[data-header-layout="compact"] {
    width: 100%;
    max-width: 1300px;
    min-height: 70px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 18px;
    padding-right: 18px;
}

/* En escritorio, clásico y compacto comparten exactamente el mismo eje
   horizontal para las acciones. Compacto modifica altura y gaps, no el logo. */
@media (min-width: 901px) {
    header.header-main[data-header-layout="classic"].header-is-fixed,
    header.header-main[data-header-layout="compact"].header-is-fixed {
        width: auto;
        max-width: none;
        margin: 0;
        padding-left: max(18px, calc((100% - 1300px) / 2 + 18px));
        padding-right: max(18px, calc((100% - 1300px) / 2 + 18px));
    }
}

header.header-main[data-header-layout="compact"] .logo {
    font-size: 36px;
    line-height: 1;
    letter-spacing: -1.5px;
}

header.header-main[data-header-layout="compact"] .header-brand-logo {
    width: clamp(280px, 31vw, 390px);
    max-height: 86px;
}

/* En el diseño centrado el centro puede ocupar una fila completa.
   Se acota igualmente la imagen para que nunca use su tamaño nativo. */
header.header-main[data-header-layout="centered"] .header-brand-logo {
    width: min(100%, clamp(230px, 30vw, 350px));
    max-height: 72px;
}

@media (max-width: 900px) {
    header.header-main .header-brand-logo {
        width: min(100%, clamp(155px, 52vw, 240px));
        max-height: 58px;
    }

    header.header-main[data-header-layout="compact"],
    header.header-main[data-header-layout="compact"].header-is-fixed {
        min-height: 58px;
        padding: 7px 10px;
        gap: 6px;
    }

    header.header-main[data-header-layout="compact"] .logo {
        font-size: clamp(17px, 5.13vw, 24px);
        letter-spacing: -1px;
    }

    header.header-main[data-header-layout="compact"] .header-brand-logo {
        width: clamp(220px, 64vw, 290px);
        max-height: 62px;
    }

    header.header-main[data-header-layout="compact"] .header-zone {
        gap: 6px;
    }

    header.header-main[data-header-layout="compact"] .header-action {
        width: 24px;
        min-width: 24px;
        height: 38px;
        padding: 0;
    }

    header.header-main[data-header-layout="centered"] .header-brand-logo {
        width: min(100%, clamp(175px, 56vw, 250px));
        max-height: 58px;
    }
}

@media (max-width: 380px) {
    /* El logo mantiene el mismo tamaño que en clásico también en pantallas angostas. */
}
