/**
 * Info Boxes Widget - Styles
 * Version: 1.3.0 - Multi-Platform Video Support
 */

/* =====================================================
   Grid Container
   ===================================================== */
.ibw-info-boxes-wrapper {
    width: 100%;
}

.ibw-info-boxes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
}

/* =====================================================
   Individual Box
   ===================================================== */
.ibw-info-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 30px;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.ibw-info-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* =====================================================
   Image & Video Container
   ===================================================== */
.ibw-info-box-image {
    width: 100%;
    margin-bottom: 20px;
    overflow: hidden;
    position: relative;
    border-radius: 4px;
    aspect-ratio: 16 / 9;
    background-color: #000;
}

.ibw-info-box-image img.ibw-box-static-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 4px;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Fundido al hacer hover - Valores por defecto (sobreescritos por CSS inline) */
.ibw-has-hover-video:hover .ibw-box-static-image {
    opacity: 0;
    transition: opacity 2.5s ease 3.5s;
}

/* Video Container - Hidden by default */
.ibw-box-video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0;
    pointer-events: none;
    border-radius: 4px;
    overflow: hidden;
    background-color: #000;
    transition: opacity 0.3s ease;
}

.ibw-box-video-container.ibw-video-active {
    opacity: 1;
    pointer-events: auto;
}

/* =====================================================
   YouTube Player Styles
   ===================================================== */
.ibw-yt-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* YouTube iframe - Método Elementor: Escalar y Centrar */
.ibw-box-video-container iframe,
.ibw-yt-player iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border: none;
    background: #000;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(1.15);
    transform-origin: center center;
}

/* Máscara para ocultar UI de YouTube en los bordes */
.ibw-box-video-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 2;
    pointer-events: none;
}

/* Overlay adicional para prevenir interacción */
.ibw-box-video-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
    background: transparent;
}

/* =====================================================
   Vimeo Player Styles
   ===================================================== */
.ibw-vimeo-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.ibw-vimeo-player iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border: none;
    background: #000;
    pointer-events: none;
    transform: translate(-50%, -50%);
    transform-origin: center center;
}

/* =====================================================
   WordPress Video (HTML5) Styles
   ===================================================== */
.ibw-wp-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none;
    background: #000;
    pointer-events: none;
}

/* =====================================================
   Title
   ===================================================== */
.ibw-info-box-title {
    font-size: 24px;
    font-weight: 700;
    color: #333333;
    margin: 0 0 15px 0;
    line-height: 1.3;
}

/* =====================================================
   Subtitle
   ===================================================== */
.ibw-info-box-subtitle {
    font-size: 16px;
    line-height: 1.6;
    color: #666666;
    margin: 0 0 20px 0;
}

/* =====================================================
   Button
   ===================================================== */
.ibw-info-box-button-wrapper {
    margin-top: auto;
    width: 100%;
}

.ibw-info-box-button {
    display: inline-block;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    background-color: #0073e6;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.ibw-info-box-button:hover {
    background-color: #005bb5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 115, 230, 0.3);
}

/* =====================================================
   Responsive
   ===================================================== */
@media (max-width: 1024px) {
    .ibw-info-boxes-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .ibw-info-boxes-grid {
        grid-template-columns: 1fr;
    }
    
    .ibw-info-box {
        padding: 20px;
    }
    
    .ibw-info-box-title {
        font-size: 20px;
    }
    
    .ibw-info-box-subtitle {
        font-size: 14px;
    }
    
    .ibw-info-box-button {
        font-size: 14px;
        padding: 10px 24px;
    }
}
