/* ============================================================
   HERBERT MOTOS — Shop pages (produto, checkout, obrigado)
   Depends on styles.css tokens.
   ============================================================ */

/* page shell below fixed header */
.page {
  padding-top: calc(var(--header-h) + 22px);
  padding-bottom: 60px;
  min-height: 100vh;
}

/* breadcrumb / back */
.crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 18px;
}

.crumb a { color: var(--muted); transition: color 0.2s ease; }
.crumb a:hover { color: var(--ktm-orange); }
.crumb svg { width: 14px; height: 14px; }
.crumb .here { color: var(--text); }

/* back link in header center (sub-pages) */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 15px;
  color: var(--muted);
  transition: color 0.2s ease;
}
.back-link:hover { color: var(--ktm-orange); }
.back-link svg { width: 18px; height: 18px; }

/* ============================================================
   PRODUCT
   ============================================================ */
.product {
  display: grid;
  grid-template-columns: 1fr;
  gap: 26px;
}

.gallery__main {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
}

.gallery__flag {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 3;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--ktm-orange);
  color: #0a0a0a;
  padding: 5px 11px;
  border-radius: 6px;
  transform: skewX(-8deg);
}

.gallery__thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.gallery__thumb {
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--line);
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.15s ease;
}

.gallery__thumb:hover { transform: translateY(-2px); }
.gallery__thumb.active { border-color: var(--ktm-orange); }
.gallery__thumb .ph__tag { font-size: 8px; padding: 3px 5px; }

.pinfo__cat {
  font-family: "Courier New", monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ktm-orange);
}

.pinfo__name {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(30px, 9vw, 44px);
  line-height: 1.0;
  margin: 8px 0 14px;
}

.pinfo__rating {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}

.stars { display: inline-flex; gap: 2px; color: var(--ktm-orange); }
.stars svg { width: 16px; height: 16px; }

.pinfo__price {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.pinfo__pricelabel {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 2px;
}
.pinfo__pricelabel:empty { display: none; }

.badge-new {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 13px;
  color: #2bd96b;
}
.badge-new::before {
  content: "";
  width: 8px; height: 8px; border-radius: 50%;
  background: #2bd96b;
  box-shadow: 0 0 8px #2bd96b;
}

.pinfo__price .now {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 40px;
  color: var(--text);
  line-height: 1;
  white-space: nowrap;
  flex: none;
}

.pinfo__price .was {
  font-size: 18px;
  color: var(--muted-2);
  text-decoration: line-through;
}

.pinfo__price .off {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  background: rgba(255, 102, 0, 0.16);
  color: var(--ktm-orange);
  padding: 4px 8px;
  border-radius: 6px;
}

.pinfo__installment {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 22px;
}
.pinfo__installment b { color: var(--text); }

/* variation block */
.varblock { margin-bottom: 20px; }

.varblock__label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 14px;
  margin-bottom: 10px;
}
.varblock__label .sel { color: var(--ktm-orange); }

.pills { display: flex; flex-wrap: wrap; gap: 10px; }

.pill {
  min-width: 52px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1.5px solid var(--line-strong);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  text-transform: uppercase;
  text-align: center;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.12s ease, color 0.18s ease;
}

.pill small { display: block; font-size: 10px; color: var(--muted); font-family: var(--font-body); letter-spacing: 0.06em; }
.pill:hover { border-color: var(--ktm-orange); transform: translateY(-2px); }
.pill[aria-pressed="true"] {
  background: var(--ktm-orange);
  border-color: var(--ktm-orange);
  color: #0a0a0a;
}
.pill[aria-pressed="true"] small { color: rgba(0,0,0,0.6); }
.pill.disabled { opacity: 0.35; pointer-events: none; text-decoration: line-through; }

/* color swatches */
.swatches { display: flex; gap: 12px; }
.swatch {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 2px solid var(--line-strong);
  position: relative;
  transition: transform 0.12s ease, border-color 0.18s ease;
}
.swatch:hover { transform: translateY(-2px); }
.swatch[aria-pressed="true"] { border-color: var(--ktm-orange); }
.swatch[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  inset: -6px;
  border: 1.5px solid var(--ktm-orange);
  border-radius: 13px;
}

/* size guide hint */
.hint-error {
  color: #ff6b6b;
  font-size: 13px;
  margin-top: 8px;
  display: none;
}
.hint-error.show { display: block; }

/* qty + add row */
.buyrow {
  display: flex;
  gap: 12px;
  align-items: stretch;
  margin: 22px 0 14px;
}

.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface-2);
  overflow: hidden;
  flex: none;
}

.qty-stepper button {
  width: 48px;
  height: 54px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  color: var(--text);
  transition: background 0.15s ease, color 0.15s ease;
}
.qty-stepper button:hover { background: var(--ktm-orange); color: #000; }
.qty-stepper span {
  min-width: 40px;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
}

.buyrow .btn { flex: 1; height: 54px; }

.buynow { width: 100%; height: 52px; }

.product-meta {
  margin-top: 26px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  display: grid;
  gap: 14px;
}
.product-meta .row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  color: var(--muted);
}
.product-meta .row b { color: var(--text); display: block; }
.product-meta svg { width: 22px; height: 22px; color: var(--ktm-orange); flex: none; }

/* specs accordion */
.specs {
  margin-top: 30px;
  border-top: 1px solid var(--line);
}
.specs__item { border-bottom: 1px solid var(--line); }
.specs__head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 2px;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 17px;
  color: var(--text);
}
.specs__head svg { width: 20px; height: 20px; color: var(--ktm-orange); transition: transform 0.3s var(--ease-out); }
.specs__item.open .specs__head svg { transform: rotate(45deg); }
.specs__panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s var(--ease-out);
}
.specs__item.open .specs__panel { max-height: 320px; }
.specs__panel-inner { padding: 0 2px 18px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.specs__panel-inner ul { display: grid; gap: 6px; }
.specs__panel-inner li { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px dashed var(--line); padding-bottom: 6px; }
.specs__panel-inner li b { color: var(--text); }

/* ============================================================
   STEP INDICATOR (checkout)
   ============================================================ */
.steps {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 26px;
}
.steps .step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted-2);
}
.steps .step b {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 13px;
}
.steps .step.active { color: var(--text); }
.steps .step.active b { background: var(--ktm-orange); color: #000; }
.steps .step.done b { background: rgba(255,102,0,0.2); color: var(--ktm-orange); }
.steps .bar { flex: 1; height: 2px; background: var(--line); border-radius: 2px; min-width: 12px; }
.steps .step span { display: none; }

/* ============================================================
   CHECKOUT
   ============================================================ */
.checkout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}

.co-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.co-section__title {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 20px;
  letter-spacing: 0.02em;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.co-section__title .n {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--ktm-orange); color: #000;
  display: grid; place-items: center;
  font-size: 15px;
}

/* order summary lines */
.co-line {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.co-line:last-child { border-bottom: none; }
.co-line__thumb { width: 48px; height: 48px; border-radius: 8px; overflow: hidden; }
.co-line__name { font-family: var(--font-display); font-weight: 700; font-size: 16px; text-transform: uppercase; line-height: 1.05; }
.co-line__variant { font-size: 12px; color: var(--muted); margin-top: 2px; }
.co-line__right { text-align: right; }
.co-line__price { font-family: var(--font-display); font-weight: 800; font-size: 16px; white-space: nowrap; }
.co-line .qty { margin-top: 6px; justify-content: flex-end; }

.co-empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.co-empty .btn { margin-top: 16px; }

/* forms */
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 7px;
  font-weight: 600;
}
.field input,
.field select {
  width: 100%;
  background: var(--ink-2);
  border: 1.5px solid var(--line-strong);
  border-radius: 10px;
  padding: 13px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field input::placeholder { color: var(--muted-2); }
.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--ktm-orange);
  box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.15);
}
.field input.invalid,
.field select.invalid { border-color: #ff6b6b; }
.field .err { color: #ff6b6b; font-size: 12px; margin-top: 5px; display: none; }
.field.show-err .err { display: block; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.field-row--cep { grid-template-columns: 1.2fr 1fr; }

.cep-btn {
  align-self: end;
  height: 49px;
}

/* radio cards (frete + pagamento) */
.opt-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 12px;
  cursor: pointer;
  margin-bottom: 10px;
  transition: border-color 0.2s ease, background 0.2s ease;
  position: relative;
}
.opt-card:hover { border-color: rgba(255,102,0,0.5); }
.opt-card input { position: absolute; opacity: 0; pointer-events: none; }
.opt-card .radio {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--line-strong);
  flex: none;
  display: grid; place-items: center;
  transition: border-color 0.2s ease;
}
.opt-card .radio::after {
  content: "";
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--ktm-orange);
  transform: scale(0);
  transition: transform 0.2s var(--ease-out);
}
.opt-card input:checked ~ .radio { border-color: var(--ktm-orange); }
.opt-card input:checked ~ .radio::after { transform: scale(1); }
.opt-card:has(input:checked) { border-color: var(--ktm-orange); background: rgba(255,102,0,0.06); }

.opt-card__icon { width: 26px; height: 26px; color: var(--text); flex: none; }
.opt-card__icon svg { width: 100%; height: 100%; }
.opt-card__main { flex: 1; min-width: 0; }
.opt-card__main .t { display: block; font-family: var(--font-display); font-weight: 700; font-size: 17px; text-transform: uppercase; line-height: 1.05; }
.opt-card__main .d { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.opt-card__price { font-family: var(--font-display); font-weight: 800; font-size: 16px; white-space: nowrap; }
.opt-card__price.free { color: #2bd96b; }

/* payment extra panels */
.pay-panel {
  display: none;
  margin-top: 4px;
  padding: 14px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--ink-2);
}
.pay-panel.show { display: block; animation: itemIn 0.3s var(--ease-out); }
.pay-panel .pix-box {
  display: flex; gap: 14px; align-items: center;
}
.pix-qr {
  width: 84px; height: 84px; border-radius: 10px; flex: none;
  background:
    conic-gradient(#000 0 25%, #fff 0 50%, #000 0 75%, #fff 0) 0 0 / 16px 16px,
    var(--text);
  border: 4px solid var(--text);
}
.pay-panel .pix-box p { font-size: 13px; color: var(--muted); }
.pay-panel .pix-box b { color: #2bd96b; }

/* totals box */
.totals { display: grid; gap: 9px; }
.totals .t-line { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); }
.totals .t-line b { color: var(--text); }
.totals .t-line.discount b { color: #2bd96b; }
.totals .t-grand {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line);
}
.totals .t-grand .label { text-transform: uppercase; letter-spacing: 0.1em; font-size: 13px; color: var(--muted); }
.totals .t-grand .value { font-family: var(--font-display); font-weight: 800; font-size: 32px; color: var(--ktm-orange); }
.totals .t-grand .value small { font-size: 14px; color: var(--muted); display: block; text-align: right; font-weight: 600; }

/* sticky pay bar (mobile) */
.paybar {
  position: sticky;
  bottom: 0;
  z-index: 40;
  margin: 18px -20px -60px;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(0deg, var(--ink) 60%, transparent);
}
.paybar .btn { width: 100%; height: 56px; font-size: 18px; }
.paybar__hint { text-align: center; font-size: 12px; color: var(--muted-2); margin-top: 8px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.paybar__hint svg { width: 14px; height: 14px; }

/* ============================================================
   OBRIGADO
   ============================================================ */
.thanks {
  text-align: center;
  max-width: 560px;
  margin-inline: auto;
}
.thanks__check {
  width: 92px; height: 92px;
  border-radius: 50%;
  margin: 10px auto 22px;
  display: grid; place-items: center;
  background: radial-gradient(circle, rgba(43,217,107,0.2), transparent 70%);
  position: relative;
}
.thanks__check svg { width: 56px; height: 56px; color: #2bd96b; }
.thanks__check::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 2px solid #2bd96b;
  animation: ringOut 1.6s var(--ease-out) infinite;
}
@keyframes ringOut {
  0% { transform: scale(0.7); opacity: 0.8; }
  100% { transform: scale(1.5); opacity: 0; }
}

.thanks h1 {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(34px, 11vw, 56px);
  line-height: 0.92;
  margin-bottom: 12px;
}
.thanks h1 .orange { color: var(--ktm-orange); }
.thanks p.lede { color: var(--muted); font-size: 16px; margin-bottom: 24px; }

.order-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  text-align: left;
  margin-bottom: 18px;
}
.order-card__head {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
  padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 16px;
}
.order-card__num { font-family: "Courier New", monospace; font-size: 13px; color: var(--muted); }
.order-card__num b { color: var(--ktm-orange); font-size: 18px; display: block; letter-spacing: 0.04em; }
.order-pill {
  font-family: var(--font-display); font-weight: 700; text-transform: uppercase;
  font-size: 12px; letter-spacing: 0.06em;
  background: rgba(255,102,0,0.14); color: var(--ktm-orange);
  padding: 6px 12px; border-radius: 20px;
}
.order-meta { display: grid; gap: 12px; margin-bottom: 16px; }
.order-meta .m { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; }
.order-meta .m svg { width: 20px; height: 20px; color: var(--ktm-orange); flex: none; margin-top: 1px; }
.order-meta .m span b { display: block; color: var(--text); }
.order-meta .m span { color: var(--muted); }

.order-items { border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 10px; }
.order-items .oi { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.order-items .oi .nm { color: var(--text); }
.order-items .oi .nm small { display: block; color: var(--muted); font-size: 12px; }
.order-items .oi .pr { font-family: var(--font-display); font-weight: 700; white-space: nowrap; }
.order-total {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line);
}
.order-total .label { text-transform: uppercase; letter-spacing: 0.1em; font-size: 12px; color: var(--muted); }
.order-total .value { font-family: var(--font-display); font-weight: 800; font-size: 26px; color: var(--ktm-orange); }

.thanks__cta { display: grid; gap: 12px; }

/* confetti */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.confetti i {
  position: absolute;
  top: -20px;
  width: 9px; height: 14px;
  opacity: 0.9;
  animation: fall linear forwards;
}
@keyframes fall {
  to { transform: translateY(110vh) rotate(720deg); opacity: 0.2; }
}

/* ============================================================
   DESKTOP
   ============================================================ */
@media (min-width: 800px) {
  .product { grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
  .gallery { position: sticky; top: calc(var(--header-h) + 20px); }
  .checkout { grid-template-columns: 1.4fr 1fr; align-items: start; }
  .checkout__aside { position: sticky; top: calc(var(--header-h) + 20px); display: grid; gap: 22px; }
  .checkout__main { display: grid; gap: 22px; }
  .paybar { position: static; margin: 0; padding: 0; background: none; }
  .steps .step span { display: inline; }
}
