/* ==========================================================================
   Cooper Suite: Two Boxes Widget Styles (Full-Bleed 100% Width)
   Following WIDGET_RULES.md (Funnel Sans, --cooper-frame-lateral, 1:1 Aspect)
   ========================================================================== */

.cooper-tb-wrap {
    --cooper-tb-font: "Funnel Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --cooper-tb-accent: #c8102e;
    --cooper-tb-accent-hover: #000000;
    --cooper-tb-gap: 20px;
    --cooper-frame-lateral: 60px;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    font-family: var(--cooper-tb-font);
    font-optical-sizing: auto;
    padding: 40px 0;
}

.cooper-tb-wrap * {
    box-sizing: border-box;
}

/* ==========================================================================
   Contenedor Principal: 100% Full-Bleed con Frame Lateral
   ========================================================================== */

.cooper-tb-container {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--cooper-tb-gap, 20px);
    width: 100% !important;
    max-width: var(--cooper-tb-max-width, 100%) !important;
    margin: 0 !important;
    padding: 0 var(--cooper-frame-lateral, 60px);
    box-sizing: border-box !important;
}

/* ==========================================================================
   Alineación de Contenido (Simetría Horizontal & Vertical)
   ========================================================================== */

.cooper-tb-wrap.cooper-tb-align-center .cooper-tb-content,
.cooper-tb-wrap.cooper-tb-align-tablet-center .cooper-tb-content,
.cooper-tb-wrap.cooper-tb-align-mobile-center .cooper-tb-content {
    align-items: center !important;
    text-align: center !important;
}
.cooper-tb-wrap.cooper-tb-align-center .cooper-tb-buttons,
.cooper-tb-wrap.cooper-tb-align-tablet-center .cooper-tb-buttons,
.cooper-tb-wrap.cooper-tb-align-mobile-center .cooper-tb-buttons {
    justify-content: center !important;
}
.cooper-tb-wrap.cooper-tb-align-right .cooper-tb-content,
.cooper-tb-wrap.cooper-tb-align-tablet-right .cooper-tb-content,
.cooper-tb-wrap.cooper-tb-align-mobile-right .cooper-tb-content {
    align-items: flex-end !important;
    text-align: right !important;
}
.cooper-tb-wrap.cooper-tb-align-right .cooper-tb-buttons,
.cooper-tb-wrap.cooper-tb-align-tablet-right .cooper-tb-buttons,
.cooper-tb-wrap.cooper-tb-align-mobile-right .cooper-tb-buttons {
    justify-content: flex-end !important;
}

/* ==========================================================================
   Caja Individual (Box / Card)
   ========================================================================== */

.cooper-tb-box {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    min-height: auto;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: clamp(32px, 3.5vw, 54px);
    background-color: #111827;
    text-decoration: none;
    box-sizing: border-box;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease, border-color 0.4s ease, background-color 0.4s ease;
}

/* Capa de Imagen de Fondo */
.cooper-tb-wrap .cooper-tb-media,
.cooper-tb-media {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}

.cooper-tb-wrap .cooper-tb-bg-img,
.elementor-widget-cooper_two_boxes img.cooper-tb-bg-img,
.cooper-tb-bg-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    min-width: 100% !important;
    min-height: 100% !important;
    max-width: none !important;
    object-fit: cover !important;
    object-position: center;
    display: block !important;
    pointer-events: none;
    transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.cooper-tb-wrap .cooper-tb-box.has-hover-zoom:hover .cooper-tb-bg-img,
.cooper-tb-box.has-hover-zoom:hover .cooper-tb-bg-img {
    transform: scale(1.05);
}

/* Capa de Gradiente Oscuro para Legibilidad */
.cooper-tb-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.92) 0%,
        rgba(0, 0, 0, 0.70) 35%,
        rgba(0, 0, 0, 0.35) 65%,
        rgba(0, 0, 0, 0.10) 90%,
        transparent 100%
    );
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.cooper-tb-box:hover .cooper-tb-overlay {
    opacity: 0.95;
}

/* ==========================================================================
   Contenido de Texto (Anclado al Piso de la Caja)
   ========================================================================== */

.cooper-tb-content {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    max-width: 540px;
}

/* Eyebrow / Subtítulo Superior */
.cooper-tb-eyebrow {
    display: inline-block;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.88);
    margin-bottom: 12px;
    line-height: 1.2;
    transition: color 0.3s ease;
}

/* Título de la Caja */
.cooper-tb-title {
    font-size: clamp(2rem, 2.7vw, 2.85rem);
    font-weight: 700;
    line-height: 1.1;
    color: #ffffff;
    margin: 0 0 16px 0;
    letter-spacing: -0.025em;
    word-break: normal;
    overflow-wrap: break-word;
    transition: color 0.3s ease;
}

/* Párrafo Descriptivo */
.cooper-tb-desc {
    font-size: clamp(14px, 1.05vw, 15.5px);
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.88);
    margin: 0 0 24px 0;
    max-width: 480px;
    transition: color 0.3s ease;
}

/* ==========================================================================
   Contenedor de Botones
   ========================================================================== */

.cooper-tb-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    width: 100%;
}

/* Botón Firma Cooper (Dos Bloques: Texto + Flecha) */
.cooper-tb-btn-arrow {
    display: inline-flex;
    align-items: stretch;
    gap: var(--cooper-tb-btn-gap, 3px);
    text-decoration: none !important;
    border: none !important;
    background: transparent;
    cursor: pointer;
    padding: 0;
    margin: 0;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Button Container Hover Animations (Salto, Hundimiento, Zoom, o Apagado) */
.cooper-tb-btn-arrow.btn-hover-lift:hover,
.cooper-tb-wrap.hover-trigger-card .cooper-tb-box:hover .cooper-tb-btn-arrow.btn-hover-lift {
    transform: translateY(calc(-1 * var(--cooper-tb-btn-lift, 3px)));
}

.cooper-tb-btn-arrow.btn-hover-sink:hover,
.cooper-tb-wrap.hover-trigger-card .cooper-tb-box:hover .cooper-tb-btn-arrow.btn-hover-sink {
    transform: translateY(var(--cooper-tb-btn-lift, 3px));
}

.cooper-tb-btn-arrow.btn-hover-grow:hover,
.cooper-tb-wrap.hover-trigger-card .cooper-tb-box:hover .cooper-tb-btn-arrow.btn-hover-grow {
    transform: scale(var(--cooper-tb-btn-scale, 1.05));
}

.cooper-tb-btn-arrow.btn-hover-shrink:hover,
.cooper-tb-wrap.hover-trigger-card .cooper-tb-box:hover .cooper-tb-btn-arrow.btn-hover-shrink {
    transform: scale(var(--cooper-tb-btn-scale, 0.96));
}

.cooper-tb-btn-arrow.btn-hover-slide-right:hover,
.cooper-tb-wrap.hover-trigger-card .cooper-tb-box:hover .cooper-tb-btn-arrow.btn-hover-slide-right {
    transform: translateX(var(--cooper-tb-btn-lift, 4px));
}

.cooper-tb-btn-arrow.btn-hover-glow:hover,
.cooper-tb-wrap.hover-trigger-card .cooper-tb-box:hover .cooper-tb-btn-arrow.btn-hover-glow {
    transform: none !important;
}

.cooper-tb-btn-arrow.btn-hover-none:hover,
.cooper-tb-wrap.hover-trigger-card .cooper-tb-box:hover .cooper-tb-btn-arrow.btn-hover-none {
    transform: none !important;
}

.cooper-tb-btn-arrow-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--cooper-tb-accent, #c8102e);
    color: #ffffff;
    padding: 13px 22px;
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
    border: none;
    border-radius: 0;
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    white-space: nowrap;
    box-sizing: border-box;
}

.cooper-tb-btn-arrow-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    background-color: var(--cooper-tb-accent, #c8102e);
    color: #ffffff;
    border: none;
    border-radius: 0;
    flex-shrink: 0;
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    box-sizing: border-box;
}

.cooper-tb-btn-arrow-icon svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.2;
    transition: transform 0.25s ease;
}

.cooper-tb-btn-arrow-icon i {
    transition: transform 0.25s ease;
}

.cooper-tb-btn-arrow:hover .cooper-tb-btn-arrow-text,
.cooper-tb-btn-arrow:hover .cooper-tb-btn-arrow-icon,
.cooper-tb-wrap.hover-trigger-card .cooper-tb-box:hover .cooper-tb-btn-arrow .cooper-tb-btn-arrow-text,
.cooper-tb-wrap.hover-trigger-card .cooper-tb-box:hover .cooper-tb-btn-arrow .cooper-tb-btn-arrow-icon {
    background-color: var(--cooper-tb-accent-hover, #000000);
}

.cooper-tb-btn-arrow:hover .cooper-tb-btn-arrow-icon svg,
.cooper-tb-wrap.hover-trigger-card .cooper-tb-box:hover .cooper-tb-btn-arrow .cooper-tb-btn-arrow-icon svg,
.cooper-tb-btn-arrow:hover .cooper-tb-btn-arrow-icon i,
.cooper-tb-wrap.hover-trigger-card .cooper-tb-box:hover .cooper-tb-btn-arrow .cooper-tb-btn-arrow-icon i {
    transform: translateX(var(--cooper-tb-arrow-shift, 4px));
}

/* Botón Sólido Rojo */
.cooper-tb-btn-solid {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--cooper-tb-accent, #c8102e);
    color: #ffffff;
    padding: 13px 24px;
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none !important;
    border: 1px solid var(--cooper-tb-accent, #c8102e);
    border-radius: 0;
    cursor: pointer;
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
    white-space: nowrap;
    box-sizing: border-box;
}

.cooper-tb-btn-solid:hover {
    background-color: var(--cooper-tb-accent-hover, #000000);
    border-color: var(--cooper-tb-accent-hover, #000000);
    transform: translateY(-2px);
}

/* Botón Outline Blanco */
.cooper-tb-btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    color: #ffffff;
    padding: 13px 24px;
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none !important;
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 0;
    cursor: pointer;
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
    white-space: nowrap;
    box-sizing: border-box;
}

.cooper-tb-btn-outline:hover {
    background-color: #ffffff;
    border-color: #ffffff;
    color: #111827;
    transform: translateY(-2px);
}

/* ==========================================================================
   Responsive: Tablet (1024px and below)
   ========================================================================== */

@media (max-width: 1024px) {
    .cooper-tb-wrap {
        padding: 30px 0;
    }

    .cooper-tb-container {
        padding: 0 var(--cooper-frame-lateral, 40px);
        gap: var(--cooper-tb-gap, 16px);
    }

    .cooper-tb-box {
        padding: 36px 30px;
    }

    .cooper-tb-title {
        font-size: clamp(1.8rem, 3.2vw, 2.3rem);
    }
}

/* ==========================================================================
   Responsive: Mobile (767px and below)
   ========================================================================== */

@media (max-width: 767px) {
    .cooper-tb-wrap {
        padding: 24px 0;
        overflow: hidden;
        max-width: 100vw;
    }

    .cooper-tb-container,
    .cooper-tb-wrap .cooper-tb-container,
    .elementor-widget-cooper_two_boxes .cooper-tb-container {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: 1fr !important;
        gap: var(--cooper-tb-gap, 16px) !important;
        padding: 0 var(--cooper-frame-lateral, 24px);
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .cooper-tb-box,
    .cooper-tb-wrap .cooper-tb-box,
    .elementor-widget-cooper_two_boxes .cooper-tb-box {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        flex: 1 1 100% !important;
        aspect-ratio: auto;
        min-height: 380px;
        padding: 36px 26px 30px 26px;
        box-sizing: border-box !important;
    }

    .cooper-tb-eyebrow {
        font-size: 11px;
        margin-bottom: 10px !important;
    }

    .cooper-tb-title {
        font-size: clamp(1.9rem, 7.5vw, 2.3rem);
        margin-bottom: 12px !important;
    }

    .cooper-tb-desc {
        font-size: 14.5px;
        line-height: 1.55;
        margin-bottom: 20px !important;
    }

    .cooper-tb-buttons {
        gap: 10px;
    }

    .cooper-tb-btn-arrow-text {
        padding: 12px 18px;
        font-size: 14px;
    }

    .cooper-tb-btn-arrow-icon {
        width: 40px;
    }

    .cooper-tb-btn-solid,
    .cooper-tb-btn-outline {
        padding: 12px 20px;
        font-size: 14px;
    }
}
