/* ═══════════════════════════════════════════════════════
   TEH IMAGE COMPARE — Design moderne Before/After
   ═══════════════════════════════════════════════════════ */

/* Header moderne avec gradient text */
.teic-header{text-align:center;margin-bottom:32px;}
.teic-heading{
    font-size:clamp(24px,3.5vw,34px);
    font-weight:900;
    margin:0 0 10px;
    background:linear-gradient(135deg,#193353,#507a2e);
    -webkit-background-clip:text;
    background-clip:text;
    -webkit-text-fill-color:transparent;
    letter-spacing:-.02em;
    line-height:1.15;
}
.teic-sub{font-size:15px;color:#5a6478;margin:0;line-height:1.6;font-weight:500;}

/* Container moderne */
.teic-container{
    --teh-blue:#193353;
    --teh-green:#507a2e;
    --teh-orange:#e05512;
    --teh-orange-light:#f07a3a;
    position:relative;overflow:hidden;cursor:col-resize;
    user-select:none;-webkit-user-select:none;
    margin:0 auto;border-radius:24px;
    background:#f0f0f0;
    box-shadow:0 20px 60px rgba(25,51,83,.18),0 4px 16px rgba(25,51,83,.08);
}
.teic-vertical{cursor:row-resize;}

/* ══ FIT MODES ══ */

/* AUTO : hauteur s'adapte à l'image (photos portrait OK) */
.teic-fit-auto{height:auto!important;}
.teic-fit-auto .teic-layer{position:relative;}
.teic-fit-auto .teic-layer.teic-before{position:absolute;inset:0;}
.teic-fit-auto .teic-after img{
    width:100%!important;height:auto!important;display:block!important;
    object-fit:contain!important;
}
.teic-fit-auto .teic-before img{
    width:100%!important;height:100%!important;display:block!important;
    object-fit:cover!important;
}

/* COVER : remplit, coupe les bords */
.teic-fit-cover{height:450px;}
.teic-fit-cover .teic-layer img{
    width:100%!important;height:100%!important;object-fit:cover!important;display:block!important;
}

/* CONTAIN : voit toute l'image, bandes possibles */
.teic-fit-contain{height:450px;background:#111;}
.teic-fit-contain .teic-layer img{
    width:100%!important;height:100%!important;object-fit:contain!important;display:block!important;
}

/* FIXED : hauteur personnalisée via le slider Elementor */
.teic-fit-fixed{height:450px;}
.teic-fit-fixed .teic-layer img{
    width:100%!important;height:100%!important;object-fit:cover!important;display:block!important;
}

/* Layers */
.teic-layer{position:absolute;inset:0;}

/* Before layer clipped */
.teic-before{z-index:2;}
.teic-after{z-index:1;}

/* Common img styles */
.teic-layer img{pointer-events:none;user-select:none;-webkit-user-drag:none;}

/* Overlay */
.teic-overlay{position:absolute;inset:0;z-index:3;opacity:0;transition:opacity .3s;pointer-events:none;}
.teic-container:hover .teic-overlay{opacity:1;}

/* ══ HANDLE ══ */
.teic-handle{
    position:absolute;z-index:10;
    display:flex;align-items:center;justify-content:center;
    pointer-events:none;
}

/* Horizontal handle positioning */
.teic-horizontal .teic-handle{
    top:0;bottom:0;
    transform:translateX(-50%);
}
/* Vertical handle positioning */
.teic-vertical .teic-handle{
    left:0;right:0;
    transform:translateY(-50%);
}

.teic-handle-grip{
    display:flex;align-items:center;justify-content:center;
    flex-shrink:0;cursor:pointer;pointer-events:all;
    transition:all .35s cubic-bezier(.25,.8,.25,1);
    z-index:11;
    box-shadow:0 8px 24px rgba(224,85,18,.5),0 0 0 6px rgba(255,255,255,.25);
}
.teic-handle-grip:hover{transform:scale(1.15);box-shadow:0 12px 32px rgba(224,85,18,.65),0 0 0 8px rgba(255,255,255,.3);}
.teic-container:active .teic-handle-grip{transform:scale(0.95);}

.teic-arrows{
    display:flex;gap:2px;
}
.teic-horizontal .teic-arrows{flex-direction:row;}
.teic-vertical .teic-arrows{flex-direction:column;}

/* ══ LABELS moderne avec pill gradient ══ */
.teic-label{
    position:absolute;z-index:8;
    font-size:12px;font-weight:800;letter-spacing:1.2px;text-transform:uppercase;
    opacity:0;transition:all .4s cubic-bezier(.25,.8,.25,1);
    pointer-events:none;white-space:nowrap;
    padding:8px 18px;
    border-radius:50px;
    color:#fff;
    backdrop-filter:blur(10px);
    -webkit-backdrop-filter:blur(10px);
    box-shadow:0 8px 24px rgba(0,0,0,.25);
}
.teic-label-before{
    background:linear-gradient(135deg,rgba(25,51,83,.85),rgba(42,74,117,.85));
    border:1px solid rgba(255,255,255,.2);
}
.teic-label-after{
    background:linear-gradient(135deg,var(--teh-orange,#e05512),var(--teh-orange-light,#f07a3a));
    box-shadow:0 8px 24px rgba(224,85,18,.45);
}
.teic-labels-always .teic-label{opacity:1!important;}
.teic-container:hover .teic-label{opacity:1;}

/* Horizontal label positions */
.teic-horizontal .teic-label-before{left:16px;}
.teic-horizontal .teic-label-after{right:16px;}
.teic-horizontal .teic-label-top{top:16px;}
.teic-horizontal .teic-label-bottom{bottom:16px;}
.teic-horizontal .teic-label-middle{top:50%;transform:translateY(-50%);}

/* Vertical label positions */
.teic-vertical .teic-label-before{top:16px;left:50%;transform:translateX(-50%);}
.teic-vertical .teic-label-after{bottom:16px;left:50%;transform:translateX(-50%);}
.teic-vertical .teic-label-top.teic-label-before{top:16px;}
.teic-vertical .teic-label-bottom.teic-label-after{bottom:16px;}

/* ══ RESPONSIVE ══ */
@media(max-width:768px){
    .teic-container:not(.teic-fit-auto){height:300px!important;}
    .teic-container{border-radius:12px;}
    .teic-label{font-size:11px;letter-spacing:.5px;}
    .teic-handle-grip{transform:scale(.85);}
}
@media(max-width:480px){
    .teic-container:not(.teic-fit-auto){height:240px!important;}
    .teic-container{border-radius:10px;}
    .teic-handle-grip{transform:scale(.75);}
}
