/* ==========================================================================
   LA VIERRO — base compartilhada
   Tokens de marca extraídos das peças reais + componentes universais
   (badge de frete, WhatsApp flutuante, drawer de carrinho, modal de produto)
   Cada versão (v1/v2/v3) sobrescreve as variáveis de superfície.
   ========================================================================== */

:root {
  /* paleta da marca (extraída das fotos das peças) */
  --sand: #c2a98f;
  --camel: #ad906e;
  --wine: #33222a;
  --navy: #1b1c25;
  --cream: #efeae3;
  --ink: #17161a;
  --leather: #6b5545;
  --olive: #4e5545;

  /* superfícies — cada versão redefine */
  --bg: var(--cream);
  --fg: var(--ink);
  --muted: #6f6a63;
  --line: rgba(23, 22, 26, 0.14);
  --surface: #fff;
  --accent: var(--camel);
  --accent-fg: #fff;

  --wa: #25d366;
  --radius: 2px;
  /* Playfair Display = didone de alto contraste, a mais próxima do bordado */
  --ff-display: 'Playfair Display', 'Times New Roman', serif;
  --ff-sans: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* `clip` (não `hidden`) contém o vazamento de 100vw dos elementos fixos
     — drawer, modal, botão de WhatsApp — sem criar contexto de rolagem,
     o que quebraria os cabeçalhos sticky. */
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--ff-sans);
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input, select { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.lv-sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------------------------------------------------- LOGOTIPO (placeholder)
   A logo oficial em vetor ainda não foi entregue pelo cliente.
   Reconstrução tipográfica fiel ao bordado das peças: wordmark serifado com
   R espelhado + "SINCE 2025" + traços laterais.
   TROCA FUTURA: substituir o conteúdo de .lv-logo por <img src="logo.svg">.
   -------------------------------------------------------------------------- */
.lv-logo {
  display: inline-flex; flex-direction: column; align-items: center;
  line-height: 1; user-select: none;
}
.lv-logo__word {
  display: flex; align-items: center; gap: 0.5em;
  font-family: var(--ff-display);
  font-size: var(--logo-size, 26px);
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.lv-logo__rule {
  display: block; width: 1.15em; height: 1px;
  background: currentColor; opacity: 0.75; flex: none;
}
.lv-logo__r { display: inline-block; transform: scaleX(-1); }
.lv-logo__tag {
  margin-top: 0.42em;
  font-family: var(--ff-sans);
  font-size: calc(var(--logo-size, 26px) * 0.26);
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  opacity: 0.7;
  font-weight: 500;
}

/* ------------------------------------------------------------ BADGE FRETE -- */
.lv-frete {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 14px 7px 11px;
  border-radius: 99px;
  background: var(--frete-bg, rgba(23, 22, 26, 0.06));
  color: var(--frete-fg, inherit);
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.01em;
  line-height: 1.25;
}
.lv-frete--solid { --frete-bg: var(--accent); --frete-fg: var(--accent-fg); }

/* moto correndo */
.lv-moto { flex: none; width: 30px; height: 20px; overflow: visible; }
.lv-moto__body { animation: lv-bump 0.55s var(--ease) infinite; transform-origin: center; }
.lv-moto__wheel { animation: lv-spin 0.5s linear infinite; transform-origin: center; }
.lv-moto__speed { animation: lv-dash 0.55s linear infinite; }

@keyframes lv-bump {
  0%, 100% { transform: translateY(0); }
  45% { transform: translateY(-0.9px); }
}
@keyframes lv-spin { to { transform: rotate(360deg); } }
@keyframes lv-dash {
  0% { opacity: 0; transform: translateX(3px); }
  40% { opacity: 1; }
  100% { opacity: 0; transform: translateX(-7px); }
}

@media (prefers-reduced-motion: reduce) {
  .lv-moto__body, .lv-moto__wheel, .lv-moto__speed { animation: none; }
  html { scroll-behavior: auto; }
}

/* --------------------------------------------------- WHATSAPP FLUTUANTE -- */
.lv-wa {
  position: fixed; right: 18px; bottom: 18px; z-index: 90;
  display: flex; align-items: center; gap: 10px;
  height: 54px; padding: 0 20px 0 16px;
  border-radius: 99px;
  background: var(--wa); color: #fff;
  font-weight: 650; font-size: 14px; letter-spacing: 0.01em;
  box-shadow: 0 6px 26px rgba(37, 211, 102, 0.42);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.lv-wa:hover { transform: translateY(-2px); box-shadow: 0 10px 32px rgba(37, 211, 102, 0.5); }
.lv-wa svg { flex: none; width: 24px; height: 24px; fill: currentColor; }
.lv-wa__txt { white-space: nowrap; }

/* pulso discreto */
.lv-wa::after {
  content: ''; position: absolute; inset: 0; border-radius: 99px;
  border: 2px solid var(--wa); opacity: 0;
  animation: lv-pulse 2.8s var(--ease) infinite;
  pointer-events: none;
}
@keyframes lv-pulse {
  0% { opacity: 0.55; transform: scale(1); }
  70%, 100% { opacity: 0; transform: scale(1.28); }
}
@media (prefers-reduced-motion: reduce) { .lv-wa::after { animation: none; } }

@media (max-width: 640px) {
  .lv-wa { right: 14px; bottom: 14px; height: 50px; padding: 0 16px 0 14px; }
  .lv-wa__txt { display: none; }
  .lv-wa { padding: 0; width: 50px; justify-content: center; }
}

/* --------------------------------------------------------------- BOTÕES -- */
.lv-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px;
  border-radius: var(--radius);
  background: var(--fg); color: var(--bg);
  font-size: 13px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), background 0.2s var(--ease);
}
.lv-btn:hover { opacity: 0.86; }
.lv-btn:active { transform: translateY(1px); }
.lv-btn[disabled] { opacity: 0.32; pointer-events: none; }
.lv-btn--ghost {
  background: transparent; color: var(--fg);
  box-shadow: inset 0 0 0 1px var(--line);
}
.lv-btn--ghost:hover { background: rgba(127, 127, 127, 0.08); opacity: 1; }
.lv-btn--wa { background: var(--wa); color: #fff; }
.lv-btn--full { width: 100%; }

/* --------------------------------------------------------------- TAGS ---- */
.lv-tag {
  display: inline-block; padding: 4px 9px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase;
  border-radius: var(--radius); background: var(--fg); color: var(--bg);
}
.lv-tag--novo { background: var(--olive); color: #fff; }
.lv-tag--sale { background: var(--wine); color: #fff; }
.lv-tag--top { background: var(--camel); color: #fff; }

/* --------------------------------------------------- DRAWER DO CARRINHO -- */
.lv-scrim {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(10, 9, 12, 0.55);
  backdrop-filter: blur(3px);
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0.3s;
}
.lv-scrim.is-open { opacity: 1; visibility: visible; }

.lv-cart {
  position: fixed; top: 0; right: 0; z-index: 101;
  width: min(420px, 100vw); height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--surface); color: var(--fg);
  transform: translateX(101%);
  transition: transform 0.38s var(--ease);
  box-shadow: -12px 0 44px rgba(0, 0, 0, 0.2);
}
.lv-cart.is-open { transform: none; }

.lv-cart__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 22px; border-bottom: 1px solid var(--line); flex: none;
}
.lv-cart__title { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.lv-cart__close {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 50%; font-size: 20px; line-height: 1;
  transition: background 0.2s;
}
.lv-cart__close:hover { background: rgba(127, 127, 127, 0.14); }

.lv-cart__body { flex: 1; overflow-y: auto; padding: 8px 22px; -webkit-overflow-scrolling: touch; }
.lv-cart__empty { padding: 56px 8px; text-align: center; color: var(--muted); font-size: 14px; }

.lv-ci { display: grid; grid-template-columns: 66px 1fr auto; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.lv-ci__img { width: 66px; aspect-ratio: 3/4; object-fit: cover; background: rgba(127, 127, 127, 0.1); border-radius: var(--radius); }
.lv-ci__nome { font-size: 13.5px; font-weight: 600; margin: 0 0 3px; line-height: 1.35; }
.lv-ci__meta { font-size: 12px; color: var(--muted); margin: 0 0 9px; }
.lv-ci__qtd { display: inline-flex; align-items: center; gap: 2px; box-shadow: inset 0 0 0 1px var(--line); border-radius: var(--radius); }
.lv-ci__qtd button { width: 28px; height: 28px; display: grid; place-items: center; font-size: 15px; line-height: 1; transition: background 0.15s; }
.lv-ci__qtd button:hover { background: rgba(127, 127, 127, 0.12); }
.lv-ci__qtd span { min-width: 26px; text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; }
.lv-ci__right { text-align: right; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; }
.lv-ci__preco { font-size: 13.5px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lv-ci__del { font-size: 11px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.lv-ci__del:hover { color: var(--wine); }

.lv-cart__foot { flex: none; padding: 18px 22px calc(18px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: grid; gap: 12px; }
.lv-cart__row { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; }
.lv-cart__row strong { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.lv-cart__frete { display: flex; justify-content: center; }

/* ------------------------------------------------- MODAL DO PRODUTO ------ */
.lv-modal {
  position: fixed; inset: 0; z-index: 102;
  display: grid; place-items: center; padding: 20px;
  opacity: 0; visibility: hidden;
  transition: opacity 0.28s var(--ease), visibility 0.28s;
}
.lv-modal.is-open { opacity: 1; visibility: visible; }
.lv-modal__box {
  position: relative;
  width: min(920px, 100%); max-height: min(88dvh, 760px);
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--surface); color: var(--fg);
  border-radius: var(--radius); overflow: hidden;
  transform: translateY(14px) scale(0.985);
  transition: transform 0.32s var(--ease);
}
.lv-modal.is-open .lv-modal__box { transform: none; }

.lv-modal__gal { background: rgba(127, 127, 127, 0.08); display: flex; flex-direction: column; min-height: 0; }
.lv-modal__main { flex: 1; min-height: 0; }
.lv-modal__main img { width: 100%; height: 100%; object-fit: cover; }
.lv-modal__thumbs { flex: none; display: flex; gap: 6px; padding: 8px; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.lv-modal__thumbs::-webkit-scrollbar { display: none; }
.lv-modal__thumbs img {
  width: 52px; aspect-ratio: 3/4; object-fit: cover; cursor: pointer;
  opacity: 0.5; transition: opacity 0.2s; border-radius: 1px; flex: none;
}
.lv-modal__thumbs img:hover { opacity: 0.82; }
.lv-modal__thumbs img.is-on { opacity: 1; box-shadow: inset 0 0 0 2px var(--fg); }

.lv-modal__info { padding: 34px 32px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.lv-modal__tipo { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin: 0; }
.lv-modal__nome { font-family: var(--ff-display); font-size: 32px; font-weight: 600; line-height: 1.1; margin: 0; }
.lv-modal__preco { display: flex; align-items: baseline; gap: 10px; }
.lv-modal__preco b { font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums; }
.lv-modal__preco s { color: var(--muted); font-size: 15px; }
.lv-modal__parc { font-size: 12.5px; color: var(--muted); margin: -10px 0 0; }
.lv-modal__desc { font-size: 14px; line-height: 1.65; color: var(--muted); margin: 0; }
.lv-modal__mat { font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; margin: 0; }

.lv-sizes { display: flex; flex-wrap: wrap; gap: 7px; }
.lv-size {
  min-width: 46px; height: 42px; padding: 0 10px;
  display: grid; place-items: center;
  box-shadow: inset 0 0 0 1px var(--line);
  border-radius: var(--radius);
  font-size: 13px; font-weight: 600;
  transition: all 0.18s var(--ease);
}
.lv-size:hover { box-shadow: inset 0 0 0 1px var(--fg); }
.lv-size.is-on { background: var(--fg); color: var(--bg); box-shadow: none; }
.lv-lbl { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 0 0 -8px; }

.lv-modal__close {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 50%; background: var(--surface); color: var(--fg);
  font-size: 20px; line-height: 1; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.16);
}

@media (max-width: 760px) {
  .lv-modal { padding: 0; align-items: end; }
  .lv-modal__box { grid-template-columns: 1fr; max-height: 92dvh; width: 100%; }
  .lv-modal__gal { flex-direction: row; max-height: 40dvh; }
  .lv-modal__thumbs { flex-direction: column; padding: 6px; overflow-y: auto; overflow-x: hidden; }
  .lv-modal__info { padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); }
  .lv-modal__nome { font-size: 26px; }
}

/* ------------------------------------------------------------- TOAST ----- */
.lv-toast {
  position: fixed; left: 50%; bottom: 90px; z-index: 105;
  transform: translate(-50%, 14px);
  padding: 12px 20px; border-radius: 99px;
  background: var(--ink); color: #fff;
  font-size: 13px; font-weight: 600;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}
.lv-toast.is-on { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

/* ---------------------------------------------------- CONTAGEM CARRINHO -- */
.lv-cartbtn { position: relative; display: inline-flex; align-items: center; gap: 8px; }
.lv-cartbtn__n {
  position: absolute; top: -6px; right: -9px;
  min-width: 18px; height: 18px; padding: 0 5px;
  display: grid; place-items: center;
  border-radius: 99px; background: var(--accent); color: var(--accent-fg);
  font-size: 10.5px; font-weight: 700; font-variant-numeric: tabular-nums;
  transform: scale(0); transition: transform 0.26s var(--ease);
}
.lv-cartbtn__n.is-on { transform: scale(1); }

/* ------------------------------------------------------ NOTA DE CONTEXTO - */
.lv-ctx { background: var(--ink); color: #d9d4cc; padding: 68px 0 84px; }
.lv-ctx__in { width: min(880px, 88vw); margin: 0 auto; }
.lv-ctx__kicker { font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--camel); margin: 0 0 14px; }
.lv-ctx h2 { font-family: var(--ff-display); font-size: clamp(28px, 4vw, 40px); font-weight: 600; line-height: 1.12; margin: 0 0 26px; color: #fff; }
.lv-ctx h3 { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--sand); margin: 32px 0 12px; }
.lv-ctx p { font-size: 14.5px; line-height: 1.75; margin: 0 0 14px; color: #b9b2a8; }
.lv-ctx ul { margin: 0 0 14px; padding-left: 18px; }
.lv-ctx li { font-size: 14.5px; line-height: 1.7; margin-bottom: 8px; color: #b9b2a8; }
.lv-ctx strong { color: #efeae3; font-weight: 600; }
/* sempre 4 células: 4 col → 2 col → 1 col, nunca 3 (deixaria célula órfã) */
.lv-ctx__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: rgba(255, 255, 255, 0.1); margin: 26px 0; }
@media (max-width: 900px) { .lv-ctx__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .lv-ctx__grid { grid-template-columns: 1fr; } }
.lv-ctx__cell { background: var(--ink); padding: 20px 18px; }
.lv-ctx__cell b { display: block; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--sand); margin-bottom: 7px; }
.lv-ctx__cell span { font-size: 13.5px; line-height: 1.6; color: #b9b2a8; }
.lv-ctx__alert { border-left: 2px solid var(--camel); padding: 4px 0 4px 18px; margin: 26px 0; }
.lv-ctx__back {
  display: inline-flex; align-items: center; gap: 9px; margin-top: 34px;
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600;
  color: #fff; padding-bottom: 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  transition: gap 0.22s var(--ease);
}
.lv-ctx__back:hover { gap: 15px; }
.lv-ctx__swatches { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 0; }
.lv-ctx__sw { display: flex; flex-direction: column; gap: 6px; align-items: center; font-size: 10px; letter-spacing: 0.06em; color: #8e8880; }
.lv-ctx__sw i { width: 46px; height: 46px; border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14); }
