/*=====================================
    VIDEOS PROMOCIONALES (inicio y joyería)
    Formato reel (vertical 9:16) en un carrusel horizontal.
    Las tarjetas se generan desde js/videos.js
======================================*/

.videos-promo[hidden] {
    display: none;
}

.reels {
    --reel-ancho: clamp(220px, 23%, 290px);
    --reel-gap: 20px;
    position: relative;
}

.reels__pista {
    display: flex;
    gap: var(--reel-gap);
    margin: 0;
    padding: 8px 4px 24px;
    list-style: none;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.reels__pista::-webkit-scrollbar {
    display: none;
}

.reels__pista:focus-visible {
    outline: 3px solid var(--color-secondary);
    outline-offset: 2px;
    border-radius: var(--radius);
}

/* Si caben todos, quedan centrados y sin flechas */
.reels--estatico .reels__pista {
    justify-content: center;
}


/*==========================
    TARJETA
==========================*/

.reel {
    flex: 0 0 var(--reel-ancho);
    min-width: 0;
    scroll-snap-align: start;
}

.reel__medio {
    position: relative;
    aspect-ratio: 9 / 16;
    overflow: hidden;
    border-radius: 18px;
    background: linear-gradient(160deg, var(--color-primary-light), var(--color-primary-darker));
    box-shadow: var(--shadow-md);
    isolation: isolate;
}

.reel__medio iframe,
.reel__medio > video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: #000;
}

/* El reproductor de Instagram trae fondo blanco */
.reel--instagram .reel__medio iframe {
    background: var(--color-white);
}

.reel__portada {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    overflow: hidden;
}

.reel__portada img,
.reel__portada video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

/* Velo para que el botón de reproducir se vea sobre cualquier imagen */
.reel__portada::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(20, 10, 56, 0.55), rgba(20, 10, 56, 0) 55%);
}

.reel__icono {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 62px;
    height: 62px;
    padding-left: 4px; /* el triángulo se ve centrado */
    border-radius: 50%;
    background: var(--color-secondary);
    color: var(--color-white);
    font-size: 1.25rem;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
    transition: transform var(--transition), background var(--transition);
}

.reel__portada:hover img,
.reel__portada:hover video {
    transform: scale(1.04);
}

.reel__portada:hover .reel__icono,
.reel__portada:focus-visible .reel__icono {
    transform: scale(1.08);
    background: var(--color-secondary-dark);
}

.reel__portada:focus-visible {
    outline: 3px solid var(--color-secondary);
    outline-offset: -3px;
}

.reel__cuerpo {
    padding: 12px 4px 0;
}

.site .reel__titulo {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
    color: var(--color-primary);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
}

.reel__titulo i {
    flex: 0 0 auto;
    margin-top: 3px;
    color: var(--color-secondary);
    font-size: 0.9em;
}

.reel__descripcion {
    margin: 4px 0 0;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    line-height: 1.45;
}


/*==========================
    FLECHAS
==========================*/

.reels__flecha {
    position: absolute;
    top: calc(50% - 40px);
    z-index: 5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: var(--color-white);
    color: var(--color-primary);
    font-size: 1rem;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transform: translateY(-50%);
    transition: background var(--transition), color var(--transition), transform var(--transition), opacity var(--transition);
}

.reels__flecha:hover:not(:disabled) {
    background: var(--color-primary);
    color: var(--color-white);
    transform: translateY(-50%) scale(1.08);
}

.reels__flecha:disabled {
    opacity: 0;
    pointer-events: none;
}

.reels__flecha--prev {
    left: -6px;
}

.reels__flecha--next {
    right: -6px;
}

@media (min-width: 1300px) {

    .reels__flecha--prev {
        left: -22px;
    }

    .reels__flecha--next {
        right: -22px;
    }
}


/*==========================
    RESPONSIVE
==========================*/

@media (max-width: 991px) {

    .reels {
        --reel-ancho: clamp(200px, 38%, 260px);
    }
}

/* Teléfono: una tarjeta y se asoma la siguiente para invitar a deslizar */
@media (max-width: 575px) {

    .reels {
        --reel-ancho: 68%;
        --reel-gap: 14px;
    }

    /* Se pasa con el dedo */
    .reels__flecha {
        display: none;
    }

    .reel__icono {
        width: 54px;
        height: 54px;
        font-size: 1.1rem;
    }
}

@media (prefers-reduced-motion: reduce) {

    .reel__portada img,
    .reel__portada video,
    .reel__icono,
    .reels__flecha {
        transition: none;
    }
}
