/* =====================================================
   Botón de play en galería
   ===================================================== */
.epr-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 15;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    padding-left: 3px;
    transition: transform 0.2s ease, background 0.2s ease;
}

.epr-play-overlay:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translate(-50%, -50%) scale(1.1);
}

/* Thumbnail de video inyectado en galería de bloques (fallback) */
.epr-gallery-video-thumb {
    position: relative;
    display: block;
    width: 100%;
    background-color: #000;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 10px;
}

.epr-gallery-video-thumb.epr-orientation-vertical {
    aspect-ratio: 9 / 16;
    max-width: 320px;
}

.epr-gallery-video-thumb.epr-orientation-horizontal {
    aspect-ratio: 16 / 9;
}

.epr-gallery-video-thumb .epr-play-overlay {
    pointer-events: none;
}

/* =====================================================
   Modal de video
   ===================================================== */
.epr-video-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(4px);
}

.epr-video-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: transparent;
    padding: 0;
    border-radius: 12px;
    width: 360px;
    max-width: 92vw;
    max-height: 92vh;
}

.epr-video-modal-content.horizontal {
    width: 800px;
    max-width: 92vw;
}

.epr-video-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.epr-video-modal-content:not(.horizontal) .epr-video-container iframe,
.epr-video-modal-content:not(.horizontal) .epr-video-container video {
    aspect-ratio: 9 / 16;
    width: 100%;
    height: auto;
    max-height: 84vh;
    border-radius: 6px;
}

.epr-video-modal-content.horizontal .epr-video-container iframe,
.epr-video-modal-content.horizontal .epr-video-container video {
    aspect-ratio: 16 / 9;
    width: 100%;
    height: auto;
    border-radius: 6px;
}

.epr-video-modal .epr-close {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    z-index: 10;
    transition: background 0.2s ease;
}

.epr-video-modal .epr-close:hover {
    background: rgba(0, 0, 0, 0.75);
}

body.epr-modal-open {
    overflow: hidden;
}

/* =====================================================
   Video flotante
   ===================================================== */
.epr-floating-video {
    position: fixed;
    z-index: 9998;
    background: transparent;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
    transition: opacity 0.3s ease, transform 0.3s ease;
    cursor: pointer;
    border-radius: 8px;
}

.epr-floating-video.position-bottom-right { bottom: 30px; right: 30px; }
.epr-floating-video.position-bottom-left  { bottom: 30px; left: 30px; }
.epr-floating-video.position-top-right    { top: 120px; right: 30px; }
.epr-floating-video.position-top-left     { top: 120px; left: 30px; }

.epr-floating-video-close {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 26px;
    height: 26px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    padding: 0;
    transition: transform 0.2s ease, background 0.2s ease;
}

.epr-floating-video-close:hover {
    background: rgba(0, 0, 0, 0.75);
    transform: scale(1.1);
}

.epr-floating-video-container {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
}

.epr-floating-video-container iframe,
.epr-floating-video-container video {
    display: block;
    width: 100%;
    height: 100%;
    border: none;
    pointer-events: none; /* el click abre el modal */
}

.epr-floating-video.entering { animation: eprFloatIn 0.4s ease-out; }
.epr-floating-video.exiting  { animation: eprFloatOut 0.3s ease-in forwards; }

@keyframes eprFloatIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes eprFloatOut {
    from { opacity: 1; transform: scale(1); }
    to   { opacity: 0; transform: scale(0.95); }
}

@media (max-width: 480px) {
    .epr-floating-video.orientation-vertical { width: 90px !important; height: auto !important; }
    .epr-floating-video.position-bottom-right,
    .epr-floating-video.position-bottom-left { bottom: 80px; }
    .epr-floating-video.position-top-right,
    .epr-floating-video.position-top-left { top: 90px; }
    .epr-floating-video.position-bottom-right,
    .epr-floating-video.position-top-right { right: 15px; }
    .epr-floating-video.position-bottom-left,
    .epr-floating-video.position-top-left { left: 15px; }
}
