/* ============================================================
   ELITE CONSTRUCTION — Before / After Slider — Styles
   ============================================================ */

/* ---- Wrapper principal ---- */
.ba-slider {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 10px;
  cursor: ew-resize;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;           /* scroll vertical OK, horizontal géré par JS */
  box-shadow: 0 8px 40px rgba(0,0,0,0.22);
  background: #111;
}

/* ---- Images ---- */
.ba-before,
.ba-after {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}

/* Image BEFORE — en dessous */
.ba-before {
  position: absolute;
  inset: 0;
}

/* Image AFTER — par-dessus, clippée par JS */
.ba-after {
  position: absolute;
  inset: 0;
  clip-path: inset(0 50% 0 0);   /* valeur initiale, mise à jour par JS */
  will-change: clip-path;
}

/* ---- Séparateur vertical ---- */
.ba-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  background: #fff;
  transform: translateX(-50%);
  z-index: 10;
  cursor: ew-resize;
  will-change: left;
  outline: none;
}

.ba-handle::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, transparent 0%, rgba(201,168,76,0.6) 40%, rgba(201,168,76,0.6) 60%, transparent 100%);
}

/* ---- Bouton central circulaire ---- */
.ba-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  background: var(--gold, #C9A84C);
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.2s, box-shadow 0.2s;
  pointer-events: none;
  z-index: 11;
}

.ba-slider:hover .ba-btn,
.ba-handle:focus .ba-btn {
  transform: translate(-50%, -50%) scale(1.12);
  box-shadow: 0 6px 28px rgba(201,168,76,0.5);
}

/* Flèches dans le bouton */
.ba-btn svg {
  fill: #1C1C1C;
  width: 20px;
  height: 20px;
}

/* ---- Étiquettes AVANT / APRÈS ---- */
.ba-label {
  position: absolute;
  top: 1.1rem;
  z-index: 12;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.3rem 0.9rem;
  border-radius: 100px;
  pointer-events: none;
  transition: opacity 0.3s;
}

.ba-label-before {
  left: 1rem;
  background: rgba(28,28,28,0.75);
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(4px);
}

.ba-label-after {
  right: 1rem;
  background: var(--gold, #C9A84C);
  color: #1C1C1C;
}

/* ---- Placeholder (ratio) ---- */
.ba-placeholder {
  display: block;
  width: 100%;
}

/* ---- Tailles prédéfinies ---- */
.ba-slider--sm  { height: 280px; }
.ba-slider--md  { height: 420px; }
.ba-slider--lg  { height: 540px; }
.ba-slider--xl  { height: 640px; }
.ba-slider--full { height: 70vh; min-height: 400px; }

/* ---- Caption / Légende sous le slider ---- */
.ba-caption {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  background: var(--off-white, #F7F5F0);
  border-left: 4px solid var(--gold, #C9A84C);
  border-radius: 0 8px 8px 0;
}

.ba-caption i {
  color: var(--gold, #C9A84C);
  font-size: 1rem;
  margin-top: 3px;
  flex-shrink: 0;
}

.ba-caption-text {
  font-size: 0.88rem;
  color: #555;
  line-height: 1.6;
}

.ba-caption-text strong {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  color: #1C1C1C;
  display: block;
  margin-bottom: 2px;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .ba-slider--lg  { height: 360px; }
  .ba-slider--xl  { height: 420px; }
  .ba-slider--full { height: 55vw; min-height: 260px; }
  .ba-btn { width: 44px; height: 44px; }
  .ba-label { font-size: 0.65rem; padding: 0.25rem 0.7rem; }
}

@media (max-width: 480px) {
  .ba-slider--md  { height: 260px; }
  .ba-slider--lg  { height: 300px; }
  .ba-btn { width: 38px; height: 38px; gap: 4px; }
  .ba-btn svg { width: 16px; height: 16px; }
}

/* ---- Animation d'invitation (wiggle au chargement) ---- */
@keyframes ba-hint {
  0%   { left: 50%; }
  20%  { left: 35%; }
  50%  { left: 65%; }
  80%  { left: 40%; }
  100% { left: 50%; }
}

.ba-slider--hint .ba-handle {
  animation: ba-hint 1.6s ease-in-out 0.8s 1 forwards;
}
