/* NOXORA — módulo web: carrusel narrativo + CTA */

/* ═══════════════════════════════════════════════════════════════
   Carrusel narrativo 3D (solo /desarrollo-web). Tokens DS.
   Desktop: texto superpuesto con scrim. Móvil: apilado, ratio intacto.
   ═══════════════════════════════════════════════════════════════ */
.web-story { margin: 0 0 2rem; }
.web-story-frame {
    background: var(--nx-surface);
    border: 1px solid var(--nx-border);
    border-radius: var(--nx-radius);
    box-shadow: var(--nx-shadow), 0 0 44px var(--nx-tint-p35);
    overflow: hidden;
}
.web-story-viewport {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #080710;
}
.web-story-track { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; }
.web-story-slide {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateX(48px);
    transition: opacity 0.6s ease, transform 0.6s ease, visibility 0s linear 0.6s;
}
.web-story-slide.is-active {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.6s ease, transform 0.6s ease;
    z-index: 1;
}
.web-story-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.web-story-caption {
    position: absolute;
    left: 0;
    bottom: 0;
    max-width: 46%;
    padding: 2rem;
    background: linear-gradient(90deg, rgba(8, 7, 16, 0.88) 0%, rgba(8, 7, 16, 0.55) 65%, transparent 100%);
    color: #F5F3FA;
}
.web-story-chapter {
    margin: 0 0 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--nx-accent-bright);
}
.web-story-title {
    margin: 0 0 0.5rem;
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: #fff;
}
.web-story-desc { margin: 0; font-size: 0.95rem; line-height: 1.6; color: #CFC9E0; }
.web-story-ui {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.9rem 1.2rem;
    border-top: 1px solid var(--nx-border);
}
.web-story-nav,
.web-story-play {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--nx-border-strong);
    background: transparent;
    color: var(--nx-text-muted);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, transform 0.2s;
    flex-shrink: 0;
}
.web-story-nav:hover,
.web-story-play:hover { color: var(--nx-primary); border-color: var(--nx-primary); transform: translateY(-1px); }
.web-story-play svg[hidden] { display: none !important; }
.web-story-play.is-on {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--nx-primary), var(--nx-primary-deep));
    box-shadow: 0 6px 22px var(--nx-tint-p35);
}
.web-story-play.is-on:hover { color: #fff; border-color: transparent; filter: brightness(1.07); }
.web-story-auto {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--nx-text-faint);
    white-space: nowrap;
}
.web-story-play.is-on + .web-story-auto { color: var(--nx-primary); }
.web-story-dots { display: flex; align-items: center; gap: 0.5rem; }
.web-story-dots button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
}
.web-story-dots button span {
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--nx-text-faint);
    transition: all 0.25s ease;
}
.web-story-dots button[aria-selected="true"] span {
    width: 26px;
    border-radius: 999px;
    background: var(--nx-primary);
    box-shadow: 0 0 10px var(--nx-primary-glow);
}
.web-story-counter {
    margin-left: auto;
    font-family: var(--nx-font-mono);
    font-size: 0.85rem;
    color: var(--nx-text-faint);
    letter-spacing: 0.08em;
}
.web-story-counter strong { color: var(--nx-text); }
.web-story-play { margin-left: 0; }
.web-story-ui .web-story-counter + .web-story-play { margin-left: -0.3rem; }
/* Agrupador autoplay: transparente en escritorio, fila propia en móvil */
.web-story-autoplay { display: contents; }

/* ── Móvil: imagen intacta arriba, texto debajo ── */
@media (max-width: 768px) {
    .web-story-viewport { aspect-ratio: auto; }
    .web-story-track { position: static; }
    .web-story-slide { position: static; transform: none; }
    .web-story-slide:not(.is-active) { display: none; }
    .web-story-img { height: auto; aspect-ratio: 16 / 9; }
    .web-story-caption {
        position: static;
        max-width: none;
        padding: 1.2rem 1.2rem 1.4rem;
        background: transparent;
        color: var(--nx-text);
    }
    .web-story-desc { color: var(--nx-text-muted); }
}

/* ── Controles en móvil: dos filas equilibradas ── */
@media (max-width: 640px) {
    .web-story-ui {
        display: grid;
        grid-template-columns: 40px minmax(0, 1fr) auto 40px;
        grid-template-areas:
            "prev dots counter next"
            ". autoplay autoplay .";
        align-items: center;
        column-gap: 8px;
        row-gap: 14px;
        padding: 14px 12px 16px;
    }
    #webStoryPrev { grid-area: prev; }
    .web-story-dots {
        grid-area: dots;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        min-width: 0;
    }
    .web-story-dots button {
        flex: 1;
        min-width: 0;
        max-width: 25px;
        padding: 8px 0;
    }
    .web-story-counter {
        grid-area: counter;
        white-space: nowrap;
        font-size: 13px;
    }
    #webStoryNext { grid-area: next; }
    .web-story-autoplay {
        grid-area: autoplay;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
    }
    .web-story-nav,
    .web-story-play {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }
    .web-story-auto {
        font-size: 11px;
        letter-spacing: 1px;
        white-space: nowrap;
    }
}

@media (max-width: 360px) {
    .web-story-ui {
        column-gap: 5px;
        padding-inline: 9px;
    }
    .web-story-dots { gap: 3px; }
    .web-story-counter { font-size: 12px; }
}

/* ── Tema claro: marco adaptado, scrim intacto sobre imagen oscura ── */
html[data-theme="light"] .web-story-frame { box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12); }

/* Aire superior del encabezado + separación con el carrusel.
   Alcance: solo /desarrollo-web (no toca el ritmo global). */
.sale-section .sale-head { padding-top: clamp(28px, 3vw, 40px); }
.sale-section .sale-sub { margin-bottom: 30px; }
@media (max-width: 640px) {
    .sale-section .sale-head { padding-top: 24px; }
    .sale-section .sale-sub { margin-bottom: 24px; }
}

/* ── Movimiento reducido ── */
@media (prefers-reduced-motion: reduce) {
    .web-story-slide { transition: none; transform: none; }
    .web-story-nav, .web-story-play, .web-story-dots button span { transition: none; }
}
