/* ==========================================================================
   1. Contenedores generales de Swiper y blindaje
   ========================================================================== */
.cpt-loop-swiper,
.cpt-single-swiper {
    position: relative;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    padding-bottom: 40px !important;
    box-sizing: border-box !important;
}

.cpt-loop-swiper .swiper-wrapper,
.cpt-single-swiper .swiper-wrapper {
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.cpt-loop-swiper .swiper-slide,
.cpt-single-swiper .swiper-slide {
    height: auto !important;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* ==========================================================================
   2. CAJA CUADRADA HOMOGÉNEA (Container Lock)
   Obliga a que TODAS las imágenes midan exactamente lo mismo (Cuadradas)
   ========================================================================== */
.cpt-media-box {
    position: relative !important;
    width: 100% !important;
    aspect-ratio: 1 / 1 !important; /* Fuerza proporción cuadrada 1:1 */
    height: auto !important;
    margin: 0 0 15px 0 !important;
    overflow: hidden !important;
    border-radius: 8px !important;
    display: block !important;
    background-color: #f4f4f4;
}

/* ==========================================================================
   3. AJUSTE DE IMAGEN
   Cubre todo el recuadro cuadrado sin deformar la foto
   ========================================================================== */
.cpt-media-box img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important; /* Recorta la foto proporcionalmente */
    object-position: center !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    display: block !important;
}

/* ==========================================================================
   4. CANDADOS DE CONTENEDORES
   ========================================================================== */
.elementor-column .elementor-widget-wrap,
.e-con,
.e-con-inner {
    min-width: 0 !important;
}

/* ==========================================================================
   5. FIX: El widget del Loop Slider se encogía a su contenido cuando había
   pocos ítems (1-2), porque el Container/Columna padre (con min-width:0
   de la regla de arriba) se ajustaba al ancho intrínseco del contenido en
   vez de reclamar el 100% de la fila. Esto forzaba a que el cálculo interno
   "(100% - gap) / columnas" del slider se resolviera sobre un contenedor ya
   encogido, produciendo tarjetas diminutas con 1-2 ítems mientras que con
   3-4 se veía bien (porque ahí sí llenaba naturalmente el ancho).
   ========================================================================== */
.elementor-widget-cpt_loop_slider,
.elementor-widget-cpt_loop_slider .elementor-widget-container {
    width: 100% !important;
    flex-grow: 1 !important;
    flex-shrink: 1 !important;
    flex-basis: 100% !important;
}

.elementor-widget-cpt_loop_image {
    width: 100% !important;
    display: block !important;
}

.cpt-sub-item-box:hover {
    background: #e4e4e4 !important;
    transform: translateY(-2px);
}

/* ==========================================================================
   6. Forzar que el wrapper de la galería en el Single empuje los elementos
   inferiores (evita que se monte/superponga si no se da altura mínima al
   container de la galería)
   ========================================================================== */
.elementor-widget-cpt_dynamic_galeria {
    width: 100% !important;
    display: block !important;
    flex-grow: 0 !important;
    flex-shrink: 0 !important;
}

.cpt-gallery-wrapper {
    display: block !important;
    width: 100% !important;
    position: relative !important;
}
