/**
 * HSC Hero Video — estilos de los controles.
 * Colores ajustables con variables CSS desde Elementor (CSS personalizado del contenedor).
 */

.hsc-hv-host {
    --hsc-hv-bg: rgba(0, 0, 0, 0.55);
    --hsc-hv-bg-hover: rgba(0, 0, 0, 0.75);
    --hsc-hv-color: #fff;
    --hsc-hv-focus: #00a5b5;
    --hsc-hv-offset: 20px;

    position: relative;
}

.hsc-hv-controls {
    position: absolute;
    left: var(--hsc-hv-offset);
    bottom: var(--hsc-hv-offset);
    z-index: 5;
    display: flex;
    gap: 8px;
    align-items: center;
}

.hsc-hv-controls[hidden] {
    display: none;
}

/*
 * Selectores con prefijo .hsc-hv-controls para ganar en especificidad al CSS de
 * botones del tema (Hello Elementor: [type=button], button:hover/focus en #c36).
 */
.hsc-hv-controls .hsc-hv-btn {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0 16px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 999px;
    background: var(--hsc-hv-bg);
    color: var(--hsc-hv-color);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.hsc-hv-controls .hsc-hv-btn:hover,
.hsc-hv-controls .hsc-hv-btn:focus,
.hsc-hv-controls .hsc-hv-btn:active {
    background: var(--hsc-hv-bg-hover);
    border-color: rgba(255, 255, 255, 0.7);
    color: var(--hsc-hv-color);
}

.hsc-hv-controls .hsc-hv-btn:focus {
    outline: none;
}

.hsc-hv-controls .hsc-hv-btn:focus-visible {
    outline: 3px solid var(--hsc-hv-focus);
    outline-offset: 2px;
}

.hsc-hv-controls .hsc-hv-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: inherit;
}

.hsc-hv-controls .hsc-hv-btn--play {
    width: 44px;
    padding: 0;
}

.hsc-hv-controls .hsc-hv-btn[hidden] {
    display: none;
}

/* Botón "Volver a ver": más visible, aparece al terminar el vídeo */
.hsc-hv-controls .hsc-hv-btn--replay {
    background: var(--hsc-hv-focus);
    border-color: transparent;
    animation: hsc-hv-fade-in 0.35s ease-out;
}

.hsc-hv-controls .hsc-hv-btn--replay:hover,
.hsc-hv-controls .hsc-hv-btn--replay:focus {
    background: #008a98;
    border-color: transparent;
}

@keyframes hsc-hv-fade-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Frases sincronizadas con el vídeo ===== */

/* El carrusel original se oculta pero conserva su altura (Elementor → Alçada) */
.hsc-hv-has-captions .elementor-swiper {
    visibility: hidden;
}

.hsc-hv-has-captions > .elementor-widget-container {
    position: relative;
}

.hsc-hv-captions {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

.hsc-hv-caption {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease, visibility 0s linear 0.8s;
}

.hsc-hv-caption.is-active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.8s ease, visibility 0s;
}

/* Reutiliza los estilos de Elementor (.elementor-slides .swiper-slide-inner) */
.hsc-hv-caption .swiper-slide-inner {
    display: flex !important;
    position: absolute;
    inset: 0;
    pointer-events: auto;
}

.hsc-hv-caption.is-active .swiper-slide-contents {
    animation: hsc-hv-zoom-in 1s ease both;
}

@keyframes hsc-hv-zoom-in {
    from {
        opacity: 0;
        transform: scale3d(0.3, 0.3, 0.3);
    }

    50% {
        opacity: 1;
    }
}

/* Llamada de atención suave al botón de sonido mientras está en silencio */
.hsc-hv-is-muted .hsc-hv-controls .hsc-hv-btn--sound {
    animation: hsc-hv-pulse 2.4s ease-in-out 1.5s 3;
}

@keyframes hsc-hv-pulse {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.45);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(255, 255, 255, 0);
    }
}

@media (max-width: 767px) {
    .hsc-hv-host {
        --hsc-hv-offset: 12px;
    }

    /* En móvil solo iconos para no tapar el texto del hero */
    .hsc-hv-controls .hsc-hv-btn--sound .hsc-hv-label {
        display: none;
    }

    .hsc-hv-controls .hsc-hv-btn--sound {
        width: 44px;
        padding: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hsc-hv-is-muted .hsc-hv-controls .hsc-hv-btn--sound,
    .hsc-hv-controls .hsc-hv-btn--replay,
    .hsc-hv-caption.is-active .swiper-slide-contents {
        animation: none;
    }

    .hsc-hv-caption,
    .hsc-hv-caption.is-active {
        transition: none;
    }

    .hsc-hv-controls .hsc-hv-btn {
        transition: none;
    }
}
