/* ================================
   BEFORE AFTER PROYECTOS - PRO VERSION
================================ */
.ba-card {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.ba-card:nth-child(1) { transition-delay: 0.1s; }
.ba-card:nth-child(2) { transition-delay: 0.2s; }
.ba-card:nth-child(3) { transition-delay: 0.3s; }
.ba-card:nth-child(4) { transition-delay: 0.4s; }

.ba-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.before-after {
  background: #e6e7e4;
  padding: 70px 6% 120px;
  color: #111;
}

/* HEADER */

.ba-header {
  text-align: center;
  max-width: 900px;
  margin: 0 auto 70px;

  /* animación */
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.ba-header.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.ba-eyebrow {
  display: block;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  opacity: 0;
  margin-bottom: 24px;

  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.ba-header h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 68px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;

  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

/* cuando entra en pantalla */

.ba-header.is-visible .ba-eyebrow {
  opacity: 0.7;
  transform: translateY(0);
  transition-delay: 0.1s;
}

.ba-header.is-visible h2 {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.25s;
}


/* GRID */

.ba-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
  max-width: 1700px;
  margin: 0 auto;
}

/* CARD */

.ba-card {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* CONTENEDOR IMAGEN */

.ba-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
  touch-action: pan-y; 
}
/* Animación de entrada de wrapper */
.ba-wrapper.fade-in-init {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.ba-wrapper.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Divider feedback */
.ba-divider.active {
  width: 3px;
  background: rgba(255,255,255,1);
  box-shadow: 0 0 8px rgba(255,255,255,0.4);
  transition: all 0.3s ease;
}

/* IMÁGENES */

.ba-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

/* CAPA ANTES */

.ba-before {
  position: absolute;
  inset: 0;
  width: 50%;
  overflow: hidden;
  pointer-events: none;
}

/* =========================
   SLIDER
========================= */

.ba-slider {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;              
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  z-index: 30;               
  cursor: ew-resize;
  touch-action: none;
  pointer-events: auto;     
}

/* Ocultar completamente el thumb */

/* Chrome / Safari */
.ba-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 0;
  height: 0;
  background: transparent;
  border: none;
}

/* Firefox */
.ba-slider::-moz-range-thumb {
  width: 0;
  height: 0;
  background: transparent;
  border: none;
}

/* Ocultar la línea gris en Firefox */
.ba-slider::-moz-range-track {
  background: transparent;
  border: none;
}

/* DIVIDER */

.ba-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: rgba(255,255,255,.9);
  z-index: 20;
  pointer-events: none;
}

/* Indicador de movimiento */
.ba-divider::after {
  content: "‹  ›";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  
  width: 24px;
  height: 22px;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 14px;
  font-weight: 300;
  letter-spacing: 2px;

  color: rgba(255,255,255,.85);
  background: rgba(0,0,0,.45);
  border-radius: 3px;
}



/* LABELS */

.ba-label {
  position: absolute;
  top: 20px;
  padding: 6px 14px;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  background: rgba(0,0,0,.55);
  color: #fff;
  z-index: 8;
}

.ba-label.before {
  left: 20px;
}

.ba-label.after {
  right: 20px;
}

/* HINT MOVE */

.ba-hint {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #fff;
  opacity: .8;
  z-index: 7;
}

/* INFO TEXTO */

.ba-info h3 {
  font-size: 13px;
  letter-spacing: .25em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.ba-text {
  font-size: 15px;
  line-height: 1.7;
  color: #080808;
  max-height: 32px;
  overflow: hidden;
  transition: max-height .4s ease;
}

/* expandido */

.ba-card.active .ba-text {
  max-height: 220px;
}

/* BOTÓN */

.ba-btn {
  margin-top: 6px;
  align-self: flex-start;
  background: transparent;
  border: none;
  padding: 0;
  font-size: 11px;
  letter-spacing: 0.18em;  
  text-transform: uppercase;
  color: #111;
  position: relative;
}

.ba-btn::after {
  content: " →";
  display: block;
  width: 40%;
  height: 1px;
  background: #111;
  margin-top: 4px;
  transition: width .3s ease;
}

.ba-btn:hover::after {
  width: 100%;
}
.ba-card.active .ba-btn::after {
  width: 100%;
}
/* =========================
   CAROUSEL PROYECTOS
========================= */

.ba-carousel {
  position: relative;
}

.ba-carousel-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .6s ease;
}

.ba-carousel-image.active {
  opacity: 1;
}


/* =========================
   FLECHAS NEGRAS MODERNAS
========================= */

.ba-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 30px;   
  font-weight: 300;  
  color: #000;       
  line-height: 1;
  opacity: 1; 
  transition: transform .3s ease;
  z-index: 20;
}

.ba-prev { left: 32px; }
.ba-next { right: 32px; }

.ba-arrow:hover {
  transform: translateY(-50%) scale(1.15);
}


/* RESPONSIVE */

@media (max-width: 1100px) {
  .ba-grid {
    grid-template-columns: 1fr;
    gap: 56px;
  }

  .ba-header h2 {
    font-size: 42px;
  }

  .ba-wrapper {
    aspect-ratio:16 / 9;
  }

}

@media (min-width: 769px) {
  .ba-divider::after {
    display: none;
  }
  
}
  .ba-image,
  .ba-carousel-image {
    object-position: 50% 50%;
  }