/**
 * 2PX Elementor Suite — CTA Widget
 * 3 layouts: media_right · media_left · background
 * BEM Methodology
 */

/* ── Wrapper height ─────────────────────────────────────────────────────────── */
.elementor-widget-2px-cta,
.elementor-widget-2px-cta .elementor-widget-container {
    height: 100%;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   BASE — compartido por los 3 layouts
   ═══════════════════════════════════════════════════════════════════════════════ */
.twopx-cta {
    position: relative;
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.twopx-cta * {
    box-sizing: border-box;
}

/* ── Content column ─────────────────────────────────────────────────────────── */
.twopx-cta__content-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 48px;
    position: relative;
    z-index: 2;
}

.twopx-cta__content-wrapper {
    width: 100%;
    max-width: 100%;
}

/* ── Subtitle row ───────────────────────────────────────────────────────────── */
.twopx-cta__subtitle-row {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    margin-bottom: 16px;
}

.twopx-cta__subtitle-icon {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    font-size: 16px;
    margin-right: 8px;
    line-height: 1;
}

.twopx-cta__subtitle-icon svg {
    width: 1em;
    height: 1em;
}

.twopx-cta__subtitle-text {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1;
}

/* ── Title / Body ───────────────────────────────────────────────────────────── */
.twopx-cta__title {
    margin: 0 0 20px 0;
    line-height: 1.2;
}

.twopx-cta__body {
    margin: 0 0 30px 0;
    line-height: 1.6;
}

.twopx-cta__body p:last-child {
    margin-bottom: 0;
}

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.twopx-cta__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.twopx-cta__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 15px 30px;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    font-weight: 600;
}

.twopx-cta__btn--primary {
    background-color: #000;
    color: #fff;
}

.twopx-cta__btn--secondary {
    background-color: transparent;
    color: #000;
    border: 1px solid #000;
}

/* ── Media wrapper ──────────────────────────────────────────────────────────── */
.twopx-cta__media-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.twopx-cta__image,
.twopx-cta__video {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: 0;
    border: none;
}

.twopx-cta__overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1;
    transition: background-color 0.3s ease;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   LAYOUT: MEDIA_RIGHT  (default)
   Contenido izquierda | Media derecha
   ═══════════════════════════════════════════════════════════════════════════════ */
.twopx-cta--media_right {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
}

/* Mobile: stacked */
.twopx-cta--media_right .twopx-cta__content-col,
.twopx-cta--media_right .twopx-cta__media-col {
    width: 100%;
}

.twopx-cta--media_right .twopx-cta__media-col {
    min-height: 280px;
}

/* Desktop: side-by-side — widths set by Elementor sliders */
@media (min-width: 768px) {
    .twopx-cta--media_right {
        flex-wrap: nowrap;
    }
    .twopx-cta--media_right .twopx-cta__content-col {
        width: 55%;   /* fallback — overridden by Elementor */
        flex-shrink: 0;
    }
    .twopx-cta--media_right .twopx-cta__media-col {
        width: 45%;   /* fallback — overridden by Elementor */
        flex-shrink: 0;
        min-height: 0;
    }
    .twopx-cta--media_right .twopx-cta__media-wrapper {
        height: 100%;
        min-height: 300px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   LAYOUT: MEDIA_LEFT
   Media izquierda | Contenido derecha
   ═══════════════════════════════════════════════════════════════════════════════ */
.twopx-cta--media_left {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
}

/* Mobile: media stacks above content */
.twopx-cta--media_left .twopx-cta__content-col,
.twopx-cta--media_left .twopx-cta__media-col {
    width: 100%;
}

.twopx-cta--media_left .twopx-cta__media-col {
    min-height: 280px;
}

@media (min-width: 768px) {
    .twopx-cta--media_left {
        flex-wrap: nowrap;
    }
    .twopx-cta--media_left .twopx-cta__media-col {
        width: 45%;   /* fallback */
        flex-shrink: 0;
        min-height: 0;
    }
    .twopx-cta--media_left .twopx-cta__content-col {
        width: 55%;   /* fallback */
        flex-shrink: 0;
    }
    .twopx-cta--media_left .twopx-cta__media-wrapper {
        height: 100%;
        min-height: 300px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   LAYOUT: BACKGROUND
   Media como fondo absoluto · contenido superpuesto
   ═══════════════════════════════════════════════════════════════════════════════ */
.twopx-cta--background {
    display: block;
    min-height: 480px; /* fallback — overridden by Elementor slider */
}

/* Media col cubre todo el widget */
.twopx-cta--background .twopx-cta__media-col {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
}

.twopx-cta--background .twopx-cta__media-wrapper {
    height: 100%;
}

/* Content col es relativo y ocupa todo el ancho → el bloque se posiciona dentro */
.twopx-cta--background .twopx-cta__content-col {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: inherit;
    z-index: 2;
    /* display flex column + align-items controla posición horizontal del bloque */
    display: flex;
    flex-direction: column;
    /* align-items: set by Elementor content_h_position control (flex-start / center / flex-end) */
    align-items: flex-start; /* fallback = izquierda */
}

/* El wrapper tiene max-width controlado por Elementor → crea el bloque acotado */
.twopx-cta--background .twopx-cta__content-wrapper {
    flex-shrink: 0;
}

/* ── Responsive desktop: content_col padding generoso ────────────────────────── */
@media (min-width: 1025px) {
    .twopx-cta--media_right .twopx-cta__content-col,
    .twopx-cta--media_left  .twopx-cta__content-col {
        padding: 80px 60px;
    }
}
