:root {
  --bg: #ffffff;
  --soft: #f4f4f2;
  --photo-bg: #f1f1ef;
  --ink: #161816;
  --muted: #7a7f7b;
  --line: #ebebe8;
  --brand: #0f3a2a;
  --accent: #1d6b47;
  --accent-soft: #e8f3ec;
  --reserved: #b7791f;
  --sold: #9aa09c;
  --danger: #b42318;
  --radius: 12px;
  --shadow: 0 1px 2px rgb(16 24 20 / 0.04), 0 6px 20px rgb(16 24 20 / 0.06);
  --shadow-hover: 0 2px 4px rgb(16 24 20 / 0.05), 0 14px 32px rgb(16 24 20 / 0.10);
  --mono: "Space Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 32px; }

/* ---------- Barra superior ---------- */

.topbar { background: var(--brand); color: #fff; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
.topbar .logo { display: block; height: 26px; }
.topbar .logo img { height: 100%; width: auto; display: block; }
.topbar .info { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.85; text-align: right; }

/* ---------- Abertura ---------- */

.hero { padding: 56px 0 36px; }
.hero h1 { margin: 0 0 10px; font-size: clamp(1.8rem, 3.6vw, 2.6rem); font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; }
.hero p { margin: 0; color: var(--muted); max-width: 58ch; font-size: 0.98rem; font-weight: 300; }
.hero strong { color: var(--ink); font-weight: 500; }

/* ---------- Catálogo: lateral + grade ---------- */

.catalog { display: grid; grid-template-columns: 180px 1fr; gap: 48px; padding-bottom: 88px; }

.side { position: sticky; top: 24px; align-self: start; display: flex; flex-direction: column; gap: 28px; }
.side h3 { margin: 0 0 10px; font-family: var(--mono); font-size: 0.68rem; font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.side .links { display: flex; flex-direction: column; gap: 6px; }
.link {
  all: unset; cursor: pointer; font-size: 0.95rem; color: var(--muted); font-weight: 400;
  transition: color 0.15s;
}
.link:hover { color: var(--ink); }
.link[aria-pressed="true"] { color: var(--ink); font-weight: 500; }
.side .count { font-size: 0.82rem; color: var(--muted); font-weight: 300; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 40px 28px; align-content: start; }

/* Cada card usa as mesmas linhas da grade (subgrid), então título, preço e botão ficam alinhados lado a lado. */
.card {
  display: grid; grid-row: span 5; grid-template-rows: subgrid; row-gap: 0;
}
.card > * { min-width: 0; }

.media {
  position: relative; border-radius: var(--radius); overflow: hidden; background: var(--photo-bg);
  box-shadow: var(--shadow); transition: box-shadow 0.2s, transform 0.2s;
}
.card:hover .media { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.card.is-sold .media img { filter: grayscale(1); opacity: 0.6; }

.photos {
  aspect-ratio: 1 / 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
}
.photos::-webkit-scrollbar { display: none; }
.photos img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: start; }
.photos .empty { margin: auto; color: var(--muted); font-size: 0.85rem; }
.photo-count { display: none; }

.pill {
  position: absolute; display: inline-flex; align-items: center; gap: 6px; background: rgb(255 255 255 / 0.94);
  backdrop-filter: blur(6px); color: var(--ink); font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.04em;
  text-transform: uppercase; padding: 5px 9px; border-radius: 999px; pointer-events: none;
}
.pill.status { top: 12px; left: 12px; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.pill.reserved .dot { background: var(--reserved); }
.pill.sold .dot { background: var(--sold); }
.pill .timer { font-variant-numeric: tabular-nums; }
.tags { position: absolute; left: 12px; bottom: 12px; right: 12px; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none; }
.tags .pill { position: static; }
.tags .pill.green { color: var(--accent); }

.card h2 { margin: 16px 0 0; font-size: 1rem; font-weight: 500; line-height: 1.35; letter-spacing: -0.005em; }
.price-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.price { font-weight: 400; font-size: 1rem; color: var(--ink); }
.card.is-sold .price { color: var(--sold); text-decoration: line-through; }
.pickup-price { font-size: 0.82rem; color: var(--muted); font-weight: 300; }
.pickup-price strong { color: var(--accent); font-weight: 500; }
.card .desc {
  margin: 8px 0 0; color: var(--muted); font-size: 0.85rem; font-weight: 300; white-space: pre-line;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer;
}
.card h2 a, .card a.desc { color: inherit; text-decoration: none; }
.card h2 a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.card a.media { display: block; }
.card .actions { margin-top: 14px; align-self: end; }
.card .btn { width: 100%; }

/* ---------- Página do item ---------- */

.crumbs { padding: 28px 0 20px; font-size: 0.85rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }

.product { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 56px; align-items: start; padding-bottom: 72px; }
.product > .state { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 16px; }

.gallery { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 24px; }
.stage { position: relative; border-radius: 16px; overflow: hidden; background: var(--photo-bg); box-shadow: var(--shadow); }
.stage.empty { aspect-ratio: 1; display: grid; place-items: center; }
.stage.is-sold img { filter: grayscale(1); opacity: 0.6; }
.stage-strip { display: flex; aspect-ratio: 1 / 1; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.stage-strip::-webkit-scrollbar { display: none; }
.stage-strip img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: start; cursor: zoom-in; }
.stage .pill.big { top: 16px; left: 16px; font-size: 0.72rem; padding: 6px 11px; }
.stage .nav, .stage .zoom {
  position: absolute; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgb(255 255 255 / 0.92);
  box-shadow: var(--shadow); color: var(--ink); font-size: 1.4rem; line-height: 1; cursor: pointer; display: grid; place-items: center;
  opacity: 0; transition: opacity 0.2s;
}
.stage:hover .nav, .stage:hover .zoom, .stage .nav:focus-visible, .stage .zoom:focus-visible { opacity: 1; }
.stage .nav { top: 50%; transform: translateY(-50%); }
.stage .nav.prev { left: 14px; }
.stage .nav.next { right: 14px; }
.stage .zoom { top: 14px; right: 14px; font-size: 1.05rem; }
.stage .counter { position: absolute; right: 16px; bottom: 16px; font-family: var(--mono); font-size: 0.7rem; background: rgb(255 255 255 / 0.92); padding: 4px 9px; border-radius: 999px; }

.thumbs { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.thumb { flex: 0 0 76px; height: 76px; padding: 0; border: 0; border-radius: 10px; overflow: hidden; cursor: pointer; background: var(--photo-bg); opacity: 0.55; transition: opacity 0.15s, box-shadow 0.15s; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb:hover { opacity: 0.85; }
.thumb.active { opacity: 1; box-shadow: 0 0 0 2px var(--brand); }

.info-panel { display: flex; flex-direction: column; gap: 18px; padding-top: 4px; }
.info-panel h1 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; }
.price-block { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.big-price { font-size: 1.5rem; font-weight: 400; }
.price-block .pickup-price { font-size: 0.95rem; }
.btn.big { padding: 15px 22px; font-size: 1rem; width: 100%; }
.description { white-space: pre-line; font-size: 0.98rem; font-weight: 300; line-height: 1.7; color: #3b403c; padding-top: 6px; border-top: 1px solid var(--line); padding-top: 22px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 10px 22px; margin: 0; padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 0.88rem; }
.facts dt { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.facts dd { margin: 0; font-weight: 300; }
.share { display: flex; gap: 8px; flex-wrap: wrap; }

.how { padding: 56px 0; border-top: 1px solid var(--line); }
.how h3, .more h3 { margin: 0 0 24px; font-family: var(--mono); font-size: 0.7rem; font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.how ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.how li { display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; font-weight: 300; color: var(--muted); }
.how li span { font-family: var(--mono); font-size: 0.75rem; color: var(--accent); }
.how li strong { color: var(--ink); font-weight: 500; font-size: 1rem; }
.how li b { font-weight: 500; color: var(--ink); }
.more { padding: 8px 0 88px; }

.viewer { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; border-radius: 0; background: rgb(10 14 12 / 0.96); padding: 0; }
.viewer::backdrop { background: transparent; }
.viewer-strip { display: flex; width: 100%; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.viewer-strip::-webkit-scrollbar { display: none; }
.viewer .slide { flex: 0 0 100%; height: 100%; display: grid; place-items: center; scroll-snap-align: start; padding: 48px 16px; }
.viewer .slide img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }
.viewer-btn { position: fixed; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgb(255 255 255 / 0.12); color: #fff; font-size: 1.8rem; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.viewer-btn:hover { background: rgb(255 255 255 / 0.22); }
.viewer-btn.close { top: 18px; right: 18px; }
.viewer-btn.prev { left: 18px; top: 50%; transform: translateY(-50%); }
.viewer-btn.next { right: 18px; top: 50%; transform: translateY(-50%); }
.viewer.single .viewer-btn.prev, .viewer.single .viewer-btn.next, .viewer.single .viewer-count { display: none; }
.viewer-count { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); color: #fff; font-family: var(--mono); font-size: 0.75rem; opacity: 0.8; }

/* ---------- Status (admin) ---------- */

.badge { font-family: var(--mono); font-size: 0.66rem; padding: 3px 8px; border-radius: 999px; white-space: nowrap; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 400; }
.badge.available { background: var(--accent-soft); color: var(--accent); }
.badge.reserved { background: #fbf0d6; color: var(--reserved); }
.badge.sold { background: var(--soft); color: var(--sold); }
.badge.hidden { background: var(--soft); color: var(--muted); }

/* ---------- Botões e formulários ---------- */

.btn {
  border: 1px solid var(--brand); border-radius: 999px; padding: 11px 18px; font: inherit; font-size: 0.88rem; font-weight: 500;
  cursor: pointer; background: var(--brand); color: #fff; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { background: var(--accent); border-color: var(--accent); }
.btn:disabled { background: var(--soft); border-color: var(--soft); color: var(--muted); cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.danger { background: #fff; color: var(--danger); border-color: #f1c4bf; }
.btn.small { padding: 6px 12px; font-size: 0.78rem; }
.btn.wa { background: #1fa855; border-color: #1fa855; }
.btn.chip-btn {
  background: var(--soft); border-color: var(--soft); color: var(--ink); font-family: var(--mono); font-weight: 400;
  font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; border-radius: 6px;
}
.btn.chip-btn:hover { background: #e8e8e5; border-color: #e8e8e5; }

.chip {
  border: 0; background: var(--soft); color: var(--muted); font-family: var(--mono); font-size: 0.72rem;
  letter-spacing: 0.06em; text-transform: uppercase; padding: 9px 14px; border-radius: 6px; cursor: pointer;
}
.chip:hover { color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--brand); color: #fff; }

.note { color: var(--muted); font-size: 0.82rem; margin: 0; font-weight: 300; }

dialog {
  border: 0; border-radius: 16px; padding: 0; width: min(460px, calc(100vw - 24px));
  box-shadow: 0 24px 80px rgb(16 24 20 / 0.22);
}
dialog::backdrop { background: rgb(16 24 20 / 0.35); backdrop-filter: blur(2px); }
dialog .inner { padding: 26px; display: flex; flex-direction: column; gap: 14px; }
dialog h3 { margin: 0; font-size: 1.15rem; font-weight: 500; }
dialog .actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

label { display: flex; flex-direction: column; gap: 5px; font-size: 0.84rem; font-weight: 500; }
input, textarea, select {
  font: inherit; font-weight: 400; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); width: 100%;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }

fieldset.delivery { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
fieldset.delivery legend { font-size: 0.84rem; font-weight: 500; margin-bottom: 6px; padding: 0; }
label.option {
  flex-direction: row; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 12px; cursor: pointer; font-weight: 400;
}
label.option input { width: auto; margin: 0; accent-color: var(--accent); }
label.option strong { margin-left: auto; color: var(--accent); font-weight: 500; }
label.option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

.error { color: var(--danger); font-size: 0.88rem; margin: 0; }
.error:empty { display: none; }

.pixbox { background: var(--soft); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.pixbox code { font-family: var(--mono); font-size: 0.7rem; word-break: break-all; background: #fff; border-radius: 8px; padding: 8px; display: block; max-height: 90px; overflow: auto; }

.mine { background: var(--accent-soft); border-radius: var(--radius); padding: 16px 18px; margin: 0 0 32px; }
.mine h2 { margin: 0 0 8px; font-family: var(--mono); font-size: 0.7rem; font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.mine ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.mine li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; font-size: 0.9rem; }

.state { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 60px 0; font-weight: 300; }

footer { border-top: 1px solid var(--line); }
footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 22px; padding-bottom: 32px; color: var(--muted); font-size: 0.82rem; font-weight: 300; }
footer img { height: 16px; opacity: 0.35; }

/* ---------- Celular ---------- */

@media (max-width: 860px) {
  .wrap { padding: 0 18px; }
  .hero { padding: 36px 0 24px; }
  .catalog { grid-template-columns: 1fr; gap: 20px; }
  .side { position: static; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
  .side h3 { display: none; }
  .side .links { flex-direction: row; gap: 16px; }
  .side .group-sort { margin-left: auto; }
  .side .count { width: 100%; order: 9; }
  .topbar .wrap { height: 58px; }
  .topbar .logo { height: 22px; }
  .topbar .info { font-size: 0.62rem; }
  .product { grid-template-columns: 1fr; gap: 28px; padding-bottom: 48px; }
  .gallery { position: static; margin: 0 -18px; }
  .stage { border-radius: 0; box-shadow: none; }
  .stage .nav, .stage .zoom { display: none; }
  .thumbs { padding: 2px 18px; }
  .how ol { grid-template-columns: 1fr; gap: 20px; }
  .crumbs { padding: 18px 0 14px; }
}

@media (max-width: 560px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 28px 14px; }
  .card h2 { font-size: 0.9rem; margin-top: 12px; }
  .price, .card .desc { font-size: 0.82rem; }
  .card .desc { -webkit-line-clamp: 2; }
  .pill { font-size: 0.58rem; padding: 4px 7px; }
  .btn { padding: 9px 12px; font-size: 0.82rem; }
  .side .group-sort { margin-left: 0; width: 100%; }
}
