/* ==========================================================================
   Cooper Suite: Hero Banner Widget Styles
   ========================================================================== */

:root {
    --cooper-hero-accent: #d32f2f;
    --cooper-hero-title-dark: #111827;
    --cooper-hero-desc-color: #4b5563;
    --cooper-hero-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.cooper-hero-wrapper {
    --cooper-frame-lateral: 60px;
    position: relative;
    width: 100%;
    margin: 0 auto;
    overflow: hidden;
    font-family: var(--cooper-hero-font-family);
    box-sizing: border-box;
    background-color: #0f172a;
    --cooper-btn-text-bg: #c8102e;
    --cooper-btn-text-color: #ffffff;
    --cooper-btn-icon-bg: #c8102e;
    --cooper-btn-icon-color: #ffffff;
    --cooper-btn-text-bg-hover: #000000;
    --cooper-btn-text-color-hover: #ffffff;
    --cooper-btn-icon-bg-hover: #000000;
    --cooper-btn-icon-color-hover: #ffffff;
    --cooper-btn-gap: 3px;
    --cooper-btn-radius: 0px;
}

.cooper-hero-wrapper * {
    box-sizing: border-box;
}

.cooper-hero-wrapper .cooper-btn-wrapper {
    width: auto;
    margin: 0;
    padding: 0;
}

/* ==========================================================================
   Hero Media Layer (Image, Self-Hosted Video, YouTube)
   ========================================================================== */

.cooper-hero-media-wrap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.cooper-hero-img-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.cooper-hero-video-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.cooper-hero-yt-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100vw;
    height: 56.25vw; /* 16:9 aspect ratio */
    min-height: 100vh;
    min-width: 177.77vh;
    transform: translate(-50%, -50%);
    pointer-events: none;
    border: none;
}

.cooper-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.25);
    z-index: 2;
}

/* ==========================================================================
   Entrance Animation: Elegant Vertical Curtain Reveal
   Formula: clip-path inset(100% 0 0 0) -> inset(0 0 0 0)
   Transform: translateY(45px) -> translateY(0)
   Duration: 1.1s cubic-bezier(0.22, 1, 0.36, 1)
   ========================================================================== */

.cooper-hero-curtain-init {
    clip-path: inset(100% 0 0 0);
    -webkit-clip-path: inset(100% 0 0 0);
    transform: translateY(45px);
    opacity: 0;
    will-change: clip-path, transform, opacity;
}

.cooper-hero-curtain-animate {
    clip-path: inset(0 0 0 0) !important;
    -webkit-clip-path: inset(0 0 0 0) !important;
    transform: translateY(0) !important;
    opacity: 1 !important;
    transition: clip-path 1.1s cubic-bezier(0.22, 1, 0.36, 1),
                -webkit-clip-path 1.1s cubic-bezier(0.22, 1, 0.36, 1),
                transform 1.1s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

/* Post-Animation Final State (Guarantees zero clipping and full visibility) */
.cooper-hero-curtain-done {
    clip-path: none !important;
    -webkit-clip-path: none !important;
    transform: none !important;
    opacity: 1 !important;
    transition: none !important;
}

/* Accessibility: Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .cooper-hero-curtain-init,
    .cooper-hero-curtain-animate,
    .cooper-hero-curtain-done {
        clip-path: none !important;
        -webkit-clip-path: none !important;
        transform: none !important;
        opacity: 1 !important;
        transition: none !important;
    }
}

/* ==========================================================================
   Floating Play Video Button (Plantilla 2 and optional)
   ========================================================================== */

.cooper-hero-play-btn-wrap {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.cooper-hero-play-btn {
    display: inline-flex;
    align-items: stretch;
    background: rgba(17, 24, 39, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    padding: 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.cooper-hero-play-btn:hover {
    background: #000000;
    transform: translateY(-2px);
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.35);
}

.cooper-hero-play-label {
    padding: 12px 20px;
    display: flex;
    align-items: center;
}

.cooper-hero-play-icon {
    width: 44px;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 13px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   FAMILIA A: Split Architectural Step (Plantillas 1, 2, 3, 4)
   ========================================================================== */

.cooper-hero-split-container {
    position: relative;
    z-index: 10;
    min-height: var(--cooper-hero-height, 85vh);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

/* ==========================================================================
   PLANTILLA 1: Architectural Stepped Notch (New Reference)
   - Left side: Elevated solid white stepped container cutting upwards into media.
     Contains the Title in bold, black uppercase typography.
     Aligned with left frame padding (--cooper-frame-lateral, 60px).
   - Right side: Lower solid white horizontal bar.
     Contains the description text and the Cooper button on the far right.
     Ends at right frame padding (--cooper-frame-lateral, 60px).
   ========================================================================== */

.cooper-hero-p1-wrap {
    width: 100%;
    position: relative;
    z-index: 12;
    display: flex;
    align-items: flex-end;
}

/* Left elevated white stepped container */
.cooper-hero-p1-step-container {
    flex: 0 0 auto;
    width: fit-content;
    min-width: 400px;
    max-width: 48%;
    background: #ffffff;
    padding: 42px 48px 34px var(--cooper-frame-lateral, 60px);
    min-height: 195px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    box-sizing: border-box;
}

.cooper-hero-p1-title {
    margin: 0;
    font-size: clamp(2.4rem, 4.4vw, 4.4rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.0;
    color: #000000;
    text-transform: uppercase;
    word-break: break-word;
}

/* Right lower white bar (Description + Button) */
.cooper-hero-p1-lower-bar {
    flex: 1;
    background: #ffffff;
    padding: 24px var(--cooper-frame-lateral, 60px) 24px 45px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 120px;
    align-self: flex-end;
    box-sizing: border-box;
    gap: 30px;
}

.cooper-hero-p1-desc {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    color: #4b5563;
    max-width: 440px;
    flex: 0 1 440px;
}

/* Button in Plantilla 1:
   Positioned at the far right of the lower bar,
   aligned to right margin with --cooper-frame-lateral */
.cooper-hero-p1-lower-bar .cooper-btn-wrapper {
    width: auto !important;
    flex: 0 0 auto !important;
    margin-left: auto;
    margin-right: 0;
    margin-bottom: 0;
}

.cooper-hero-p1-lower-bar .cooper-btn-text {
    padding: 13px 22px;
    font-size: 15px;
    font-weight: 700;
}

.cooper-hero-p1-lower-bar .cooper-btn-icon {
    width: 46px;
}

/* Plantillas 2, 3, 4: Left Step (White box elevated on left, description on right) */
.cooper-hero-p234-bottom-bar {
    width: 100%;
    display: flex;
    align-items: flex-end;
    position: relative;
    z-index: 12;
}

.cooper-hero-p234-left-card {
    flex: 1.35;
    background: #ffffff;
    padding: 45px 60px 40px var(--cooper-frame-lateral, 60px);
    min-height: 240px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    position: relative;
    z-index: 13;
}

.cooper-hero-eyebrow {
    display: inline-block;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--cooper-hero-accent, #d32f2f);
    margin-bottom: 16px;
}

.cooper-hero-p234-title {
    margin: 0;
    font-size: clamp(2.2rem, 4.2vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.08;
    color: #111827;
    text-transform: uppercase;
}

.cooper-hero-p234-right-area {
    flex: 1;
    background: #ffffff;
    padding: 35px 50px;
    min-height: 135px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    position: relative;
    z-index: 12;
    align-self: flex-end;
}

.cooper-hero-p234-desc {
    margin: 0;
    font-size: 16px;
    line-height: 1.65;
    color: #4b5563;
    max-width: 520px;
}

/* ==========================================================================
   FAMILIA B: Floating Stepped Card (Plantillas 5, 6, 7)
   ========================================================================== */

.cooper-hero-floating-container {
    position: relative;
    z-index: 5;
    min-height: var(--cooper-hero-height, 90vh);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0 var(--cooper-frame-lateral, 60px) 60px var(--cooper-frame-lateral, 60px);
}

/* Stepped Card Shape with Top-Left Tab */
.cooper-hero-stepped-card {
    position: relative;
    max-width: 580px;
    width: 100%;
    z-index: 10;
    display: flex;
    flex-direction: column;
}

/* Top Tab / Stepped Notch */
.cooper-hero-card-tab {
    align-self: flex-start;
    padding: 12px 28px;
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    position: relative;
    z-index: 2;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

/* Main Body of Stepped Card */
.cooper-hero-card-body {
    padding: 40px 45px 45px 45px;
    position: relative;
    z-index: 1;
}

.cooper-hero-card-sub-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 12px;
    display: block;
    opacity: 0.8;
}

.cooper-hero-card-title {
    margin: 0 0 16px 0;
    font-size: clamp(2rem, 3.2vw, 3.2rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.12;
}

.cooper-hero-card-desc {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
}

/* Theme variations for Plantillas 5, 6, 7 */

/* Plantilla 5: Light / Lavender Gray Card (Education / Projects) */
.cooper-hero-theme-light .cooper-hero-card-tab {
    background: #e2e4ea;
    color: #111827;
}

.cooper-hero-theme-light .cooper-hero-card-body {
    background: #e2e4ea;
    color: #111827;
}

.cooper-hero-theme-light .cooper-hero-card-title {
    color: #111827;
}

.cooper-hero-theme-light .cooper-hero-card-desc {
    color: #4b5563;
}

/* Plantilla 6: Red Stepped Card (Preconstruction / Services) */
.cooper-hero-theme-red .cooper-hero-card-tab {
    background: var(--cooper-hero-accent, #d32f2f);
    color: #ffffff;
}

.cooper-hero-theme-red .cooper-hero-card-body {
    background: var(--cooper-hero-accent, #d32f2f);
    color: #ffffff;
}

.cooper-hero-theme-red .cooper-hero-card-title {
    color: #ffffff;
}

.cooper-hero-theme-red .cooper-hero-card-desc {
    color: rgba(255, 255, 255, 0.9);
}

/* Plantilla 7: Sand / Beige Stepped Card (Industrial / Markets) */
.cooper-hero-theme-sand .cooper-hero-card-tab {
    background: #e0d3b4;
    color: #111827;
}

.cooper-hero-theme-sand .cooper-hero-card-body {
    background: #e0d3b4;
    color: #111827;
}

.cooper-hero-theme-sand .cooper-hero-card-title {
    color: #111827;
}

.cooper-hero-theme-sand .cooper-hero-card-desc {
    color: #374151;
}

/* ==========================================================================
   Video Lightbox Modal
   ========================================================================== */

.cooper-hero-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(8px);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.cooper-hero-modal.is-open {
    display: flex;
}

.cooper-hero-modal-content {
    position: relative;
    width: 100%;
    max-width: 960px;
    aspect-ratio: 16 / 9;
    background: #000000;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.cooper-hero-modal-content iframe,
.cooper-hero-modal-content video {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.cooper-hero-modal-close {
    position: absolute;
    top: -45px;
    right: 0;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    padding: 0 10px;
    transition: opacity 0.2s ease;
}

.cooper-hero-modal-close:hover {
    opacity: 0.7;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

@media (max-width: 1024px) {
    .cooper-hero-wrapper {
        --cooper-frame-lateral: 40px;
    }

    .cooper-hero-p1-wrap {
        flex-direction: column;
        align-items: stretch;
    }

    .cooper-hero-p1-step-container {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        margin-top: 0;
        padding: 30px var(--cooper-frame-lateral, 40px) 14px var(--cooper-frame-lateral, 40px);
        min-height: auto;
    }

    .cooper-hero-p1-lower-bar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 10px var(--cooper-frame-lateral, 40px) 30px var(--cooper-frame-lateral, 40px);
        min-height: auto;
        gap: 24px;
    }

    .cooper-hero-p1-desc {
        max-width: 100%;
    }

    .cooper-hero-p1-lower-bar .cooper-btn-wrapper {
        margin-left: auto;
        margin-right: 0;
        margin-top: 0;
        width: auto !important;
    }

    .cooper-hero-p234-bottom-bar {
        grid-template-columns: 1fr;
    }

    .cooper-hero-p234-left-card {
        margin-top: 0;
        padding: 35px 30px 25px 30px;
    }

    .cooper-hero-p234-right-area {
        padding: 20px 30px 35px 30px;
    }

    .cooper-hero-floating-container {
        padding: 0 var(--cooper-frame-lateral, 40px) 40px var(--cooper-frame-lateral, 40px);
    }
}

@media (max-width: 767px) {
    .cooper-hero-wrapper {
        --cooper-frame-lateral: 16px;
    }

    .cooper-hero-p1-step-container {
        padding: 24px var(--cooper-frame-lateral, 16px) 12px var(--cooper-frame-lateral, 16px);
    }

    .cooper-hero-p1-title {
        font-size: clamp(1.8rem, 7.5vw, 2.4rem);
        line-height: 1.05;
    }

    .cooper-hero-p1-lower-bar {
        flex-direction: column;
        align-items: flex-start;
        padding: 6px var(--cooper-frame-lateral, 16px) 24px var(--cooper-frame-lateral, 16px);
        gap: 16px;
    }

    .cooper-hero-p1-desc {
        font-size: 14px;
        line-height: 1.45;
    }

    .cooper-hero-p1-lower-bar .cooper-btn-wrapper {
        width: 100% !important;
        margin: 0;
    }

    .cooper-hero-p1-lower-bar .cooper-btn-link {
        width: 100%;
    }

    .cooper-hero-p234-title {
        font-size: 2rem;
    }

    .cooper-hero-card-title {
        font-size: 1.7rem;
    }

    .cooper-hero-card-body {
        padding: 25px 20px;
    }

    .cooper-hero-floating-container {
        padding: 0 var(--cooper-frame-lateral, 16px) 24px var(--cooper-frame-lateral, 16px);
    }

    .cooper-hero-card-tab {
        padding: 10px 18px;
        font-size: 12px;
    }
}
