/* =========================================
   PÁGINA ANTES E DEPOIS - ESTILOS DEFINITIVOS
========================================= */

/* HERO ESPECÍFICO */
.before-after-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: 550px;
  padding: 140px 0 80px 0;
  overflow: hidden;
  background-color: #021328;
  color: #ffffff;
}

.before-after-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(circle at 80% 20%, rgba(22, 131, 232, 0.15), transparent 40%),
              linear-gradient(180deg, #021328 0%, #041d3c 100%);
  pointer-events: none;
}

.before-after-hero .container {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.before-after-hero .section-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  padding: 8px 18px;
  background: rgba(22, 131, 232, 0.2);
  color: #58b5ff;
  border: 1px solid rgba(72, 186, 255, 0.35);
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.before-after-hero h1 {
  color: #ffffff;
  font-size: clamp(2.5rem, 4.5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1.5px;
  margin-bottom: 20px;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.before-after-hero p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.125rem;
  line-height: 1.7;
  margin: 0 auto 36px auto;
  max-width: 680px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.before-after-hero .page-hero-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* =========================================
   GRID DESKTOP (ANULAÇÃO DE CONFLITOS BOOTSTRAP)
========================================= */
.before-after-carousel {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 24px !important;
  padding: 20px 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
}

.before-after-slide {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  flex: none !important;
  margin: 0 !important;
}

/* CARD DE RESULTADO */
.result-card,
.carpet-result-card {
  background: #ffffff;
  border: 1px solid rgba(6, 45, 91, 0.08);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 14px 35px rgba(2, 21, 52, 0.04);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  width: 100% !important;
}

.result-card:hover,
.carpet-result-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px rgba(2, 21, 52, 0.08);
}

/* SLIDER INTERATIVO ANTES E DEPOIS */
.before-after-compare {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  cursor: ew-resize;
  --compare-position: 50%;
  touch-action: pan-y;
}

.before-after-compare img,
.carpet-result-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  user-select: none;
}

.before-after-compare .result-image:nth-child(1) {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.before-after-compare .result-image:nth-child(2) {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  clip-path: polygon(var(--compare-position) 0, 100% 0, 100% 100%, var(--compare-position) 100%);
}

.result-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--compare-position);
  width: 4px;
  background-color: #ffffff;
  z-index: 3;
  transform: translateX(-50%);
  pointer-events: none;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.4);
}

.result-divider span {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  background-color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent-blue, #1683e8);
  font-size: 1.25rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

.label-before, .label-after {
  position: absolute;
  top: 16px;
  padding: 6px 14px;
  background: rgba(2, 21, 52, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 1px;
  z-index: 4;
  pointer-events: none;
}

.label-before { left: 16px; }
.label-after { right: 16px; }

.result-content,
.carpet-result-content {
  padding: 32px 28px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.carousel-hint {
  display: none;
}

/* =========================================
   RESPONSIVIDADE MOBILE (CARROSSEL POR TOQUE)
========================================= */
@media (max-width: 991.98px) {
  .before-after-hero {
    padding: 120px 0 60px 0;
    min-height: auto;
  }

  .before-after-hero .page-hero-actions {
    flex-direction: column;
  }

  .before-after-hero .page-hero-actions .btn {
    width: 100%;
  }

  .before-after-carousel-section {
    overflow: hidden;
  }

  .before-after-carousel {
    display: flex !important;
    grid-template-columns: none !important;
    gap: 16px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    margin-left: -16px !important;
    margin-right: -16px !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    padding-bottom: 20px !important;
    width: calc(100% + 32px) !important;
  }

  .before-after-carousel::-webkit-scrollbar {
    display: none;
  }

  .before-after-slide {
    flex: 0 0 310px !important;
    min-width: 310px !important;
    width: 310px !important;
    scroll-snap-align: center;
  }

  .carousel-hint {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--color-text-body, #526176);
  }
}