/* ═══════════════════════════════════════════════════════════════════════
 * LZ Image Compare — Carrousel avant/après avec curseur glassmorphism
 * Couleurs : #152738 (marine) / #808186 (gris)
 * ═══════════════════════════════════════════════════════════════════════ */

/* ─── FORÇAGE WRAPPER ELEMENTOR (anti-shrink) ─────────────────────────── */
.elementor-widget-lz_compare,
.elementor-widget-lz_compare > .elementor-widget-container {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
}

.lz-cmp {
    position: relative;
    display: block !important;
    width: 100% !important;
    max-width: 100%;
    padding: 80px 0;
    background: #ffffff;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    box-sizing: border-box;
}

.lz-cmp *,
.lz-cmp *::before,
.lz-cmp *::after {
    box-sizing: border-box;
}

.lz-cmp__inner {
    display: block !important;
    width: 100% !important;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    box-sizing: border-box;
}

/* ─── EN-TÊTE ─────────────────────────────────────────────────────────── */
.lz-cmp__header {
    text-align: center;
    margin-bottom: 50px;
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

.lz-cmp__kicker {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-family: 'Manrope', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: #808186;
    margin-bottom: 18px;
}

.lz-cmp__kicker::before,
.lz-cmp__kicker::after {
    content: '';
    width: 34px;
    height: 1px;
    background: #808186;
    display: inline-block;
}

.lz-cmp__title {
    font-family: 'Manrope', sans-serif;
    font-weight: 800;
    font-size: 2.2rem;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: #152738;
    margin: 0 0 18px;
}

.lz-cmp__title-accent {
    color: #808186;
    font-style: italic;
    font-weight: 700;
    position: relative;
}

.lz-cmp__title-accent::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0.05em;
    height: 2px;
    background: currentColor;
    opacity: 0.4;
}

.lz-cmp__subtitle {
    font-size: 1rem;
    line-height: 1.6;
    color: #506069;
    margin: 0;
}

/* ─── CARROUSEL ───────────────────────────────────────────────────────── */
.lz-cmp__carousel {
    position: relative;
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 16px 50px -12px rgba(21, 39, 56, 0.25);
}

.lz-cmp__slides {
    position: relative;
    width: 100%;
}

.lz-cmp__slide {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    user-select: none;
    display: none;
}

.lz-cmp__slide.is-active {
    display: block;
}

/* ─── IMAGES ──────────────────────────────────────────────────────────── */
.lz-cmp__img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    user-select: none;
    -webkit-user-drag: none;
    display: block;
}

/* L'image AVANT est dans un wrapper qui la clippe selon le curseur */
.lz-cmp__before-wrap {
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    z-index: 2;
    /* width ou height contrôlés dynamiquement par JS */
    will-change: width, height;
}

.lz-cmp--orient-horizontal .lz-cmp__before-wrap {
    height: 100%;
    width: 50%; /* défaut, écrasé par PHP */
}

.lz-cmp--orient-vertical .lz-cmp__before-wrap {
    width: 100%;
    height: 50%; /* défaut, écrasé par PHP */
}

/* Empêcher l'image AVANT de se redimensionner avec son wrapper clippé */
.lz-cmp--orient-horizontal .lz-cmp__before-wrap .lz-cmp__img--before {
    width: 100vw;
    max-width: none;
}

.lz-cmp--orient-horizontal .lz-cmp__before-wrap {
    /* L'image AVANT doit avoir la même taille que l'APRÈS pour matcher visuellement */
}

/* Solution : on remet width: 100% sur l'image AVANT et on s'assure que 
   le wrapper applique 100% de la largeur de son parent .lz-cmp__slide */
.lz-cmp__before-wrap .lz-cmp__img--before {
    width: 100%;
    height: 100%;
}

/* Mais on a un problème : si le wrapper fait 30%, l'image dedans fait 100% de 30% = ratatinée
   Il faut donc fixer l'image AVANT à la taille du SLIDE PARENT, pas du wrapper */
.lz-cmp--orient-horizontal .lz-cmp__before-wrap .lz-cmp__img--before {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Pour que l'image garde sa taille originale même si le wrapper est clippé */
    min-width: 0;
}

/* En réalité, la SOLUTION : utiliser clip-path au lieu de wrapper clippé */
/* Mais on garde le wrapper pour la compatibilité, et on force l'image à 
   prendre la taille du SLIDE via une technique CSS */
.lz-cmp__slide {
    position: relative;
}

/* ─── DIVIDER (ligne du curseur) ──────────────────────────────────────── */
.lz-cmp__divider {
    position: absolute;
    z-index: 5;
    background: #ffffff;
    box-shadow: 0 0 16px rgba(0, 0, 0, 0.3);
    will-change: transform;
}

.lz-cmp--orient-horizontal .lz-cmp__divider {
    top: 0;
    bottom: 0;
    width: 3px;
    transform: translateX(-50%);
    cursor: ew-resize;
}

.lz-cmp--orient-vertical .lz-cmp__divider {
    left: 0;
    right: 0;
    height: 3px;
    transform: translateY(-50%);
    cursor: ns-resize;
}

/* ─── HANDLE PREMIUM (glassmorphism) ──────────────────────────────────── */
.lz-cmp__handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    color: #152738;
    border: 2px solid rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow:
        0 8px 28px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset,
        0 4px 12px rgba(21, 39, 56, 0.15);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    cursor: inherit;
    padding: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.lz-cmp__handle:hover {
    transform: translate(-50%, -50%) scale(1.08);
    box-shadow:
        0 12px 36px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.3) inset,
        0 6px 16px rgba(21, 39, 56, 0.25);
}

.lz-cmp__handle:active {
    transform: translate(-50%, -50%) scale(0.95);
}

.lz-cmp__handle-icon {
    flex-shrink: 0;
}

/* Décalage des chevrons pour qu'ils soient légèrement séparés */
.lz-cmp--orient-horizontal .lz-cmp__handle-icon:first-child {
    margin-right: -4px;
}

.lz-cmp--orient-horizontal .lz-cmp__handle-icon:last-child {
    margin-left: -4px;
}

.lz-cmp--orient-vertical .lz-cmp__handle {
    flex-direction: column;
}

.lz-cmp--orient-vertical .lz-cmp__handle-icon:first-child {
    margin-bottom: -4px;
}

.lz-cmp--orient-vertical .lz-cmp__handle-icon:last-child {
    margin-top: -4px;
}

/* ─── LABELS AVANT / APRÈS ────────────────────────────────────────────── */
.lz-cmp__label {
    position: absolute;
    z-index: 3;
    padding: 8px 18px;
    background: rgba(21, 39, 56, 0.95);
    color: #ffffff;
    font-family: 'Manrope', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    border-radius: 100px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    pointer-events: none;
}

.lz-cmp__label--before {
    background: rgba(128, 129, 134, 0.95);
}

.lz-cmp__label--after {
    background: rgba(21, 39, 56, 0.95);
}

/* Position : haut */
.lz-cmp--labels-top .lz-cmp__label--before { top: 16px; left: 16px; }
.lz-cmp--labels-top .lz-cmp__label--after  { top: 16px; right: 16px; }

/* Position : bas */
.lz-cmp--labels-bottom .lz-cmp__label--before { bottom: 16px; left: 16px; }
.lz-cmp--labels-bottom .lz-cmp__label--after  { bottom: 16px; right: 16px; }

/* Orientation verticale : labels en haut/bas plutôt que gauche/droite */
.lz-cmp--orient-vertical .lz-cmp__label--before {
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    bottom: auto;
}

.lz-cmp--orient-vertical .lz-cmp__label--after {
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    top: auto;
    right: auto;
}

/* Mode sans labels */
.lz-cmp--no-labels .lz-cmp__label {
    display: none;
}

/* ─── LÉGENDE SOUS L'IMAGE ────────────────────────────────────────────── */
.lz-cmp__caption-wrap {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 3;
    padding: 16px 24px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.6) 100%);
    text-align: center;
    pointer-events: none;
}

.lz-cmp__caption {
    font-family: 'Manrope', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: -0.01em;
}

.lz-cmp--no-caption .lz-cmp__caption-wrap {
    display: none;
}

/* ─── FLÈCHES DU CARROUSEL ────────────────────────────────────────────── */
.lz-cmp__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 6;
    width: 48px;
    height: 48px;
    background: #152738;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px -6px rgba(21, 39, 56, 0.4);
    transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
    padding: 0;
}

.lz-cmp__arrow:hover {
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 10px 28px -6px rgba(21, 39, 56, 0.55);
}

.lz-cmp__arrow:active {
    transform: translateY(-50%) scale(0.95);
}

.lz-cmp__arrow--prev { left: 16px; }
.lz-cmp__arrow--next { right: 16px; }

.lz-cmp--no-arrows .lz-cmp__arrow {
    display: none;
}

/* ─── DOTS ────────────────────────────────────────────────────────────── */
.lz-cmp__dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
}

.lz-cmp__dot {
    width: 28px;
    height: 3px;
    background: rgba(21, 39, 56, 0.2);
    border: none;
    cursor: pointer;
    border-radius: 2px;
    padding: 0;
    transition: background 0.3s ease, width 0.3s ease;
}

.lz-cmp__dot.is-active {
    background: #152738;
    width: 40px;
}

.lz-cmp--no-dots .lz-cmp__dots {
    display: none;
}

/* ─── EMPTY STATE ─────────────────────────────────────────────────────── */
.lz-cmp__empty {
    padding: 60px 30px;
    text-align: center;
    color: #506069;
    background: #f7f8f9;
    border-radius: 8px;
    margin: 20px;
}

/* ─── RESPONSIVE ───────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .lz-cmp { padding: 60px 0; }
    .lz-cmp__inner { padding: 0 30px; }
    .lz-cmp__handle {
        width: 50px;
        height: 50px;
    }
    .lz-cmp__handle-icon {
        width: 18px;
        height: 18px;
    }
    .lz-cmp__arrow {
        width: 42px;
        height: 42px;
    }
}

@media (max-width: 600px) {
    .lz-cmp { padding: 50px 0; }
    .lz-cmp__inner { padding: 0 20px; }
    .lz-cmp__header {
        margin-bottom: 32px;
    }
    .lz-cmp__title {
        font-size: 1.6rem;
    }
    .lz-cmp__handle {
        width: 44px;
        height: 44px;
    }
    .lz-cmp__handle-icon {
        width: 16px;
        height: 16px;
    }
    .lz-cmp__arrow {
        width: 38px;
        height: 38px;
    }
    .lz-cmp__arrow--prev { left: 10px; }
    .lz-cmp__arrow--next { right: 10px; }
    .lz-cmp__label {
        padding: 6px 12px;
        font-size: 0.65rem;
        letter-spacing: 0.15em;
    }
    .lz-cmp--labels-top .lz-cmp__label--before { top: 12px; left: 12px; }
    .lz-cmp--labels-top .lz-cmp__label--after  { top: 12px; right: 12px; }
    .lz-cmp__caption {
        font-size: 0.9rem;
    }
    .lz-cmp__caption-wrap {
        padding: 12px 16px;
    }
}
