/* =============================================
   ANTES E DEPOIS — Slider Section
   Identidade visual: Epidermis palette
   ============================================= */

:root {
  --ad-bg:          rgb(254, 245, 240);
  --ad-accent:      rgb(159, 84, 52);
  --ad-accent-dark: rgb(111, 59, 36);
  --ad-accent-12:   rgba(159, 84, 52, .12);
  --ad-accent-07:   rgba(159, 84, 52, .07);
  --ad-white:       #fff;
  --ad-font:        'Archivo', sans-serif;
  --ad-ease:        cubic-bezier(.4, 0, .2, 1);
  --ad-radius:      6px;
  --ad-pill:        100px;
}

/* ── Section wrapper ── */
.ad-section {
  background: var(--ad-bg);
  padding: 6rem 1.5rem;
  font-family: var(--ad-font);
  color: var(--ad-accent-dark);
  -webkit-font-smoothing: antialiased;
}

.ad-wrap {
  max-width: 1200px;
  margin: 0 auto;
}

/* ── Section header ── */
.ad-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.ad-label {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ad-accent);
  margin-bottom: 1rem;
}

.ad-label::before,
.ad-label::after {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--ad-accent);
  opacity: .5;
}

.ad-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  letter-spacing: -.03em;
  line-height: .95;
  margin-bottom: .75rem;
}

.ad-title em {
  font-style: italic;
}

.ad-subtitle {
  font-size: 15px;
  opacity: .6;
  max-width: 460px;
  margin: 0 auto;
  line-height: 1.65;
}

/* ── Tabs (procedure selector) ── */
.ad-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem;
  margin-bottom: 3rem;
}

.ad-tab {
  font-family: var(--ad-font);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .04em;
  padding: 0 1.4rem;
  height: 40px;
  border-radius: var(--ad-pill);
  border: 1.5px solid var(--ad-accent-12);
  background: transparent;
  color: var(--ad-accent-dark);
  cursor: pointer;
  transition: all .25s var(--ad-ease);
  white-space: nowrap;
}

.ad-tab:hover {
  border-color: var(--ad-accent);
  color: var(--ad-accent);
}

.ad-tab.active {
  background: var(--ad-accent);
  border-color: var(--ad-accent);
  color: var(--ad-white);
}

/* ── Panel (per procedure) ── */
.ad-panel {
  display: none;
}

.ad-panel.active {
  display: block;
}

/* ── Slider stage ── */
.ad-stage {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
}

/* ── The comparison slider ── */
.ad-slider {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: var(--ad-radius);
  overflow: hidden;
  cursor: col-resize;
  user-select: none;
  background: var(--ad-accent-07);
  box-shadow: 0 8px 40px rgba(111, 59, 36, .1);
}

/* Base image — "depois" (right) fills the full container */
.ad-img-after {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}

/* "antes" (left) is clipped by a CSS clip-path updated by JS */
.ad-img-before {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
  clip-path: inset(0 50% 0 0);
  transition: clip-path .04s linear;
}

/* ── Labels ANTES / DEPOIS ── */
.ad-lbl {
  position: absolute;
  bottom: 1rem;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ad-white);
  background: rgba(30, 18, 10, .42);
  backdrop-filter: blur(6px);
  padding: .3rem .75rem;
  border-radius: var(--ad-pill);
  pointer-events: none;
  z-index: 4;
}

.ad-lbl-antes {
  left: 1rem;
}

.ad-lbl-depois {
  right: 1rem;
}

/* ── Divider handle ── */
.ad-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  background: var(--ad-white);
  z-index: 5;
  pointer-events: none;
  transition: left .04s linear;
}

.ad-handle::before,
.ad-handle::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ad-white);
  box-shadow: 0 2px 12px rgba(0,0,0,.2);
}

.ad-handle::before {
  top: 50%;
  transform: translate(-50%, -50%);
}

/* Arrow icons inside handle */
.ad-handle-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 2px;
  pointer-events: none;
  color: var(--ad-accent);
}

.ad-handle-icon svg {
  width: 10px;
  height: 10px;
  fill: currentColor;
}

/* ── Placeholder (when image not loaded) ── */
.ad-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ad-accent);
  opacity: .45;
  pointer-events: none;
}

.ad-placeholder svg {
  width: 28px;
  height: 28px;
  stroke: currentColor;
  fill: none;
}

/* ── Navigation (dots + arrows) ── */
.ad-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.75rem;
}

.ad-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--ad-accent-12);
  background: transparent;
  color: var(--ad-accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .2s var(--ad-ease);
  font-family: var(--ad-font);
}

.ad-nav-btn:hover:not(:disabled) {
  border-color: var(--ad-accent);
  color: var(--ad-accent);
  transform: translateY(-1px);
}

.ad-nav-btn:disabled {
  opacity: .3;
  cursor: not-allowed;
}

.ad-nav-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ad-dots {
  display: flex;
  gap: .45rem;
  align-items: center;
}

.ad-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ad-accent-12);
  border: none;
  cursor: pointer;
  transition: all .2s var(--ad-ease);
  padding: 0;
}

.ad-dot.active {
  background: var(--ad-accent);
  width: 18px;
  border-radius: 3px;
}

/* ── Counter label ── */
.ad-counter {
  text-align: center;
  margin-top: .75rem;
  font-size: 12px;
  letter-spacing: .08em;
  opacity: .4;
}

/* ── Scroll reveal ── */
.ad-rv {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s var(--ad-ease), transform .6s var(--ad-ease);
}

.ad-rv.ad-vis {
  opacity: 1;
  transform: none;
}

.ad-rv-d1 { transition-delay: .1s; }
.ad-rv-d2 { transition-delay: .2s; }
.ad-rv-d3 { transition-delay: .3s; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .ad-section {
    padding: 4rem 1rem;
  }

  .ad-tabs {
    gap: .35rem;
  }

  .ad-tab {
    font-size: 12px;
    padding: 0 1rem;
    height: 36px;
  }

}

@media (max-width: 480px) {
  .ad-tab {
    font-size: 11px;
    padding: 0 .85rem;
    height: 34px;
  }
}
