/**
 * Cooper Suite: Hero Home Widget Styles (Plantilla 8)
 * Escalón blanco (derecha) con Tarjeta Roja anidada + Barra inferior izquierda.
 *
 * Todos los valores por defecto viven aquí. Los controles de Elementor
 * no tienen defaults "duros" para no pisar los valores de tablet/móvil:
 * si el usuario no toca un control, se usan estos valores.
 */

.cooper-hero-home-wrapper {
    --cooper-frame-lateral: 60px;
    --cooper-home-accent: #c8102e;
    position: relative;
    width: 100%;
    margin: 0 auto;
    overflow: hidden;
    font-family: "Funnel Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-sizing: border-box;
    background-color: #111827;
    min-height: 80vh;
    min-height: 80dvh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.cooper-hero-home-wrapper * {
    box-sizing: border-box;
}

/* ==========================================================================
   Media de fondo
   ========================================================================== */

.cooper-hero-home-media-wrap {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
}

.cooper-hero-home-media-el {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
}

.cooper-hero-home-yt-wrap {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100vw;
    height: 56.25vw;
    min-height: 100%;
    min-width: 177.77vh;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.cooper-hero-home-yt-wrap iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.cooper-hero-home-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.15);
    z-index: 2;
}

/* ==========================================================================
   Estructura inferior (Desktop)
   DOM: [escalón] [barra]  ->  visual: [barra] [escalón] (order)
   ========================================================================== */

.cooper-hero-home-wrap {
    width: 100%;
    position: relative;
    z-index: 12;
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    margin: 0;
    gap: 0;
}

/* Barra inferior blanca (texto) */
.cooper-hero-home-lower-bar {
    order: 1;
    flex: 1 1 auto;
    min-width: 0;
    background: #ffffff;
    padding: 28px 40px 28px var(--cooper-frame-lateral, 60px);
    min-height: 145px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    align-self: flex-end;
}

.cooper-hero-home-left-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 460px;
    margin-left: 0;
}

.cooper-hero-home-bar-title {
    margin: 0;
    font-size: 26px;
    font-weight: 750;
    line-height: 1.2;
    letter-spacing: -0.015em;
    color: #111827;
}

.cooper-hero-home-desc {
    margin: 0;
    font-size: 14.5px;
    line-height: 1.55;
    color: #4b5563;
}

.cooper-hero-home-btn-wrapper {
    margin-left: auto;
    flex: 0 0 auto;
}

/* Escalón blanco con tarjeta roja anidada */
.cooper-hero-home-step-container {
    order: 2;
    flex: 0 0 auto;
    width: 44%;
    min-width: 0;
    background: #ffffff;
    padding: 34px var(--cooper-frame-lateral, 60px) 0 32px;
    align-self: flex-end;
    display: flex;
    align-items: stretch;
    position: relative;
    box-sizing: border-box;
}

.cooper-hero-home-no-shelf .cooper-hero-home-step-container::after {
    display: none !important;
}

.cooper-hero-home-red-card {
    background: var(--cooper-home-accent, #c8102e);
    width: 100%;
    min-height: 200px;
    padding: 34px 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
    box-sizing: border-box;
}

.cooper-hero-home-title {
    margin: 0;
    font-size: clamp(1.8rem, 2.7vw, 3.1rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: #ffffff;
    text-transform: uppercase;
    white-space: pre-line;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
}

/* Variante: escalón a la izquierda (solo desktop / tablet) */
@media (min-width: 768px) {
    .cooper-hero-home-step-left .cooper-hero-home-step-container {
        order: 0;
        padding: 40px 40px 24px var(--cooper-frame-lateral, 60px);
    }

    .cooper-hero-home-step-left .cooper-hero-home-lower-bar {
        padding: 28px var(--cooper-frame-lateral, 60px) 28px 40px;
    }
}

/* ==========================================================================
   Animación telón (opcional)
   ========================================================================== */
.cooper-hero-home-curtain-card.cooper-hero-curtain-init {
    opacity: 0;
    clip-path: inset(100% 0 0 0);
    -webkit-clip-path: inset(100% 0 0 0);
    transform: translateY(45px);
}

.cooper-hero-home-curtain-card.cooper-hero-curtain-animate {
    opacity: 1;
    clip-path: inset(0 0 0 0);
    -webkit-clip-path: inset(0 0 0 0);
    transform: translateY(0);
    transition: clip-path var(--cooper-hero-anim-duration, 1100ms) cubic-bezier(0.16, 1, 0.3, 1),
                -webkit-clip-path var(--cooper-hero-anim-duration, 1100ms) cubic-bezier(0.16, 1, 0.3, 1),
                transform var(--cooper-hero-anim-duration, 1100ms) cubic-bezier(0.16, 1, 0.3, 1),
                opacity calc(var(--cooper-hero-anim-duration, 1100ms) * 0.42) ease-out;
}

/* ==========================================================================
   Tablet (<= 1024px)
   ========================================================================== */

@media (min-width: 768px) and (max-width: 1024px) {
    .cooper-hero-home-wrapper {
        --cooper-frame-lateral: 40px;
        min-height: 70vh;
    }

    .cooper-hero-home-step-container {
        width: 46%;
    }

    .cooper-hero-home-red-card {
        min-height: 150px;
        padding: 26px 28px;
    }

    .cooper-hero-home-title {
        font-size: 2.1rem;
    }

    .cooper-hero-home-lower-bar {
        min-height: 150px;
    }

    .cooper-hero-home-bar-title {
        font-size: 24px;
    }

    .cooper-hero-home-desc {
        font-size: 14px;
    }

    /* Tablet: Derecha */
    .cooper-hero-home-step-tablet-right .cooper-hero-home-step-container,
    .cooper-hero-home-step-right:not(.cooper-hero-home-step-tablet-left) .cooper-hero-home-step-container {
        order: 2;
        padding: 28px var(--cooper-frame-lateral, 40px) 18px 28px;
    }
    .cooper-hero-home-step-tablet-right .cooper-hero-home-lower-bar,
    .cooper-hero-home-step-right:not(.cooper-hero-home-step-tablet-left) .cooper-hero-home-lower-bar {
        order: 1;
        padding: 22px 28px 22px var(--cooper-frame-lateral, 40px);
    }

    /* Tablet: Izquierda */
    .cooper-hero-home-step-tablet-left .cooper-hero-home-step-container,
    .cooper-hero-home-step-left:not(.cooper-hero-home-step-tablet-right) .cooper-hero-home-step-container {
        order: 0;
        padding: 28px 28px 18px var(--cooper-frame-lateral, 40px);
    }
    .cooper-hero-home-step-tablet-left .cooper-hero-home-lower-bar,
    .cooper-hero-home-step-left:not(.cooper-hero-home-step-tablet-right) .cooper-hero-home-lower-bar {
        order: 1;
        padding: 22px var(--cooper-frame-lateral, 40px) 22px 28px;
    }
}

/* ==========================================================================
   Móvil (<= 767px)
   Soporte completo para dirección izquierda y derecha + orden vertical
   ========================================================================== */

@media (max-width: 767px) {
    .cooper-hero-home-wrapper {
        --cooper-frame-lateral: 16px;
        min-height: 70vh;
        min-height: 70dvh;
    }

    .cooper-hero-home-wrap {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-end;
    }

    .cooper-hero-home-step-container {
        order: 1;
        width: 82%;
        background: #ffffff;
        position: relative;
        box-sizing: border-box;
    }

    /* Móvil: Escalón a la IZQUIERDA */
    .cooper-hero-home-step-mobile-left .cooper-hero-home-step-container,
    .cooper-hero-home-step-left:not(.cooper-hero-home-step-mobile-right) .cooper-hero-home-step-container {
        align-self: flex-start;
        padding: 16px 16px 16px var(--cooper-frame-lateral, 16px);
    }

    .cooper-hero-home-step-mobile-left .cooper-hero-home-step-container::after,
    .cooper-hero-home-step-left:not(.cooper-hero-home-step-mobile-right) .cooper-hero-home-step-container::after {
        content: "";
        position: absolute;
        bottom: 0;
        left: 100%;
        right: auto;
        width: 100vw;
        height: 36px;
        background: inherit;
    }

    /* Móvil: Escalón a la DERECHA */
    .cooper-hero-home-step-mobile-right .cooper-hero-home-step-container,
    .cooper-hero-home-step-right:not(.cooper-hero-home-step-mobile-left) .cooper-hero-home-step-container {
        align-self: flex-end;
        padding: 16px var(--cooper-frame-lateral, 16px) 16px 16px;
    }

    .cooper-hero-home-step-mobile-right .cooper-hero-home-step-container::after,
    .cooper-hero-home-step-right:not(.cooper-hero-home-step-mobile-left) .cooper-hero-home-step-container::after {
        content: "";
        position: absolute;
        bottom: 0;
        right: 100%;
        left: auto;
        width: 100vw;
        height: 36px;
        background: inherit;
    }

    /* Móvil: Orden Vertical */
    .cooper-hero-home-mobile-v-top .cooper-hero-home-step-container {
        order: 1;
    }
    .cooper-hero-home-mobile-v-top .cooper-hero-home-lower-bar {
        order: 2;
    }

    .cooper-hero-home-mobile-v-bottom .cooper-hero-home-step-container {
        order: 2;
    }
    .cooper-hero-home-mobile-v-bottom .cooper-hero-home-lower-bar {
        order: 1;
    }

    .cooper-hero-home-red-card {
        min-height: 0;
        padding: 24px 20px;
    }

    .cooper-hero-home-title {
        font-size: clamp(1.75rem, 7.5vw, 2.25rem);
        line-height: 1.05;
    }

    .cooper-hero-home-lower-bar {
        order: 2;
        width: 100%;
        min-height: 0;
        flex-direction: column;
        align-items: stretch;
        padding: 16px var(--cooper-frame-lateral, 16px) 28px var(--cooper-frame-lateral, 16px);
        background: #ffffff;
    }

    .cooper-hero-home-left-content {
        gap: 6px;
        max-width: 100%;
    }

    .cooper-hero-home-bar-title.cooper-hero-home-hide-mobile {
        display: none !important;
    }

    .cooper-hero-home-bar-title {
        font-size: clamp(20px, 5.5vw, 24px);
        line-height: 1.2;
        font-weight: 750;
        letter-spacing: -0.015em;
        color: #111827;
        margin: 0 0 6px 0;
    }

    .cooper-hero-home-desc {
        font-size: 14.5px;
        line-height: 1.5;
        color: #4b5563;
        max-width: 330px;
    }

    .cooper-hero-home-btn-wrapper {
        margin-left: 0;
        margin-top: 16px;
    }
}
