/* ================================================================
   VIDEOS DEL PRODUCTO
   Showcase en carrusel + reproductor propio en lightbox. Usa los
   mismos tokens `--st-*` que el resto de la tienda para que el
   color de marca del cliente mande también acá.
   ================================================================ */
.st-product-videos {
    margin-top: 56px;
    padding-top: 40px;
    border-top: 1px solid var(--st-border);
    --st-video-card-height: clamp(240px, 26vw, 340px);
}

.st-product-videos.is-single {
    --st-video-card-height: clamp(260px, 34vw, 440px);
}

.st-product-videos__head {
    margin-bottom: 20px;
}

.st-product-videos-carousel .st-scroll-carousel-track {
    --st-scroll-carousel-gap: 20px;
    padding-bottom: 4px;
}

/* ----- Card ----------------------------------------------------
   Todas las portadas comparten la altura de la fila y el ancho sale de la
   proporción real del video (`--st-video-ratio`), así los verticales se ven
   completos al lado de los horizontales sin recortes ni bandas. */
body.theme-store .st-video-card {
    display: flex;
    flex: 0 0 auto;
    width: auto;
    max-width: 100%;
    flex-direction: column;
    align-items: stretch;
    /* Si una card queda más baja (video muy ancho en pantalla chica) se centra
       en la fila en vez de dejar el hueco abajo. */
    justify-content: center;
    padding: 0;
    border: 0;
    background: none;
    color: var(--st-fg);
    text-align: left;
    cursor: pointer;
    scroll-snap-align: start;
}

body.theme-store .st-video-card:hover {
    background: none;
    color: var(--st-fg);
}

/* El ancho manda y el alto sale de la proporción: si la card no entra en
   pantalla, baja de alto en vez de recortar el video. */
.st-video-card__media {
    position: relative;
    display: block;
    width: min(100%, calc(var(--st-video-card-height) * var(--st-video-ratio-num, 1.7778)));
    aspect-ratio: var(--st-video-ratio, 16 / 9);
    border-radius: var(--st-radius-lg);
    border: 1px solid var(--st-border);
    background: var(--st-bg-alt);
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.st-video-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s ease, filter 0.25s ease;
}

.st-video-card:hover .st-video-card__media,
.st-video-card:focus-visible .st-video-card__media {
    border-color: var(--st-border-strong);
    box-shadow: var(--st-shadow-strong);
    transform: translateY(-2px);
}

.st-video-card:hover .st-video-card__media img {
    transform: scale(1.04);
}

body.theme-store .st-video-card:focus-visible {
    outline: none;
}

body.theme-store .st-video-card:focus-visible .st-video-card__media {
    outline: 2px solid var(--st-accent);
    outline-offset: 3px;
}

.st-video-card__fallback {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background:
        radial-gradient(120% 120% at 20% 0%, rgba(var(--st-accent-rgb), 0.22), transparent 62%),
        var(--st-bg-alt);
    color: var(--st-fg-soft);
    font-size: 34px;
}

/* El velo aparece sólo al pasar el mouse: la portada tiene que verse
   nítida cuando la card está en reposo. */
.st-video-card__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(9, 12, 18, 0.05) 0%, rgba(9, 12, 18, 0.42) 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.st-video-card:hover .st-video-card__media::after,
.st-video-card:focus-visible .st-video-card__media::after {
    opacity: 1;
}

.st-video-card__play {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: var(--st-radius-pill);
    background: var(--st-accent-bg);
    color: var(--st-accent-fg);
    font-size: 26px;
    line-height: 1;
    transform: translate(-50%, -50%);
    box-shadow: 0 10px 26px rgba(9, 12, 18, 0.3);
    transition: transform 0.22s ease, opacity 0.22s ease;
}

.st-video-card__play > i {
    margin-left: 2px;
}

.st-video-card:hover .st-video-card__play,
.st-video-card:focus-visible .st-video-card__play {
    transform: translate(-50%, -50%) scale(1.08);
}

.st-video-card__source,
.st-video-card__duration {
    position: absolute;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    border-radius: var(--st-radius-pill);
    background: rgba(9, 12, 18, 0.72);
    color: #fff;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.2;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.st-video-card__source {
    top: 10px;
    left: 10px;
    font-size: 14px;
    padding: 4px 8px;
}

.st-video-card__duration {
    right: 10px;
    bottom: 10px;
}

/* ================================================================
   LIGHTBOX
   ================================================================ */
.st-video-modal {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: grid;
    place-items: center;
    padding: 24px;
    opacity: 0;
    transition: opacity 0.22s ease;
}

.st-video-modal[hidden] {
    display: none;
}

.st-video-modal.is-open {
    opacity: 1;
}

/* Los selectores llevan `body.theme-store` porque el botón base de la tienda
   pinta todos los <button> con el color de marca. */
body.theme-store .st-video-modal__veil {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(6, 8, 12, 0.86);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 0;
    border-radius: 0;
    padding: 0;
    cursor: pointer;
}

body.theme-store .st-video-modal__veil:hover {
    background: rgba(6, 8, 12, 0.9);
}

.st-video-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 1080px);
    display: grid;
    transform: translateY(14px) scale(0.985);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.st-video-modal.is-open .st-video-modal__dialog {
    transform: none;
}

.st-video-modal__dialog:focus {
    outline: none;
}

body.theme-store .st-video-modal__close {
    position: absolute;
    top: -52px;
    right: 0;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--st-radius-pill);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 18px;
}

body.theme-store .st-video-modal__close:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.st-video-modal__stage {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--st-radius-lg);
    background: #000;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

/* Los videos filmados con el celular son verticales: el escenario toma la
   proporción real del archivo para no dejar bandas negras a los costados. */
.st-video-modal__stage.is-portrait {
    width: auto;
    height: min(66vh, 560px);
    margin-inline: auto;
}

.st-video-modal__stage iframe,
.st-video-modal__stage video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #000;
}

.st-video-modal__stage video {
    object-fit: contain;
}

.st-video-modal__spinner {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, 0.8);
    pointer-events: none;
}

.st-video-modal__spinner::after {
    content: "";
    width: 34px;
    height: 34px;
    border-radius: var(--st-radius-pill);
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    animation: st-video-spin 0.8s linear infinite;
}

.st-video-modal__spinner[hidden] {
    display: none;
}

@keyframes st-video-spin {
    to { transform: rotate(360deg); }
}

/* ----- Reproductor propio -------------------------------------- */
.st-video-player {
    position: absolute;
    inset: 0;
}

.st-video-player__poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.7);
    transition: opacity 0.2s ease;
}

.st-video-player.is-started .st-video-player__poster {
    opacity: 0;
    pointer-events: none;
}

body.theme-store .st-video-player__big-play {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 74px;
    height: 74px;
    padding: 0;
    border-radius: var(--st-radius-pill);
    background: var(--st-accent-bg);
    color: var(--st-accent-fg);
    font-size: 32px;
    transform: translate(-50%, -50%);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.42);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

body.theme-store .st-video-player__big-play:hover {
    background: var(--st-accent-bg);
    color: var(--st-accent-fg);
    transform: translate(-50%, -50%) scale(1.07);
}

body.theme-store .st-video-player__big-play > i {
    margin-left: 3px;
}

body.theme-store .st-video-player.is-playing .st-video-player__big-play {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.9);
}

.st-video-player__controls {
    position: absolute;
    inset: auto 0 0 0;
    z-index: 4;
    display: grid;
    gap: 8px;
    padding: 46px 16px 14px;
    background: linear-gradient(180deg, transparent, rgba(4, 6, 10, 0.55) 42%, rgba(4, 6, 10, 0.9));
    opacity: 1;
    transition: opacity 0.25s ease;
}

.st-video-player.is-playing.is-idle .st-video-player__controls {
    opacity: 0;
    pointer-events: none;
}

.st-video-player__scrub {
    position: relative;
    height: 16px;
    display: flex;
    align-items: center;
    cursor: pointer;
    touch-action: none;
}

.st-video-player__scrub-track {
    position: relative;
    width: 100%;
    height: 4px;
    border-radius: var(--st-radius-pill);
    background: rgba(255, 255, 255, 0.28);
    overflow: hidden;
    transition: height 0.15s ease;
}

.st-video-player__scrub:hover .st-video-player__scrub-track {
    height: 6px;
}

.st-video-player__scrub-buffer,
.st-video-player__scrub-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0;
    border-radius: var(--st-radius-pill);
}

.st-video-player__scrub-buffer {
    background: rgba(255, 255, 255, 0.24);
}

.st-video-player__scrub-fill {
    background: var(--st-accent-bg);
}

.st-video-player__scrub-knob {
    position: absolute;
    top: 50%;
    left: 0;
    width: 13px;
    height: 13px;
    border-radius: var(--st-radius-pill);
    background: var(--st-accent-bg);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.15s ease;
    pointer-events: none;
}

.st-video-player__scrub:hover .st-video-player__scrub-knob,
.st-video-player.is-scrubbing .st-video-player__scrub-knob {
    transform: translate(-50%, -50%) scale(1);
}

.st-video-player__bar {
    display: flex;
    align-items: center;
    gap: 6px;
}

body.theme-store .st-video-player__btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--st-radius-pill);
    background: transparent;
    color: #fff;
    font-size: 17px;
    flex: 0 0 auto;
}

body.theme-store .st-video-player__btn:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.st-video-player__time {
    margin-left: 2px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.st-video-player__spacer {
    flex: 1 1 auto;
}

.st-video-player__volume {
    display: flex;
    align-items: center;
    gap: 6px;
}

.st-video-player__volume-slider {
    width: 0;
    opacity: 0;
    transition: width 0.2s ease, opacity 0.2s ease;
}

.st-video-player__volume:hover .st-video-player__volume-slider,
.st-video-player__volume:focus-within .st-video-player__volume-slider {
    width: 78px;
    opacity: 1;
}

body.theme-store .st-video-player__volume-slider input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 78px;
    height: 4px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: var(--st-radius-pill);
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    box-shadow: none;
}

body.theme-store .st-video-player__volume-slider input[type="range"]:focus {
    outline: none;
    box-shadow: none;
}

body.theme-store .st-video-player__volume-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border: 0;
    border-radius: var(--st-radius-pill);
    background: #fff;
}

body.theme-store .st-video-player__volume-slider input[type="range"]::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border: 0;
    border-radius: var(--st-radius-pill);
    background: #fff;
}

@media (max-width: 767px) {
    .st-product-videos {
        margin-top: 40px;
        padding-top: 28px;
        --st-video-card-height: min(64vw, 300px);
    }

    .st-product-videos.is-single {
        --st-video-card-height: min(78vw, 340px);
    }

    .st-video-card__play {
        width: 48px;
        height: 48px;
        font-size: 22px;
    }

    .st-video-modal {
        padding: 16px;
        align-content: center;
    }

    body.theme-store .st-video-modal__close {
        top: -46px;
        width: 36px;
        height: 36px;
    }

    .st-video-player__volume {
        display: none;
    }

    .st-video-player__big-play {
        width: 60px;
        height: 60px;
        font-size: 26px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .st-video-card__media,
    .st-video-card__media img,
    .st-video-card__play,
    .st-video-modal,
    .st-video-modal__dialog {
        transition: none;
    }
}
