/* ───────────────────────────────────────────────────────────────
   PDP Obra Certa · Sticky Buy Bar
   Desktop: desce do topo ao rolar. Mobile: fixa no rodapé (acima da tab bar).
   Pixel-perfect com o bundle claude.ai/design (Sticky Buy Bar Obra Certa).
   ─────────────────────────────────────────────────────────────── */

.pdp-sbb-root {
  --sbb-purple: var(--pdp-purple, #421685);
  --sbb-green-2: var(--pdp-green-2, #2f7a23);
  --sbb-green: var(--pdp-green, #4eb33a);
  --sbb-ink: var(--pdp-ink, #1b1226);
  --sbb-ink-2: var(--pdp-ink-2, #3a2e4a);
  --sbb-ink-3: var(--pdp-ink-3, #6b6478);
  --sbb-ink-4: var(--pdp-ink-4, #a7a0b3);
  --sbb-line: var(--pdp-line, #ece8f0);
  --sbb-line-2: var(--pdp-line-2, #dad5e0);
  --sbb-purple-50: var(--pdp-purple-50, #f4eefc);
  --sbb-purple-100: var(--pdp-purple-100, #e8def8);
  --sbb-paper: var(--pdp-paper, #f6f4f9);
  --sbb-warn: var(--pdp-warn, #f5a623);
  --sbb-tabbar-h: var(--mo-tabbar-h, 64px);
  font-family: 'Nunito', system-ui, sans-serif;
}

.pdp-sbb,
.pdp-sbb *,
.pdp-sbb-sheet,
.pdp-sbb-sheet * { box-sizing: border-box; }

.pdp-sbb[hidden],
.pdp-sbb-sheet[hidden] { display: block; }

/* ── Shared atoms ───────────────────────────────────────────── */
.pdp-sbb__thumb {
  border-radius: 11px;
  overflow: hidden;
  border: 1px solid var(--sbb-line);
  background: #fff;
  padding: 4px;
  flex-shrink: 0;
}
.pdp-sbb__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 7px; /* concêntrico: 11 - 4 padding */
  display: block;
  outline: 1px solid rgba(0, 0, 0, .1);
  outline-offset: -1px;
}

.pdp-sbb__stars { display: inline-flex; gap: 1px; color: var(--sbb-warn); line-height: 1; }
.pdp-sbb__cta-ic { font-size: 15px; line-height: 1; }
.pdp-sbb__cta-arrow { font-size: 14px; line-height: 1; }

/* ─────────────────────────────────────────────────────────────
   DESKTOP BAR — desce do topo
   ───────────────────────────────────────────────────────────── */
.pdp-sbb--desktop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1200;
  background: #fff;
  border-bottom: 1px solid var(--sbb-line-2);
  box-shadow: 0 12px 30px -12px rgba(27, 18, 38, .28);
  transform: translateY(-105%);
  transition: transform .32s cubic-bezier(.4, 1.2, .5, 1);
  will-change: transform;
}
.pdp-sbb-root.is-desktop-shown .pdp-sbb--desktop { transform: translateY(0); }

.pdp-sbb__inner {
  max-width: var(--pdp-container, 1320px);
  margin: 0 auto;
  padding: 11px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Identity */
.pdp-sbb__id {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 120px;
  flex: 1 1 auto;
}
.pdp-sbb__id .pdp-sbb__thumb { width: 50px; height: 50px; }
.pdp-sbb__id-text { min-width: 0; }
.pdp-sbb__title {
  font-size: 14px;
  font-weight: 900;
  color: var(--sbb-ink);
  letter-spacing: -.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pdp-sbb__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
  color: var(--sbb-ink-3);
}
.pdp-sbb__meta .pdp-sbb__stars { font-size: 11px; }
.pdp-sbb__rating { color: var(--sbb-ink-2); font-variant-numeric: tabular-nums; }
.pdp-sbb__sep { opacity: .4; }
.pdp-sbb__sold { color: var(--sbb-green-2); font-variant-numeric: tabular-nums; }

/* Variant chip — scoped sob .pdp-sbb-root p/ vencer o reset .pdp-mo button{border:0} (0,1,1) */
.pdp-sbb-root .pdp-sbb__chip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 7px 12px;
  min-height: 40px;
  background: var(--sbb-purple-50);
  border: 1px solid var(--sbb-purple-100);
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s ease, scale .12s ease;
}
.pdp-sbb__chip:hover { background: #efe6fb; }
.pdp-sbb__chip:active { scale: .96; }
.pdp-sbb__chip-swatch {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .12);
  flex-shrink: 0;
}
.pdp-sbb__chip-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; }
.pdp-sbb__chip-k {
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--sbb-ink-4);
  text-transform: uppercase;
}
.pdp-sbb__chip-v { font-size: 12px; font-weight: 900; color: var(--sbb-ink-2); white-space: nowrap; }
.pdp-sbb__chip-caret { font-size: 11px; font-weight: 900; color: var(--sbb-purple); margin-left: 2px; }

/* Price */
.pdp-sbb__price { text-align: right; flex-shrink: 0; }
.pdp-sbb__price-main { display: flex; align-items: flex-end; gap: 4px; justify-content: flex-end; font-variant-numeric: tabular-nums; }
.pdp-sbb__price-curr { font-size: 11px; font-weight: 800; color: var(--sbb-ink-3); margin-bottom: 3px; }
.pdp-sbb__price-int { font-size: 26px; font-weight: 900; color: var(--sbb-purple); letter-spacing: -1px; line-height: 1; }
.pdp-sbb__price-dec { font-size: 16px; font-weight: 900; color: var(--sbb-purple); margin-bottom: 1px; }
.pdp-sbb__price-off {
  padding: 2px 6px;
  background: var(--sbb-green);
  color: #fff;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 900;
  margin-left: 3px;
  margin-bottom: 4px;
}
.pdp-sbb__price-off[hidden] { display: none; }
.pdp-sbb__price-sub {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--sbb-ink-3);
  margin-top: 1px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.pdp-sbb__price-sep { opacity: .5; }
.pdp-sbb__pix { color: var(--sbb-green-2); font-weight: 800; }

/* Qty + CTA */
.pdp-sbb__actions { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.pdp-sbb__qty {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--sbb-line);
  border-radius: 9px;
  padding: 3px;
  background: #fff;
}
.pdp-sbb__qty-btn {
  width: 32px;
  height: 32px;
  background: transparent;
  color: var(--sbb-purple);
  font-size: 16px;
  font-weight: 900;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s ease, scale .1s ease;
}
.pdp-sbb__qty-btn:hover { background: var(--sbb-purple-50); }
.pdp-sbb__qty-btn:active { scale: .9; }
.pdp-sbb__qty-val {
  min-width: 30px;
  text-align: center;
  font-weight: 900;
  font-size: 15px;
  color: var(--sbb-ink);
  font-variant-numeric: tabular-nums;
}

.pdp-sbb__cta {
  /* Mesma identidade do CTA "Finalizar compra" do checkout (.ob-summary__cta):
     gradiente verde #4eb33a→#3d8f2a + glow verde, no lugar do verde chapado. */
  background: linear-gradient(180deg, var(--sbb-green), #3d8f2a);
  color: #fff;
  border-radius: 12px;
  height: 46px;
  padding: 0 20px;
  font-weight: 900;
  font-size: 13.5px;
  letter-spacing: .4px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(78, 179, 58, .4);
  transition: box-shadow .15s ease, scale .12s ease;
}
.pdp-sbb__cta:hover { box-shadow: 0 10px 24px rgba(78, 179, 58, .5); }
.pdp-sbb__cta:active { scale: .96; }

/* ─────────────────────────────────────────────────────────────
   MOBILE BAR — fixa no rodapé, acima da tab bar
   ───────────────────────────────────────────────────────────── */
.pdp-sbb--mobile {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--sbb-tabbar-h) + env(safe-area-inset-bottom, 0px));
  z-index: 1390;
  background: #fff;
  border-top: 1px solid var(--sbb-line-2);
  box-shadow: 0 -10px 26px -12px rgba(27, 18, 38, .30);
  padding: 9px 14px;
  transform: translateY(calc(100% + var(--sbb-tabbar-h) + env(safe-area-inset-bottom, 0px) + 12px));
  transition: transform .32s cubic-bezier(.4, 1.2, .5, 1);
  will-change: transform;
}
.pdp-sbb-root.is-mobile-shown .pdp-sbb--mobile { transform: translateY(0); }

.pdp-sbb-root .pdp-sbb__mvariant {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
  padding: 8px 11px;
  min-height: 40px;
  background: var(--sbb-purple-50);
  border: 1px solid var(--sbb-purple-100);
  border-radius: 9px;
  cursor: pointer;
  transition: background .15s ease, scale .12s ease;
}
.pdp-sbb__mvariant:active { scale: .985; }
.pdp-sbb__mvariant-swatch {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .12);
  flex-shrink: 0;
}
.pdp-sbb__mvariant-label { font-size: 12px; font-weight: 800; color: var(--sbb-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pdp-sbb__mvariant-action { margin-left: auto; font-size: 11px; font-weight: 900; color: var(--sbb-purple); white-space: nowrap; }

.pdp-sbb__mrow { display: flex; align-items: center; gap: 10px; }
.pdp-sbb__thumb--sm { width: 44px; height: 44px; padding: 3px; border-radius: 10px; }
.pdp-sbb__thumb--sm img { border-radius: 6px; }
.pdp-sbb__mprice { min-width: 0; flex-shrink: 0; }
.pdp-sbb__mprice-main {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  line-height: 1;
  font-size: 22px;
  font-weight: 900;
  color: var(--sbb-purple);
  letter-spacing: -.8px;
  font-variant-numeric: tabular-nums;
}
.pdp-sbb__mprice-curr { font-size: 10px; font-weight: 800; color: var(--sbb-ink-3); margin-bottom: 2px; letter-spacing: 0; }
.pdp-sbb__mprice-pix { font-size: 10px; font-weight: 700; color: var(--sbb-ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pdp-sbb__mprice-pix b { color: var(--sbb-green-2); }

.pdp-sbb__cta--mobile {
  /* herda o gradiente verde + glow do .pdp-sbb__cta base */
  flex: 1;
  min-width: 0;
  height: 50px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 13.5px;
  letter-spacing: .2px;
  justify-content: center;
  gap: 7px;
  box-shadow: 0 8px 18px rgba(78, 179, 58, .42);
}
.pdp-sbb__cta--mobile .pdp-sbb__cta-ic { font-size: 16px; }

/* ─────────────────────────────────────────────────────────────
   MOBILE VARIANT SHEET
   ───────────────────────────────────────────────────────────── */
.pdp-sbb-sheet { position: fixed; inset: 0; z-index: 1600; pointer-events: none; }
.pdp-sbb-sheet__scrim {
  position: absolute;
  inset: 0;
  background: rgba(27, 18, 38, .45);
  opacity: 0;
  transition: opacity .25s ease;
}
.pdp-sbb-sheet__panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 10px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -16px 40px -10px rgba(27, 18, 38, .4);
  transform: translateY(102%);
  transition: transform .3s cubic-bezier(.4, 1.1, .5, 1);
  max-height: 86vh;
  overflow-y: auto;
}
.pdp-sbb-root.is-sheet-open .pdp-sbb-sheet { pointer-events: auto; }
.pdp-sbb-root.is-sheet-open .pdp-sbb-sheet__scrim { opacity: 1; }
.pdp-sbb-root.is-sheet-open .pdp-sbb-sheet__panel { transform: translateY(0); }

.pdp-sbb-sheet__grab { display: block; width: 42px; height: 4px; background: var(--sbb-line-2); border-radius: 3px; margin: 0 auto 14px; }

.pdp-sbb-sheet__head { display: flex; align-items: center; gap: 11px; margin-bottom: 16px; }
.pdp-sbb-sheet__head-thumb {
  width: 52px;
  height: 52px;
  border-radius: 11px;
  overflow: hidden;
  border: 1px solid var(--sbb-line);
  padding: 4px;
  background: #fff;
  flex-shrink: 0;
}
.pdp-sbb-sheet__head-thumb img { width: 100%; height: 100%; object-fit: contain; border-radius: 7px; outline: 1px solid rgba(0, 0, 0, .1); outline-offset: -1px; }
.pdp-sbb-sheet__head-text { flex: 1; min-width: 0; }
.pdp-sbb-sheet__head-title { font-size: 13px; font-weight: 900; color: var(--sbb-ink); line-height: 1.2; }
.pdp-sbb-sheet__head-price { font-size: 12px; font-weight: 800; color: var(--sbb-purple); margin-top: 2px; font-variant-numeric: tabular-nums; }
.pdp-sbb-sheet__head-pix b { color: var(--sbb-green-2); }
.pdp-sbb-sheet__close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--sbb-paper);
  color: var(--sbb-ink-3);
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s ease, scale .12s ease;
}
.pdp-sbb-sheet__close:hover { background: #ece6f3; }
.pdp-sbb-sheet__close:active { scale: .92; }

.pdp-sbb-sheet__group { margin-bottom: 18px; }
.pdp-sbb-sheet__group-label {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.2px;
  color: var(--sbb-ink-3);
  text-transform: uppercase;
  margin-bottom: 9px;
}
.pdp-sbb-sheet__opts { display: flex; flex-wrap: wrap; gap: 9px; }

/* Non-swatch (size/capacity) chips */
.pdp-sbb-root .pdp-sbb-sheet__opt {
  padding: 10px 16px;
  min-height: 44px;
  background: #fff;
  color: var(--sbb-ink-2);
  border: 1.5px solid var(--sbb-line-2);
  border-radius: 9px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s ease, border-color .12s ease, color .12s ease, scale .1s ease;
}
.pdp-sbb-sheet__opt:active { scale: .96; }
.pdp-sbb-sheet__opt.is-active { background: var(--sbb-purple); border-color: var(--sbb-purple); color: #fff; }

/* Swatch (color) options — column with label */
.pdp-sbb-sheet__opt.is-swatch {
  flex-direction: column;
  gap: 5px;
  padding: 0;
  min-height: 0;
  background: none;
  border: 0;
  color: var(--sbb-ink-3);
  font-size: 10px;
  border-radius: 0;
}
.pdp-sbb-sheet__opt.is-swatch:active { scale: .96; }
.pdp-sbb-sheet__opt-swatch {
  width: 46px;
  height: 46px;
  border-radius: 11px;
  border: 2px solid var(--sbb-line);
  box-shadow: none;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.pdp-sbb-sheet__opt.is-swatch.is-active { color: var(--sbb-purple); }
.pdp-sbb-sheet__opt.is-swatch.is-active .pdp-sbb-sheet__opt-swatch {
  border: 3px solid var(--sbb-purple);
  box-shadow: 0 0 0 2px #fff inset;
}
.pdp-sbb-sheet__opt.is-swatch .pdp-sbb-sheet__opt-text { font-weight: 800; }

.pdp-sbb-sheet__cta {
  width: 100%;
  /* Mesma identidade do CTA "Finalizar compra" do checkout: gradiente + glow. */
  background: linear-gradient(180deg, var(--sbb-green), #3d8f2a);
  color: #fff;
  border-radius: 13px;
  height: 52px;
  margin-top: 2px;
  font-weight: 900;
  font-size: 15px;
  letter-spacing: .4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(78, 179, 58, .4);
  transition: box-shadow .15s ease, scale .12s ease;
}
.pdp-sbb-sheet__cta:hover { box-shadow: 0 12px 26px rgba(78, 179, 58, .5); }
.pdp-sbb-sheet__cta:active { scale: .96; }
.pdp-sbb-sheet__cta.is-disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

/* ─────────────────────────────────────────────────────────────
   BREAKPOINTS — desktop bar ≥901px, mobile bar ≤900px
   ───────────────────────────────────────────────────────────── */
.pdp-sbb--mobile,
.pdp-sbb-sheet { display: none; }
.pdp-sbb--desktop { display: block; }

@media (max-width: 900px) {
  .pdp-sbb--desktop { display: none; }
  .pdp-sbb--mobile { display: block; }
  .pdp-sbb-sheet { display: block; }

  /* Espaço extra no fim da página para a barra + tab bar não cobrirem o conteúdo */
  body.single-product { padding-bottom: calc(var(--mo-tabbar-h, 64px) + 86px + env(safe-area-inset-bottom, 0px)) !important; }
}

/* ── Destaque ao enviar o usuário para escolher a variação ── */
[data-pdp-variants].is-sbb-flash {
  border-radius: 14px;
  animation: pdp-sbb-flash 1.1s cubic-bezier(0.2, 0, 0, 1);
}
@keyframes pdp-sbb-flash {
  0%   { box-shadow: 0 0 0 0 rgba(66, 22, 133, 0); }
  20%  { box-shadow: 0 0 0 4px rgba(66, 22, 133, 0.45); }
  100% { box-shadow: 0 0 0 0 rgba(66, 22, 133, 0); }
}

/* ── Acessibilidade: reduzir movimento ── */
@media (prefers-reduced-motion: reduce) {
  .pdp-sbb--desktop,
  .pdp-sbb--mobile,
  .pdp-sbb-sheet__panel,
  .pdp-sbb-sheet__scrim { transition-duration: .01ms; }
  .pdp-sbb__cta,
  .pdp-sbb__chip,
  .pdp-sbb__qty-btn,
  .pdp-sbb-sheet__opt,
  .pdp-sbb-sheet__cta { transition: none; }
  [data-pdp-variants].is-sbb-flash { animation: none; }
}

/* Keep the mobile atendimento launcher/teaser away from the sticky buy CTA. */
@media (max-width: 900px) {
  body.single-product .pdp-sbb-root.is-mobile-shown .pdp-sbb--mobile {
    z-index: 1450;
  }

  body.single-product .moaw-fab {
    bottom: calc(var(--mo-tabbar-h, 64px) + 96px + env(safe-area-inset-bottom, 0px) + 16px) !important;
    z-index: 1380 !important;
  }

  body.single-product .moaw-teaser {
    bottom: calc(var(--mo-tabbar-h, 64px) + 96px + env(safe-area-inset-bottom, 0px) + 29px) !important;
  }

}

@media (min-width: 561px) and (max-width: 900px) {
  body.single-product .moaw-panel {
    bottom: calc(var(--mo-tabbar-h, 64px) + 96px + env(safe-area-inset-bottom, 0px) + 90px) !important;
  }
}
