/* sic-pdp-antes-depois-v1
   Comparador interativo Antes e Depois na descrição da PDP.
   Prévia 26/11/2026 — não publicar sem OK explícito do Samuel.
   Identidade alinhada à descrição da Desmaia (sic-desc-v1c):
   cantos 20px, borda #E6E8EB, tinta #111 / #3d4248.
   Proporção natural das fotos: 500×725 (não 1:1, para não cortar o cabelo). */

.sic-ad {
  --pos: 50%;
  box-sizing: border-box;
  width: 100%;
  max-width: 520px;
  margin: 8px auto 28px;
  padding: 0;
  border: 0;
}

.sic-ad *,
.sic-ad *::before,
.sic-ad *::after {
  box-sizing: border-box;
}

.sic-ad__frame {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 500 / 725;
  border-radius: 20px;
  border: 1px solid #E6E8EB;
  background: #F4F5F7;
  --pos: 50%;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  cursor: ew-resize;
}

/* <picture> precisa preencher o frame; o img de dentro já é absolute. */
.sic-ad picture,
.sic-desc .sic-ad picture,
#sic-desc .sic-ad picture,
.sic-desc-wrap .sic-ad picture {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

/* Sobrescreve .sic-desc img { max-width:100%; height:auto } */
.sic-ad img,
.sic-desc .sic-ad img,
#sic-desc .sic-ad img,
.sic-desc-wrap .sic-ad img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: 50% 50%;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}

.sic-ad__img--depois {
  /* Depois à direita; --pos = quanto do Antes aparece à esquerda. */
  clip-path: inset(0 0 0 var(--pos));
  -webkit-clip-path: inset(0 0 0 var(--pos));
}

.sic-ad__linha {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  width: 3px;
  background: #fff;
  transform: translateX(-50%);
  pointer-events: none;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.28);
  z-index: 2;
}

/* O tema (html body .user-content *) pinta cor e -webkit-text-fill-color
   em #000 !important. Precisa de especificidade maior + !important. */
html body .sic-ad .sic-ad__botao,
html body .product-description .sic-ad .sic-ad__botao,
html body .user-content .sic-ad .sic-ad__botao,
html body .sic-desc .sic-ad .sic-ad__botao,
html body #sic-desc .sic-ad .sic-ad__botao,
html body .sic-desc-wrap .sic-ad .sic-ad__botao {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff !important;
  color: #222222 !important;
  -webkit-text-fill-color: #222222 !important;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
  display: grid;
  place-items: center;
  pointer-events: none;
}

html body .sic-ad .sic-ad__botao svg,
html body .product-description .sic-ad .sic-ad__botao svg,
html body .user-content .sic-ad .sic-ad__botao svg,
html body .sic-desc .sic-ad .sic-ad__botao svg,
html body #sic-desc .sic-ad .sic-ad__botao svg,
html body .sic-desc-wrap .sic-ad .sic-ad__botao svg {
  width: 20px;
  height: 20px;
  display: block;
  color: #222222 !important;
  fill: none !important;
  stroke: #222222 !important;
}

html body .sic-ad .sic-ad__botao svg path,
html body .product-description .sic-ad .sic-ad__botao svg path,
html body .user-content .sic-ad .sic-ad__botao svg path,
html body .sic-desc .sic-ad .sic-ad__botao svg path,
html body #sic-desc .sic-ad .sic-ad__botao svg path,
html body .sic-desc-wrap .sic-ad .sic-ad__botao svg path {
  color: #222222 !important;
  fill: none !important;
  stroke: #222222 !important;
}

html body .sic-ad .sic-ad__badge,
html body .product-description .sic-ad .sic-ad__badge,
html body .user-content .sic-ad .sic-ad__badge,
html body .sic-desc .sic-ad .sic-ad__badge,
html body #sic-desc .sic-ad .sic-ad__badge,
html body .sic-desc-wrap .sic-ad .sic-ad__badge {
  position: absolute;
  top: 12px;
  z-index: 3;
  pointer-events: none;
  background: rgba(17, 17, 17, 0.78) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

html body .sic-ad .sic-ad__badge--antes,
html body .product-description .sic-ad .sic-ad__badge--antes,
html body .user-content .sic-ad .sic-ad__badge--antes,
html body .sic-desc .sic-ad .sic-ad__badge--antes,
html body #sic-desc .sic-ad .sic-ad__badge--antes,
html body .sic-desc-wrap .sic-ad .sic-ad__badge--antes { left: 12px; }

html body .sic-ad .sic-ad__badge--depois,
html body .product-description .sic-ad .sic-ad__badge--depois,
html body .user-content .sic-ad .sic-ad__badge--depois,
html body .sic-desc .sic-ad .sic-ad__badge--depois,
html body #sic-desc .sic-ad .sic-ad__badge--depois,
html body .sic-desc-wrap .sic-ad .sic-ad__badge--depois { right: 12px; }

.sic-ad__range {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: ew-resize;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  touch-action: pan-y;
}

.sic-ad__range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 0;
}

.sic-ad__range::-moz-range-thumb {
  width: 44px;
  height: 44px;
  background: transparent;
  border: 0;
}

.sic-ad__range::-moz-range-track {
  background: transparent;
  border: 0;
}

.sic-ad__frame:focus-within .sic-ad__botao {
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px #1B7A45, 0 2px 10px rgba(0, 0, 0, 0.28);
}

html body .sic-ad .sic-ad__legenda,
html body .product-description .sic-ad .sic-ad__legenda,
html body .user-content .sic-ad .sic-ad__legenda,
html body .sic-desc .sic-ad .sic-ad__legenda,
html body #sic-desc .sic-ad .sic-ad__legenda,
html body .sic-desc-wrap .sic-ad .sic-ad__legenda,
html body .sic-ad figcaption.sic-ad__legenda,
html body .user-content .sic-ad figcaption {
  margin: 10px 0 0;
  padding: 0 8px;
  text-align: center;
  font-size: 13px;
  line-height: 1.4;
  color: #3d4248 !important;
  -webkit-text-fill-color: #3d4248 !important;
  background: transparent !important;
}

@media (min-width: 1024px) {
  .sic-ad {
    max-width: 520px;
    margin: 12px auto 32px;
  }

  html body .sic-ad .sic-ad__botao,
  html body .product-description .sic-ad .sic-ad__botao,
  html body .user-content .sic-ad .sic-ad__botao,
  html body .sic-desc .sic-ad .sic-ad__botao,
  html body #sic-desc .sic-ad .sic-ad__botao,
  html body .sic-desc-wrap .sic-ad .sic-ad__botao {
    width: 48px;
    height: 48px;
  }

  html body .sic-ad .sic-ad__botao svg,
  html body .product-description .sic-ad .sic-ad__botao svg,
  html body .user-content .sic-ad .sic-ad__botao svg,
  html body .sic-desc .sic-ad .sic-ad__botao svg,
  html body #sic-desc .sic-ad .sic-ad__botao svg,
  html body .sic-desc-wrap .sic-ad .sic-ad__botao svg {
    width: 22px;
    height: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sic-ad__img--depois,
  .sic-ad__linha,
  .sic-ad__botao {
    transition: none;
  }
}
