/* As variáveis abaixo são sobrescritas pela "Aparência" configurada no painel (app.js > applyTheme) */
:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #1c1c1e;
  --muted: #6b6b72;
  --line: color-mix(in srgb, var(--text) 10%, transparent);
  --brand: #ff5a1f;
  --brand-text: #ffffff;
  --brand-dark: color-mix(in srgb, var(--brand) 85%, #000);
  --brand-soft: color-mix(in srgb, var(--brand) 10%, var(--surface));
  --header-bg: #ffffff;
  --header-text: #1c1c1e;
  --nav-bg: #ffffff;
  --nav-text: #1c1c1e;
  --announce-bg: #1c1c1e;
  --announce-text: #ffffff;
  --footer-bg: #ffffff;
  --footer-text: #6b6b72;
  --hero-from: #ffe7dc;
  --hero-to: #fffaf2;
  --hero-text: #1c1c1e;
  --ok: #1f9d55;
  --danger: #d64545;
  --radius: 14px;
  --btn-radius: 999px;
  --cols: 4;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.5; font-family: var(--font); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.hidden { display: none !important; }

/* Barra de anúncio */
.announce { background: var(--announce-bg); color: var(--announce-text); text-align: center; font-size: 13px; padding: 7px 16px; display: block; }

/* Cabeçalho */
header.site { background: var(--header-bg); color: var(--header-text); border-bottom: 1px solid var(--line); z-index: 20; }
header.site.sticky { position: sticky; top: 0; }
header.site .row { display: flex; align-items: center; gap: 16px; height: 68px; }
.logo { font-weight: 800; font-size: 22px; letter-spacing: -.5px; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.logo span { color: var(--brand); }
.logo img { max-height: 44px; width: auto; }
.search { flex: 1; display: flex; max-width: 520px; margin: 0 auto; }
.search input { flex: 1; border: 1px solid var(--line); border-right: 0; border-radius: var(--btn-radius) 0 0 var(--btn-radius); padding: 10px 16px; background: var(--bg); color: var(--text); min-width: 0; }
.search button { border: 0; background: var(--brand); color: var(--brand-text); padding: 0 18px; border-radius: 0 var(--btn-radius) var(--btn-radius) 0; cursor: pointer; }
.head-actions { display: flex; align-items: center; gap: 18px; }
.head-link { display: flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; }
.cart-count { background: var(--brand); color: var(--brand-text); border-radius: 999px; font-size: 12px; min-width: 20px; height: 20px; display: inline-grid; place-items: center; padding: 0 6px; }
.nav-toggle { display: none; background: none; border: 0; font-size: 22px; cursor: pointer; color: inherit; padding: 4px; }

/* Layout "logo centralizado" */
header.site.logo-center .row { display: grid; grid-template-columns: 1fr auto 1fr; }
header.site.logo-center .search { margin: 0; max-width: 340px; }
header.site.logo-center .logo { justify-content: center; }
header.site.logo-center .head-actions { justify-self: end; }

/* Menu de navegação */
nav.menu { background: var(--nav-bg); color: var(--nav-text); border-bottom: 1px solid var(--line); }
nav.menu > .container > ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; flex-wrap: wrap; }
nav.menu.align-center > .container > ul { justify-content: center; }
nav.menu.align-right > .container > ul { justify-content: flex-end; }
nav.menu li { position: relative; }
nav.menu li > a, nav.menu li > button { display: flex; align-items: center; gap: 4px; padding: 12px 14px; font-weight: 600; font-size: 14px; background: none; border: 0; color: inherit; cursor: pointer; }
nav.menu li > a:hover, nav.menu li > button:hover { color: var(--brand); }
nav.menu .sub { display: none; position: absolute; top: 100%; left: 0; min-width: 220px; background: var(--surface); color: var(--text); border-radius: 12px; box-shadow: var(--shadow); padding: 8px; list-style: none; margin: 0; z-index: 30; }
nav.menu li:hover > .sub, nav.menu li.open > .sub { display: block; }
nav.menu .sub a { display: block; padding: 8px 12px; border-radius: 8px; font-size: 14px; }
nav.menu .sub a:hover { background: var(--brand-soft); color: var(--brand); }

/* Botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: var(--btn-radius); padding: 13px 26px; font-weight: 700; cursor: pointer; transition: .15s; }
.btn-primary { background: var(--brand); color: var(--brand-text); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-outline { background: transparent; border-color: currentColor; }
.btn-dark { background: var(--text); color: var(--bg); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* Banner */
.hero { background: linear-gradient(120deg, var(--hero-from), var(--hero-to)); color: var(--hero-text); border-radius: calc(var(--radius) + 8px); padding: 48px 40px; margin: 24px 0; display: grid; gap: 10px; background-size: cover; background-position: center; position: relative; overflow: hidden; }
.hero.has-image::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, color-mix(in srgb, var(--hero-from) 85%, transparent), transparent); }
.hero > * { position: relative; }
.hero h1 { font-size: clamp(28px, 4vw, 44px); line-height: 1.1; margin: 0; letter-spacing: -1px; max-width: 640px; }
.hero p { opacity: .8; margin: 0 0 8px; max-width: 520px; }
.hero .buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.hero.align-center { text-align: center; justify-items: center; }
.hero.align-center .buttons { justify-content: center; }
.hero.align-right { text-align: right; justify-items: end; }
.hero.align-right .buttons { justify-content: flex-end; }

.perks { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 0 0 28px; }
.perk { background: var(--surface); border-radius: var(--radius); padding: 14px 16px; display: flex; gap: 12px; align-items: center; font-size: 14px; box-shadow: var(--shadow); }
.perk b { display: block; }
.perk .ic { font-size: 22px; }

/* Catálogo */
.section-title { font-size: 24px; margin: 8px 0 16px; letter-spacing: -.5px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 7px 14px; border-radius: var(--btn-radius); cursor: pointer; font-size: 14px; }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }
select.sort { border: 1px solid var(--line); border-radius: var(--btn-radius); padding: 8px 14px; background: var(--surface); color: var(--text); }
.grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 18px; margin-bottom: 48px; }
.card { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .15s; }
.card:hover { transform: translateY(-3px); }
.card .thumb { aspect-ratio: 1; background: #eee; position: relative; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.badge { position: absolute; top: 10px; left: 10px; background: var(--brand); color: var(--brand-text); font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.badge.out { background: #555; color: #fff; }
.card .info { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card h3 { font-size: 15px; font-weight: 600; margin: 0; line-height: 1.35; }
.price { font-weight: 800; font-size: 20px; }
.price-old { color: var(--muted); text-decoration: line-through; font-size: 14px; margin-left: 6px; font-weight: 400; }
.installments { color: var(--ok); font-size: 13px; }
.empty { text-align: center; color: var(--muted); padding: 60px 0; }

/* Página do produto */
.product { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; margin: 28px 0 56px; }
.gallery .main { background: var(--surface); border-radius: var(--radius); overflow: hidden; aspect-ratio: 1; box-shadow: var(--shadow); }
.gallery .main img { width: 100%; height: 100%; object-fit: cover; }
.thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.thumbs img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; cursor: pointer; border: 2px solid transparent; }
.thumbs img.active { border-color: var(--brand); }
.product h1 { font-size: 30px; line-height: 1.2; margin: 0 0 12px; letter-spacing: -.5px; }
.product .price { font-size: 34px; }
.qty { display: inline-flex; border: 1px solid var(--line); border-radius: var(--btn-radius); overflow: hidden; background: var(--surface); }
.qty button { border: 0; background: none; width: 40px; cursor: pointer; font-size: 18px; color: var(--text); }
.qty input { width: 44px; text-align: center; border: 0; background: none; color: var(--text); }
.buy-row { display: flex; gap: 12px; margin: 22px 0; flex-wrap: wrap; }
.buy-row .btn { flex: 1; min-width: 180px; }
.trust { display: grid; gap: 8px; background: var(--surface); padding: 16px; border-radius: var(--radius); font-size: 14px; color: var(--muted); }
.desc { white-space: pre-line; margin-top: 22px; opacity: .9; }
.crumbs { font-size: 13px; color: var(--muted); margin-top: 20px; }

/* Carrinho / checkout / conta */
.checkout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; margin: 28px 0 56px; align-items: start; }
.panel { background: var(--surface); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.panel h2 { margin: 0 0 16px; font-size: 20px; }
.cart-item { display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-item img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; }
.cart-item .remove { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 13px; padding: 0; text-decoration: underline; }
.form-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.form-grid label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); grid-column: span 6; }
.form-grid .s1 { grid-column: span 1; } .form-grid .s3 { grid-column: span 3; } .form-grid .s2 { grid-column: span 2; } .form-grid .s4 { grid-column: span 4; }
.form-grid input, .field { border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; color: var(--text); background: var(--surface); width: 100%; }
.form-grid input:focus, .field:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.form-grid input.invalid { border-color: var(--danger); }
.form-grid label.check { display: flex; gap: 8px; align-items: center; color: var(--text); font-size: 14px; }
.form-grid label.check input { width: auto; }
.summary-line { display: flex; justify-content: space-between; padding: 6px 0; }
.summary-line.total { font-size: 20px; font-weight: 800; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 14px; }
.pay-option { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); padding: 12px 14px; border-radius: 12px; margin-bottom: 8px; cursor: pointer; }
.pay-option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.msg { padding: 12px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 14px; }
.msg.error { background: #fdecec; color: var(--danger); }
.msg.info { background: #eef6ff; color: #1d4f91; }
.msg.ok { background: #e6f6ec; color: var(--ok); }
.who { display: flex; gap: 10px; align-items: center; justify-content: space-between; background: var(--brand-soft); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; font-size: 14px; flex-wrap: wrap; }
.who a { color: var(--brand); font-weight: 600; }

.auth-wrap { max-width: 460px; margin: 40px auto 60px; }
.tabs { display: flex; gap: 4px; background: var(--bg); padding: 4px; border-radius: var(--btn-radius); margin-bottom: 18px; }
.tabs button { flex: 1; border: 0; background: none; padding: 10px; border-radius: var(--btn-radius); cursor: pointer; font-weight: 600; color: var(--muted); }
.tabs button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.account { display: grid; grid-template-columns: 220px 1fr; gap: 24px; margin: 28px 0 56px; align-items: start; }
.account-nav { display: grid; gap: 4px; }
.account-nav button { text-align: left; border: 0; background: none; padding: 10px 14px; border-radius: 10px; cursor: pointer; font-weight: 600; color: var(--text); }
.account-nav button.on { background: var(--surface); box-shadow: var(--shadow); color: var(--brand); }
.order-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--bg); }

.status-steps { display: flex; justify-content: space-between; margin: 24px 0; position: relative; }
.status-steps .st { text-align: center; flex: 1; font-size: 13px; color: var(--muted); }
.status-steps .dot { width: 28px; height: 28px; border-radius: 50%; background: var(--line); margin: 0 auto 6px; display: grid; place-items: center; color: #fff; font-size: 14px; }
.status-steps .st.done .dot { background: var(--ok); }
.status-steps .st.done { color: var(--text); }

footer.site { border-top: 1px solid var(--line); padding: 28px 0; color: var(--footer-text); font-size: 14px; background: var(--footer-bg); }
footer.site .row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer.site .links { display: flex; flex-direction: column; gap: 4px; }
footer.site a:hover { color: var(--brand); }

.wa-float { position: fixed; bottom: 20px; right: 20px; width: 56px; height: 56px; border-radius: 50%; background: #25d366; color: #fff; display: grid; place-items: center; box-shadow: 0 6px 20px rgba(0,0,0,.2); z-index: 40; font-size: 28px; }
.wa-float.left { right: auto; left: 20px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(120px); background: var(--text); color: var(--bg); padding: 12px 20px; border-radius: 999px; transition: .25s; z-index: 50; font-size: 14px; }
.toast.show { transform: translateX(-50%) translateY(0); }

@media (max-width: 900px) {
  .grid { --cols: 3; }
}
@media (max-width: 820px) {
  .product, .checkout, .account { grid-template-columns: 1fr; gap: 22px; }
  .hero { padding: 32px 22px; }
  header.site .row, header.site.logo-center .row { display: flex; flex-wrap: wrap; height: auto; padding-top: 12px; padding-bottom: 12px; }
  .search, header.site.logo-center .search { order: 3; max-width: none; flex-basis: 100%; }
  .logo { flex: 1; }
  .head-link .lbl { display: none; }
  .nav-toggle { display: block; }
  nav.menu { display: none; }
  nav.menu.open { display: block; }
  nav.menu > .container > ul { flex-direction: column; }
  nav.menu .sub { position: static; box-shadow: none; display: block; background: transparent; color: inherit; padding: 0 0 6px 14px; }
  .grid { --cols: 2; gap: 12px; }
  .form-grid .s1, .form-grid .s3, .form-grid .s2, .form-grid .s4 { grid-column: span 6; }
  .account-nav { grid-template-columns: repeat(3, 1fr); }
}
