/**
 * Cooper Suite - Image Cooper Widget Styles
 *
 * Rules:
 * - Font: Funnel Sans (var(--cooper-font-primary))
 * - Zero !important on editable properties (font-size, color, background-color, padding, margin, border-radius, etc.)
 * - 4 Breakpoints: Widescreen (>=1920px), Desktop (1025-1919px), Tablet (<=1024px), Mobile (<=767px)
 */

/* ==========================================================================
   0. ELEMENTOR WIDGET WRAPPER BASICS
   Garantiza que el wrapper de Elementor tenga ancho definido (100%) para que
   los contenedores flex (e-con) de Elementor calculen la altura del aspect-ratio
   sin colapsar a 0px en móvil ni superponer widgets adyacentes.
   ========================================================================== */
.elementor-widget.elementor-widget-cooper_image {
    width: 100%;
    max-width: 100%;
    position: relative;
    box-sizing: border-box;
}

.elementor-widget.elementor-widget-cooper_image .elementor-widget-container {
    width: 100%;
    height: auto;
    position: relative;
    box-sizing: border-box;
}

/* ==========================================================================
   1. CONTENEDOR PRINCIPAL & FRAME
   ========================================================================== */
.cooper-img-widget {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex-shrink: 0;
}

.cooper-img-frame {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    display: block;
    box-sizing: border-box;
    background-color: transparent;
    border-radius: 0;
    aspect-ratio: 16 / 9;
    flex-shrink: 0;
}

.cooper-img-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    position: relative;
    outline: none;
    cursor: pointer;
}

/* ==========================================================================
   2. ELEMENTO DE MEDIO (IMAGEN / VIDEO / GIF)
   ========================================================================== */
.cooper-img-element {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    box-sizing: border-box;
    border: 0;
    outline: 0;
    transform: scale(1);
    transition: transform 0.35s ease, opacity 0.35s ease, filter 0.35s ease;
}

/* Modo aspect-ratio: auto sin altura fija */
.cooper-img-widget.is-ratio-auto .cooper-img-frame {
    aspect-ratio: auto;
}
.cooper-img-widget.is-ratio-auto .cooper-img-element,
.cooper-img-frame[style*="aspect-ratio: auto"] .cooper-img-element,
.cooper-img-frame[style*="aspect-ratio:auto"] .cooper-img-element {
    position: relative;
    height: auto;
    max-width: 100%;
    display: block;
}

/* Video específico */
video.cooper-img-element {
    background-color: #0f172a;
}

/* ==========================================================================
   3. EFECTOS HOVER
   ========================================================================== */
.cooper-img-widget.has-hover-zoom:hover .cooper-img-element {
    transform: scale(var(--cooper-img-zoom, 1.05));
}

/* ==========================================================================
   4. CAPA DE TINTE / OVERLAY
   ========================================================================== */
.cooper-img-overlay-tint {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-color: transparent;
    transition: background-color 0.3s ease;
    z-index: 1;
}

/* ==========================================================================
   5. BADGES DE TIPO DE MEDIO
   ========================================================================== */
.cooper-img-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 2;
    padding: 3px 8px;
    font-family: var(--cooper-font-primary), 'Funnel Sans', sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    line-height: 1.2;
    pointer-events: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.cooper-img-badge.is-video {
    background-color: rgba(15, 23, 42, 0.85);
    color: #ffffff;
}

.cooper-img-badge.is-gif {
    background-color: rgba(124, 58, 237, 0.85);
    color: #ffffff;
}

.cooper-img-badge.is-photo {
    background-color: rgba(255, 255, 255, 0.9);
    color: #0f172a;
}

/* ==========================================================================
   6. CAPTIONS
   ========================================================================== */
.cooper-img-caption {
    font-family: var(--cooper-font-primary), 'Funnel Sans', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: -0.2px;
    box-sizing: border-box;
}

.cooper-img-caption-below {
    color: #5c5c5c;
    margin-top: 10px;
    display: block;
    text-align: left;
}

.cooper-img-caption-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    color: #ffffff;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.3) 60%, transparent 100%);
    padding: 18px 20px 14px 20px;
}

/* ==========================================================================
   7. ESCALA TIPOGRÁFICA BASE DE 4 RESOLUCIONES (GEMINI.md)
   ========================================================================== */

/* Widescreen (>= 1920px) */
@media (min-width: 1920px) {
    .cooper-img-caption-below {
        font-size: 16px;
        line-height: 1.4;
    }
    .cooper-img-caption-overlay {
        font-size: 17px;
        padding: 22px 24px 16px 24px;
    }
    .cooper-img-badge {
        font-size: 12px;
        padding: 4px 10px;
        top: 16px;
        left: 16px;
    }
}

/* Desktop Base (1025px - 1919px): valores por defecto */
@media (min-width: 1025px) and (max-width: 1919px) {
    .cooper-img-caption-below {
        font-size: 14px;
        line-height: 1.4;
    }
    .cooper-img-caption-overlay {
        font-size: 15px;
        padding: 18px 20px 14px 20px;
    }
}

/* Tablet (<= 1024px) */
@media (max-width: 1024px) {
    .cooper-img-caption-below {
        font-size: 14px;
        line-height: 1.4;
    }
    .cooper-img-caption-overlay {
        font-size: 14px;
        padding: 16px 18px 12px 18px;
    }
}

/* Móvil (<= 767px) */
@media (max-width: 767px) {
    .elementor-widget.elementor-widget-cooper_image {
        width: 100%;
    }
    .cooper-img-caption-below {
        font-size: 3.8vw;
        line-height: 1.4;
        margin-top: 8px;
    }
    .cooper-img-caption-overlay {
        font-size: 3.8vw;
        padding: 12px 14px 10px 14px;
    }
    .cooper-img-badge {
        font-size: 10px;
        padding: 2px 6px;
        top: 10px;
        left: 10px;
    }
}
