/* SGA Shop - site público do marketplace (v1.22). Visual de marketplace (estilo Shopee / Mercado Livre):
   topo laranja com busca grande, fundo cinza-claro, cartões brancos, preço em destaque e "Frete grátis" em verde.
   A cor inteira sai de --brand (trocar aqui troca tudo). */
:root {
  --brand: #ea580c;
  --brand-2: #f97316;
  --brand-strong: #c2410c;
  --brand-soft: #fff1e8;
  --bg: #f5f5f5;
  --card: #ffffff;
  --line: #e7e7e7;
  --text: #222222;
  --muted: #6b6b6b;
  --faint: #9a9a9a;
  --ok: #00a650;
  --wa: #1fa855;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 4px 14px rgba(0, 0, 0, .05);
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button, input, select { font: inherit; }
.ic { display: inline-grid; place-items: center; }
.ic svg { width: 18px; height: 18px; }
.boot { padding: 80px 16px; text-align: center; color: var(--muted); }
.muted { color: var(--muted); }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.center { display: flex; justify-content: center; margin: 18px 0; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; color: var(--text); font-weight: 700; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--brand); color: var(--brand-strong); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-strong); color: #fff; }
.btn.primary:disabled { background: #f3b48f; border-color: #f3b48f; cursor: not-allowed; }
.btn.wa { background: var(--wa); border-color: var(--wa); color: #fff; }
.btn.wa:hover { filter: brightness(.95); color: #fff; }
.btn.ghost { background: transparent; }
.btn.light { background: #fff; color: var(--brand-strong); border-color: #fff; }
.btn.big { width: 100%; padding: 13px 16px; font-size: 16px; }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.more { min-width: 240px; }
.btn:disabled { opacity: .85; }
.link { background: none; border: 0; color: var(--brand-strong); font-weight: 700; cursor: pointer; padding: 0; }

/* ---------- topo ---------- */
.top { background: linear-gradient(180deg, var(--brand), var(--brand-2)); color: #fff; position: sticky; top: 0; z-index: 20; }
.top-in { max-width: 1200px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 18px; }
.logo { display: flex; align-items: center; gap: 8px; font-size: 22px; font-weight: 600; white-space: nowrap; }
.logo b { font-weight: 900; }
.logo-mark { width: 36px; height: 36px; border-radius: 10px; background: #fff; color: var(--brand); display: grid; place-items: center; }
.logo-mark svg { width: 22px; height: 22px; }
.search { flex: 1; display: flex; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0, 0, 0, .15); min-width: 0; }
.search input { flex: 1; min-width: 0; border: 0; padding: 11px 14px; outline: none; color: var(--text); font-size: 15px; }
.search button { border: 0; background: var(--brand); color: #fff; padding: 0 16px; margin: 4px; border-radius: 6px; cursor: pointer; }
.top-links { display: flex; align-items: center; gap: 16px; font-weight: 700; white-space: nowrap; }
.top-links a:hover { text-decoration: underline; }
.top-links .sell { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- barra de categorias ---------- */
.cats { background: #fff; border-bottom: 1px solid var(--line); }
.cats-in { max-width: 1200px; margin: 0 auto; padding: 0 16px; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.cats-in::-webkit-scrollbar { display: none; }
.cats a { padding: 11px 12px; color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap; border-bottom: 2px solid transparent; }
.cats a:hover { color: var(--brand-strong); }
.cats a.on { color: var(--brand-strong); border-bottom-color: var(--brand); }

/* ---------- página ---------- */
.wrap { max-width: 1200px; margin: 0 auto; padding: 16px; min-height: 60vh; }
.sec { margin: 22px 0; }
.sec > h2 { font-size: 20px; margin: 0 0 12px; }
.head-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 14px; }
.head-row h1 { font-size: 22px; margin: 0; }
.head-row q { color: var(--brand-strong); }
.sort { font-size: 14px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.sort select { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.soon { display: flex; align-items: center; gap: 10px; padding: 11px 14px; margin: 14px 0; border-radius: var(--radius); background: var(--brand-soft); color: #7c2d12; font-size: 14px; }
.soon .ic svg { color: var(--brand); }
.empty { display: grid; justify-items: center; gap: 8px; text-align: center; background: #fff; border-radius: var(--radius); padding: 48px 16px; box-shadow: var(--shadow); margin: 16px 0; }
.empty .ic svg { width: 40px; height: 40px; color: var(--faint); }
.empty strong { font-size: 18px; }
.empty p { margin: 0 0 8px; color: var(--muted); max-width: 440px; }

/* ---------- vitrine ---------- */
.hero {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 28px 28px; border-radius: 14px;
  background: linear-gradient(120deg, var(--brand-strong), var(--brand) 55%, #fb923c); color: #fff; overflow: hidden;
}
.hero h1 { margin: 0 0 6px; font-size: 28px; line-height: 1.15; max-width: 560px; }
.hero p { margin: 0 0 16px; opacity: .95; }
.hero-art { flex: none; width: 140px; height: 140px; border-radius: 50%; background: rgba(255, 255, 255, .16); display: grid; place-items: center; }
.hero-art svg { width: 76px; height: 76px; }
.cat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.cat-tile { display: grid; justify-items: center; gap: 8px; padding: 14px 8px; background: #fff; border-radius: var(--radius); text-align: center; font-size: 13px; font-weight: 600; box-shadow: var(--shadow); }
.cat-tile:hover { color: var(--brand-strong); }
.cat-ico { width: 46px; height: 46px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 900; font-size: 20px; }
.stores { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.scard { flex: 0 0 150px; display: grid; justify-items: center; gap: 6px; padding: 16px 10px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); text-align: center; }
.scard-logo { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 24px; overflow: hidden; }
.scard-logo img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.scard-name { font-weight: 700; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.scard-sub { font-size: 12px; color: var(--muted); }

/* ---------- cartão de produto ---------- */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.pcard { display: flex; flex-direction: column; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .12s ease, box-shadow .12s ease; }
.pcard:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0, 0, 0, .1); }
.pcard-img { position: relative; aspect-ratio: 1; background: #fafafa; display: grid; place-items: center; }
.pcard-img img { width: 100%; height: 100%; object-fit: contain; }
.noimg { color: var(--faint); }
.noimg svg { width: 42px; height: 42px; }
.off { position: absolute; top: 8px; left: 8px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 800; padding: 2px 7px; border-radius: 6px; }
.sold { position: absolute; inset: auto 0 0 0; background: rgba(0, 0, 0, .65); color: #fff; text-align: center; font-size: 13px; font-weight: 700; padding: 4px; }
.pcard.out .pcard-img img { opacity: .55; }
.pcard-body { display: grid; gap: 2px; padding: 10px 12px 12px; }
.pcard-title { font-size: 14px; line-height: 1.3; min-height: 2.6em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard-old { font-size: 12px; color: var(--faint); margin-top: 4px; }
.pcard-price { font-size: 20px; font-weight: 600; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.pcard-price em { font-style: normal; font-size: 13px; color: var(--ok); font-weight: 700; }
.pcard-ship { font-size: 13px; font-weight: 700; }
.pcard-ship.free { color: var(--ok); }
.pcard-store { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

/* ---------- loja ---------- */
.store-head { --store: var(--brand); background: #fff; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.store-cover { aspect-ratio: 4 / 1; max-height: 300px; width: 100%; background: linear-gradient(120deg, var(--store), #f59e0b); }
.store-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.store-info { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; padding: 0 20px 18px; }
.store-logo {
  width: 112px; height: 112px; margin-top: -48px; border-radius: 50%; border: 5px solid #fff; background: var(--store); color: #fff;
  display: grid; place-items: center; font-size: 40px; font-weight: 900; overflow: hidden; flex: none; box-shadow: 0 2px 10px rgba(0, 0, 0, .15);
}
.store-logo img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.store-txt { flex: 1; min-width: 220px; padding-top: 10px; }
.store-txt h1 { margin: 0; font-size: 26px; }
.store-line { margin: 2px 0 0; color: var(--muted); }
.store-meta { display: flex; flex-wrap: wrap; gap: 14px; margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.store-meta .ic { margin-right: 4px; vertical-align: -3px; }
.store-meta .ic svg { width: 15px; height: 15px; }
.store-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.store-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 6px 0 14px; }
.store-search { display: flex; flex: 1 1 260px; background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.store-search input { flex: 1; min-width: 0; border: 0; padding: 9px 12px; outline: none; }
.store-search button { border: 0; background: transparent; color: var(--brand); padding: 0 12px; cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 6px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.store-about { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin: 22px 0; }
.store-about > div { background: #fff; border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.store-about h3 { margin: 0 0 8px; font-size: 16px; display: flex; align-items: center; gap: 6px; }

/* ---------- produto ---------- */
.crumbs { font-size: 13px; color: var(--muted); margin: 2px 0 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs a { color: var(--brand-strong); }
.pdp { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, 1fr); gap: 20px; background: #fff; border-radius: 14px; padding: 20px; box-shadow: var(--shadow); }
.gal { display: flex; gap: 10px; min-width: 0; }
.gal-thumbs { display: flex; flex-direction: column; gap: 8px; }
.gal-thumb { width: 58px; height: 58px; padding: 0; border: 2px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden; cursor: pointer; }
.gal-thumb.on { border-color: var(--brand); }
.gal-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gal-main { position: relative; flex: 1; aspect-ratio: 1; border-radius: 10px; background: #fafafa; display: grid; place-items: center; overflow: hidden; min-width: 0; }
.gal-main img { width: 100%; height: 100%; object-fit: contain; }
.gal-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .92); box-shadow: 0 1px 6px rgba(0, 0, 0, .2); cursor: pointer; display: grid; place-items: center; }
.gal-nav.prev { left: 10px; }
.gal-nav.next { right: 10px; }
.gal-count { position: absolute; right: 10px; bottom: 10px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 999px; }
.buy { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.buy-meta { margin: 0; font-size: 13px; color: var(--muted); }
.buy-title { margin: 0; font-size: 22px; line-height: 1.25; overflow-wrap: anywhere; }
.buy-price s { display: block; color: var(--faint); font-size: 15px; }
.buy-price strong { font-size: 34px; font-weight: 500; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.buy-price em { font-style: normal; font-size: 17px; color: var(--ok); font-weight: 700; }
.ship { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: var(--radius); background: #fafafa; }
.ship .ic svg { width: 22px; height: 22px; color: var(--ok); }
.ship div { display: grid; }
.ship strong.free { color: var(--ok); }
.ship span { font-size: 13px; color: var(--muted); }
.stock { margin: 0; font-weight: 700; }
.stock.out { color: #c0392b; }
.safe { display: flex; gap: 8px; margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.safe .ic svg { color: var(--ok); }
.buy-share { display: flex; justify-content: flex-end; }
.seller { display: flex; align-items: center; gap: 14px; margin: 14px 0; padding: 14px 18px; background: #fff; border-radius: 14px; box-shadow: var(--shadow); }
.seller-logo { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 22px; overflow: hidden; flex: none; }
.seller-logo img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.seller-txt { flex: 1; display: grid; min-width: 0; }
.seller-txt small { color: var(--muted); }
.seller-txt span { font-size: 13px; color: var(--muted); }
.pdp-info { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 0 20px; }
.pdp-info .sec { background: #fff; border-radius: 14px; padding: 18px 20px; box-shadow: var(--shadow); margin: 8px 0; }
.pdp-info .sec:first-child { grid-row: span 2; }
.specs { width: 100%; border-collapse: collapse; font-size: 14px; }
.specs th, .specs td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
.specs th { width: 45%; color: var(--muted); font-weight: 600; background: #fafafa; }

/* "Compre junto" */
.bt { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; background: #fff; border-radius: 14px; padding: 18px; box-shadow: var(--shadow); }
.bt-items { flex: 1 1 520px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.bt-item { display: flex; align-items: center; gap: 10px; flex: 1 1 200px; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.bt-img { width: 64px; height: 64px; flex: none; border-radius: 8px; overflow: hidden; background: #fafafa; display: grid; place-items: center; color: var(--faint); }
.bt-img img { width: 100%; height: 100%; object-fit: cover; }
.bt-txt { display: grid; min-width: 0; }
.bt-title { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
a.bt-title:hover { color: var(--brand-strong); }
.bt-price { font-weight: 700; }
.bt-price s { color: var(--faint); font-weight: 400; font-size: 12px; }
.bt-price em { font-style: normal; color: var(--ok); font-size: 12px; }
.bt-plus { color: var(--faint); }
.bt-total { flex: 0 1 240px; display: grid; gap: 4px; justify-items: start; }
.bt-total span { color: var(--muted); font-size: 13px; }
.bt-total s { color: var(--faint); }
.bt-total strong { font-size: 24px; }

/* ---------- rodapé ---------- */
.foot { background: #fff; border-top: 1px solid var(--line); margin-top: 30px; }
.foot-in { max-width: 1200px; margin: 0 auto; padding: 24px 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; }
.foot-in div { display: grid; gap: 6px; align-content: start; font-size: 14px; }
.foot-in p { margin: 0; color: var(--muted); }
.foot-in a { color: var(--muted); }
.foot-in a:hover { color: var(--brand-strong); }
.foot-note { text-align: center; color: var(--faint); font-size: 12px; margin: 0; padding: 0 16px 20px; }

.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 50; }
.toast { background: #222; color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 14px; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }

/* ---------- celular ---------- */
@media (max-width: 860px) {
  .top-in { flex-wrap: wrap; gap: 10px 12px; padding: 10px 12px; }
  .logo { font-size: 19px; }
  .logo-mark { width: 32px; height: 32px; }
  .search { order: 3; flex-basis: 100%; }
  .top-links { margin-left: auto; gap: 12px; font-size: 14px; }
  .top-links .sell span { display: none; }
  .wrap { padding: 12px; }
  .hero { padding: 20px; }
  .hero h1 { font-size: 22px; }
  .hero-art { display: none; }
  .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pcard-price { font-size: 17px; }
  .pdp { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .gal { flex-direction: column-reverse; }
  .gal-thumbs { flex-direction: row; overflow-x: auto; }
  .pdp-info { grid-template-columns: minmax(0, 1fr); }
  .pdp-info .sec:first-child { grid-row: auto; }
  .store-info { padding: 0 14px 14px; }
  .store-logo { width: 88px; height: 88px; margin-top: -36px; font-size: 32px; }
  .store-txt h1 { font-size: 21px; }
  .buy-price strong { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) { .pcard { transition: none; } }
