/**
 * WeXchange bg Video — Style
 * Widget vidéo transparente d'arrière-plan avec image de secours (fallback) responsive
 */

.wex-bg-video-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    box-sizing: border-box;
}

/* Ratio container when used */
.wex-bg-video-container.has-aspect-ratio {
    height: auto;
}

/* Fallback layer (CSS background + optional SVG/image) */
.wex-bg-video-fallback {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background-color: transparent;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .45s cubic-bezier(.4, 0, .2, 1), visibility .45s ease;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: contain;
    background-attachment: scroll;
}

/* Video element */
.wex-bg-video-element {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    object-fit: contain;
    object-position: center center;
    background: transparent !important;
    border: none;
    outline: none;
    margin: 0;
    padding: 0;
    opacity: 1;
    transition: opacity .45s cubic-bezier(.4, 0, .2, 1);
    pointer-events: none; /* Let clicks pass through to content */
}

/* When fallback is active */
.wex-bg-video-container.wex-fallback-active .wex-bg-video-fallback {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.wex-bg-video-container.wex-fallback-active .wex-bg-video-element {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Overlay layer */
.wex-bg-video-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
    transition: background-color .3s ease, opacity .3s ease;
}

/* Content layer on top of video/fallback */
.wex-bg-video-content {
    position: relative;
    z-index: 4;
    width: 100%;
    max-width: 1200px;
    padding: 40px 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.wex-bg-video-content.is-empty {
    padding: 0;
    pointer-events: none;
}

/* Eyebrow / Sur-titre */
.wex-bg-video-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: #f08150;
}

/* Title */
.wex-bg-video-title {
    margin: 0 0 16px;
    font-size: 38px;
    font-weight: 700;
    line-height: 1.25;
    color: #333333;
    word-break: break-word;
}

/* Description */
.wex-bg-video-desc {
    margin: 0 0 24px;
    font-size: 17px;
    line-height: 1.6;
    color: #555555;
    max-width: 750px;
}

/* Buttons group */
.wex-bg-video-buttons {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-top: 8px;
}

.wex-bg-video-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none !important;
    transition: all .25s ease;
    cursor: pointer;
}

.wex-bg-video-btn--primary {
    background-color: #f08150;
    color: #ffffff !important;
    border: 2px solid #f08150;
}

.wex-bg-video-btn--primary:hover {
    background-color: #e06f3e;
    border-color: #e06f3e;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(240, 129, 80, .35);
}

.wex-bg-video-btn--secondary {
    background-color: transparent;
    color: #333333 !important;
    border: 2px solid #333333;
}

.wex-bg-video-btn--secondary:hover {
    background-color: #333333;
    color: #ffffff !important;
    transform: translateY(-2px);
}

/* Alignment utilities */
.wex-align-left {
    align-items: flex-start;
    text-align: left;
}
.wex-align-left .wex-bg-video-desc {
    margin-left: 0;
    margin-right: auto;
}
.wex-align-left .wex-bg-video-buttons {
    justify-content: flex-start;
}

.wex-align-center {
    align-items: center;
    text-align: center;
}
.wex-align-center .wex-bg-video-desc {
    margin-left: auto;
    margin-right: auto;
}
.wex-align-center .wex-bg-video-buttons {
    justify-content: center;
}

.wex-align-right {
    align-items: flex-end;
    text-align: right;
}
.wex-align-right .wex-bg-video-desc {
    margin-left: auto;
    margin-right: 0;
}
.wex-align-right .wex-bg-video-buttons {
    justify-content: flex-end;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .wex-bg-video-title {
        font-size: 32px;
    }
    .wex-bg-video-desc {
        font-size: 16px;
    }
}

@media (max-width: 767px) {
    .wex-bg-video-content {
        padding: 30px 15px;
    }
    .wex-bg-video-title {
        font-size: 26px;
    }
    .wex-bg-video-desc {
        font-size: 15px;
    }
    .wex-bg-video-buttons {
        width: 100%;
        flex-direction: column;
    }
    .wex-bg-video-btn {
        width: 100%;
    }
}
