/* ==========================================================================
   Fenix Home — carrusel de estados (v10.18.0)

   Piezas 9:16 (1080 × 1920) debajo del hero. Usa los tokens --h-* de home.css,
   así que hereda el modo oscuro/claro sin reglas propias. El velo es negro en
   los dos modos a propósito: es un filtro sobre la imagen, no una superficie.
   Solo animan transform y opacity.
   ========================================================================== */

.fx-est {
    --est-n: 2;
    --est-gap: 12px;
    --est-flecha: 48px;
    padding-top: clamp(24px, 3vw, 40px);
}
@media (min-width: 600px)  { .fx-est { --est-n: 3; --est-gap: 16px; } }
@media (min-width: 1024px) { .fx-est { --est-n: 4; --est-gap: 20px; --est-flecha: 64px; } }
@media (min-width: 1400px) { .fx-est { --est-n: 5; } }

.fx-est__cab {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: clamp(16px, 2vw, 24px);
}
.fx-est__h2 { margin: 0; }

.fx-est__pausa {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    padding: 8px 14px;
    border: 1px solid var(--h-bor2);
    border-radius: 999px;
    background: transparent;
    color: var(--h-mut);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}
.fx-est__pausa[hidden] { display: none; }
.fx-est__pausa:hover { color: var(--h-txt); border-color: var(--h-txt); }
.fx-est__pausa:focus-visible { outline: 3px solid var(--h-acc); outline-offset: 3px; }
.fx-est__pausa-ico--play { display: none; }
.fx-est.is-pausado .fx-est__pausa-ico--play { display: block; }
.fx-est.is-pausado .fx-est__pausa-ico--pausa { display: none; }
.fx-est__oculto {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.fx-est__marco { position: relative; }

.fx-est__ventana {
    overflow: hidden;
    overflow: clip; /* el foco en una pieza oculta no puede desplazar la ventana */
    border-radius: 20px;
    touch-action: pan-y;
}

.fx-est__pista {
    display: flex;
    gap: var(--est-gap);
    margin: 0;
    padding: 0;
    list-style: none;
}
.fx-est__pista.is-moviendo { transition: transform .6s var(--h-ease); will-change: transform; }

.fx-est__pieza {
    flex: 0 0 calc((100% - (var(--est-n) - 1) * var(--est-gap)) / var(--est-n));
    min-width: 0;
}

.fx-est__fig {
    position: relative;
    margin: 0;
    aspect-ratio: 9 / 16;
    overflow: hidden;
    border-radius: 18px;
    background: var(--h-sup2);
    box-shadow: var(--h-sombra);
    isolation: isolate;
}

.fx-est__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .7s var(--h-ease);
}

/* Velo negro + botón: aparece con el cursor o con el foco del teclado. */
.fx-est__velo {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(0, 0, 0, .62);
    opacity: 0;
    transition: opacity .35s var(--h-ease);
}

.fx-est__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    padding: 13px 22px;
    border-radius: 999px;
    background: var(--h-rojo);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 10px 30px -8px rgba(227, 25, 55, .7);
    transform: translateY(10px);
    transition: transform .4s var(--h-ease), background-color .2s ease;
}
.fx-est__btn:hover { background: var(--h-rojo-h); color: #fff; }
.fx-est__btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.fx-est__btn span { transition: transform .3s var(--h-ease); }
.fx-est__btn:hover span { transform: translateX(3px); }

@media (hover: hover) {
    .fx-est__fig:hover .fx-est__img { transform: scale(1.04); }
    .fx-est__fig:hover .fx-est__velo { opacity: 1; }
    .fx-est__fig:hover .fx-est__btn { transform: none; }
}
.fx-est__fig:focus-within .fx-est__velo { opacity: 1; }
.fx-est__fig:focus-within .fx-est__btn { transform: none; }

/* Táctil: no hay hover, el botón queda siempre a la vista sobre un degradado. */
@media (hover: none) {
    .fx-est__velo {
        place-items: end center;
        padding-bottom: 14px;
        background: linear-gradient(to top, rgba(0, 0, 0, .62), rgba(0, 0, 0, 0) 38%);
        opacity: 1;
    }
    .fx-est__btn { padding: 10px 16px; font-size: 13px; transform: none; }
}

/* Flechas grandes sobre los bordes, invitan a pasar. */
.fx-est__flecha {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: grid;
    place-items: center;
    width: var(--est-flecha);
    height: var(--est-flecha);
    padding: 0;
    border: 1px solid var(--h-bor2);
    border-radius: 50%;
    background: var(--h-vidrio);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    backdrop-filter: blur(14px) saturate(1.2);
    color: var(--h-txt);
    box-shadow: var(--h-elev);
    cursor: pointer;
    transform: translateY(-50%);
    transition: transform .25s var(--h-ease), background-color .2s ease, color .2s ease, border-color .2s ease;
}
.fx-est__flecha--ant { left: 8px; }
.fx-est__flecha--sig { right: 8px; }
.fx-est__flecha:hover {
    background: var(--h-rojo);
    border-color: var(--h-rojo);
    color: #fff;
    transform: translateY(-50%) scale(1.08);
}
.fx-est__flecha:active { transform: translateY(-50%) scale(.96); }
.fx-est__flecha:focus-visible { outline: 3px solid var(--h-acc); outline-offset: 3px; }
.fx-est__flecha svg { width: 45%; height: 45%; }
.fx-est__flecha--ant:hover svg { transform: translateX(-2px); }
.fx-est__flecha--sig:hover svg { transform: translateX(2px); }
.fx-est__flecha svg { transition: transform .25s var(--h-ease); }

@media (min-width: 1024px) {
    .fx-est__flecha--ant { left: calc(var(--est-flecha) / -2); }
    .fx-est__flecha--sig { right: calc(var(--est-flecha) / -2); }
}

/* Con todas las piezas a la vista no hay a dónde pasar. */
.fx-est.is-quieto .fx-est__flecha,
.fx-est.is-quieto .fx-est__pausa { display: none; }

@media (prefers-reduced-motion: reduce) {
    .fx-est__pista.is-moviendo,
    .fx-est__img,
    .fx-est__velo,
    .fx-est__btn,
    .fx-est__btn span,
    .fx-est__flecha,
    .fx-est__flecha svg { transition: none; }
    .fx-est__fig:hover .fx-est__img { transform: none; }
}
