

body.storefront-layout {
    margin: 0;
    min-height: 100vh;
}

.storefront-root {
    min-height: 100vh;
}

.storefront-header {
    position: relative;
    z-index: 1030;
}

.storefront-header .storefront-navbar {
    position: relative;
}

/* Hero editorial: altura fija → sin CLS, object-fit: cover → imagen íntegra */
.storefront-hero {
    width: 100%;
    margin: 0;
    padding: 0;
    height: var(--hero-height);
    overflow: hidden;
    touch-action: pan-y;
    position: relative;
    isolation: isolate;
    background: var(--color-storefront-bg);
}

@supports (height: 100dvh) {
    .storefront-hero {
        height: max(var(--hero-min-height), calc(100dvh - var(--storefront-header-h)));
    }
}

.storefront-hero-img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center top; /* fallback; sobreescrito por .hero-focus-* */
    transition: opacity 0.45s ease-in-out;
}

.storefront-hero-img[hidden] {
    display: none;
}

.storefront-hero-img.is-fading {
    opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
    .storefront-hero-img,
    .storefront-hero-content {
        transition: none;
    }
}

/* Puntos focales del hero — activados via HeroSlide.hero_focal_class */
.hero-focus-top    { object-position: center top; }
.hero-focus-center { object-position: center center; }
.hero-focus-bottom { object-position: center bottom; }

/* Oscurece la izquierda para legibilidad del texto */
.storefront-hero-scrim {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(
        90deg,
        rgba(var(--color-hero-scrim-rgb), 0.42) 0%,
        rgba(var(--color-hero-scrim-rgb), 0.22) 38%,
        rgba(var(--color-hero-scrim-rgb), 0.04) 62%,
        rgba(var(--color-hero-scrim-rgb), 0) 100%
    );
}

/* Contenido alineado al mismo contenedor que .storefront-main-inner (1440px) */
.storefront-hero-overlay {
    --hero-gutter: clamp(0.875rem, 2.5vw, 1.75rem);
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding-inline: max(var(--hero-gutter), calc((100% - 1440px) / 2 + var(--hero-gutter)));
    padding-bottom: clamp(3.5rem, 9vh, 6rem);
    pointer-events: none;
}

.storefront-hero-content {
    max-width: min(32rem, 100%);
    text-shadow: 0 1px 12px rgba(var(--color-hero-scrim-rgb), 0.35);
    color: var(--text-inverse);
    pointer-events: auto;
    transition: opacity 0.45s ease-in-out;
}

.storefront-hero-content.is-fading {
    opacity: 0;
}

.storefront-hero-title {
    margin: 0 0 var(--space-2);
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--text-inverse);
    text-wrap: balance;
}

.storefront-hero-subtitle {
    margin: 0 0 var(--space-4);
    max-width: 28rem;
    font-size: clamp(0.875rem, 1.3vw, 1rem);
    font-weight: 400;
    line-height: 1.55;
    color: rgba(var(--color-white-rgb), 0.92);
}

.storefront-hero-subtitle.is-empty {
    display: none;
}

.storefront-hero-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 2.25rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius-md);
    background: var(--color-storefront-accent);
    color: var(--color-storefront-bg);
    text-shadow: none;
    font-size: var(--font-size-sm);
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.storefront-hero-cta:hover,
.storefront-hero-cta:focus-visible {
    background: var(--color-storefront-accent-hover);
    color: var(--color-storefront-bg);
    text-decoration: none;
}

.storefront-hero-cta[aria-disabled="true"] {
    cursor: default;
}

.storefront-hero-cta i {
    font-size: 0.9rem;
    line-height: 1;
}

/* Controles de slides: discretos, centrados bajo el contenido */
.storefront-hero-controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: var(--space-4);
    z-index: 3;
    display: flex;
    justify-content: center;
    gap: var(--space-1);
    pointer-events: none;
}

.storefront-hero-dot {
    position: relative;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    pointer-events: auto;
}

.storefront-hero-dot::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: var(--radius-pill);
    background: rgba(var(--color-white-rgb), 0.5);
    transform: translate(-50%, -50%);
    transition: width var(--transition-base), background-color var(--transition-base);
}

.storefront-hero-dot:hover::before {
    background: rgba(var(--color-white-rgb), 0.85);
}

.storefront-hero-dot[aria-current="true"]::before {
    width: 1.25rem;
    background: var(--text-inverse);
}

.storefront-hero-dot:focus-visible {
    outline: 2px solid var(--text-inverse);
    outline-offset: -2px;
    border-radius: var(--radius-sm);
}

@media (max-width: 575.98px) {
    .storefront-hero-overlay {
        align-items: flex-end;
        padding-bottom: 3.25rem;
    }

    .storefront-hero-scrim {
        background: linear-gradient(
            180deg,
            rgba(var(--color-hero-scrim-rgb), 0.05) 0%,
            rgba(var(--color-hero-scrim-rgb), 0.3) 55%,
            rgba(var(--color-hero-scrim-rgb), 0.55) 100%
        );
    }
}

.storefront-main {
    flex: 1 1 auto;
}

/* Contenido centrado con márgenes laterales moderados */
.storefront-main-inner {
    max-width: 1440px;
    margin-left: auto;
    margin-right: auto;
    padding-left: clamp(0.875rem, 2.5vw, 1.75rem);
    padding-right: clamp(0.875rem, 2.5vw, 1.75rem);
}

/* Cabecera de categoría (SSR): reemplazo visual del hero en vista por categoría */
.category-header {
    margin-bottom: var(--space-4);
}

.category-header__row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.category-header__text {
    min-width: 0;
    flex: 1 1 auto;
}

.category-header__meta {
    margin-bottom: 0;
}

.category-header__actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
    margin-left: auto;
}

/* Mejora progresiva: ocultar hero en categoría o búsqueda */
body.category-active .storefront-hero,
body.search-active .storefront-hero,
.storefront-hero[hidden] {
    display: none !important;
}

.storefront-sponsors {
    margin-top: auto;
    width: 100%;
    background: var(--color-surface);
    border-top: 1px solid var(--border-default);
    border-bottom: 1px solid var(--border-default);
}

.storefront-sponsors__track {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: clamp(1.5rem, 4vw, 3.25rem);
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: clamp(1.25rem, 3vw, 2rem) clamp(0.875rem, 2.5vw, 1.75rem);
}

.storefront-sponsors__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 1 auto;
    min-width: 0;
    text-decoration: none;
    opacity: 0.9;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

a.storefront-sponsors__item:hover,
a.storefront-sponsors__item:focus-visible {
    opacity: 1;
    transform: translateY(-1px);
}

.storefront-sponsors__logo {
    display: block;
    width: auto;
    height: clamp(1.75rem, 3.2vw, 2.5rem);
    max-width: 9rem;
    object-fit: contain;
}

.storefront-footer {
    margin-top: auto;
}

.storefront-sponsors + .storefront-footer {
    margin-top: 0;
    border-top: none;
}

/* Load more productos (storefront) */
.product-card.is-load-more-hidden {
    display: none !important;
}

.storefront-load-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: var(--space-8);
    margin-bottom: var(--space-2);
}

.storefront-load-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0.7rem 1.75rem;
    border: none;
    border-radius: var(--radius-lg);
    background: var(--color-surface-elevated);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast), opacity var(--transition-fast);
}

.storefront-load-more-btn:hover:not(:disabled),
.storefront-load-more-btn:focus-visible:not(:disabled) {
    background: var(--border-default);
    color: var(--text-primary);
}

.storefront-load-more-btn:disabled,
.storefront-load-more-btn.is-loading {
    opacity: 0.65;
    cursor: wait;
}

/* Sidebar filtros: sin navbar fija, sticky respecto al viewport */
body.storefront-layout #filtersSidebar {
    top: 1rem;
}
