/* Seção "Revelando Resultados" (antes e depois), base do kit, com as cores desta marca */
.ba-section {
  --badge-bg: #062a66;
  --badge-text: #ffffff;
  --text-title: #062a66;
  --pill-bg: rgba(17, 24, 39, 0.65);
  --pill-text: #ffffff;
  --divider-color: rgba(255, 255, 255, 0.95);
  --handle-bg: #ffffff;
  --handle-color: #062a66;
  --handle-shadow: 0 4px 16px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(0, 0, 0, 0.06);
  --card-radius: 22px;
  --card-shadow: 0 12px 36px -8px rgba(0, 0, 0, 0.18), 0 1px 3px rgba(0, 0, 0, 0.06);
  background: #f1f5fa;
  color: #062a66;
  font-family: inherit;
}
.ba-section *, .ba-section *::before, .ba-section *::after { box-sizing: border-box; }
:where(.ba-section) :where(h2, p) { margin: 0; }
/* ==========================================================================
   Results Section Layout
   ========================================================================== */

.ba-section {
  width: 100%;
  padding: 70px 24px 90px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.ba-container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
}

/* Section Header */
.ba-header {
  text-align: center;
  margin-bottom: 48px;
}

.ba-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--badge-bg);
  color: var(--badge-text);
  font-size: 0.6875rem; /* 11px */
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 16px;
  border-radius: 9999px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.ba-title {
  font-size: clamp(2rem, 3.8vw, 2.75rem);
  font-weight: 600;
  line-height: 1.18;
  color: var(--text-title);
  letter-spacing: -0.025em;
}

.ba-subtitle {
  font-size: clamp(0.95rem, 1.8vw, 1.0625rem);
  color: #062a66cc;
  margin-top: 14px;
  font-weight: 500;
  line-height: 1.5;
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
}

/* ==========================================================================
   Cards Grid
   ========================================================================== */

.ba-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 24px;
  align-items: stretch;
}

/* Left Big Card */
.ba-card--large {
  grid-column: 1;
  grid-row: 1 / span 2;
  min-height: 480px;
}

/* Right Small Cards */
.ba-card--top {
  grid-column: 2;
  grid-row: 1;
  aspect-ratio: 16 / 9.6;
}

.ba-card--bottom {
  grid-column: 2;
  grid-row: 2;
  aspect-ratio: 16 / 9.6;
}

/* ==========================================================================
   Comparison Card Component
   ========================================================================== */

.ba-card {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: var(--card-radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  user-select: none;
  -webkit-user-select: none;
  cursor: ew-resize;
  background-color: #dbe4ee;
  touch-action: pan-y; /* Allow vertical scrolling while dragging horizontally */
}

/* Focus outline for accessibility */
.ba-card:focus-visible {
  outline: 3px solid var(--badge-bg);
  outline-offset: 3px;
}

/* Image Wrappers & Images */
.ba-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* AFTER image is in background */
.ba-img-after {
  z-index: 1;
}

/* BEFORE image on top, clipped to the slider position */
.ba-img-before {
  z-index: 2;
  clip-path: polygon(0 0, var(--position, 50%) 0, var(--position, 50%) 100%, 0 100%);
  will-change: clip-path;
}

/* Corner Badges: Before & After */
.ba-pill {
  position: absolute;
  bottom: 16px;
  z-index: 5;
  background: var(--pill-bg);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--pill-text);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 4px 12px;
  border-radius: 9999px;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: opacity 0.2s ease;
}

.ba-pill--before {
  left: 16px;
}

.ba-pill--after {
  right: 16px;
}

/* Divider Line */
.ba-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--position, 50%);
  width: 2px;
  background: var(--divider-color);
  transform: translateX(-50%);
  z-index: 6;
  pointer-events: none;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.35));
  will-change: left;
}

/* Center Handle Button */
.ba-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  background-color: var(--handle-bg);
  border-radius: 50%;
  box-shadow: var(--handle-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--handle-color);
  pointer-events: auto;
  cursor: ew-resize;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.ba-chevron {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  stroke-width: 2.4;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Hover & Active States */
.ba-card:hover .ba-handle {
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.ba-card.is-dragging {
  cursor: grabbing;
}

.ba-card.is-dragging .ba-handle {
  transform: translate(-50%, -50%) scale(1.12);
  background-color: #ffffff;
  color: var(--badge-bg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Hidden Accessible Range Input */
.ba-range {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
  z-index: 10;
  margin: 0;
  padding: 0;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

@media (max-width: 960px) {
  .ba-section {
    padding: 50px 20px 70px;
  }

  .ba-header {
    margin-bottom: 36px;
  }

  .ba-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
  }

  .ba-card--large {
    grid-column: 1;
    grid-row: auto;
    aspect-ratio: 16 / 12;
    min-height: auto;
  }

  .ba-card--top,
  .ba-card--bottom {
    grid-column: 1;
    grid-row: auto;
    aspect-ratio: 16 / 10;
  }
}

@media (max-width: 520px) {
  .ba-section {
    padding: 40px 16px 60px;
  }

  .ba-badge {
    font-size: 0.65rem;
    padding: 5px 14px;
    margin-bottom: 14px;
  }

  .ba-title {
    font-size: 1.85rem;
  }

  .ba-card--large {
    aspect-ratio: 1 / 1;
  }

  .ba-pill {
    bottom: 12px;
    font-size: 0.68rem;
    padding: 3px 10px;
  }

  .ba-pill--before {
    left: 12px;
  }

  .ba-pill--after {
    right: 12px;
  }

  .ba-handle {
    width: 32px;
    height: 32px;
  }

  .ba-chevron {
    width: 11px;
    height: 11px;
  }
}
.ba-title .ba-line { display: block; }
