/* ============================================================================
   Loja Demo · sistema de design
   Aplicação do brandbook The Agentic Company: neutros quentes invariantes,
   ritmo tipográfico mono-uppercase, um símbolo, dark/light por toggle.
   O acento (--brand) é o do tenant — aqui, o violeta Pushnews.
   ========================================================================== */

:root {
  /* neutros quentes — invariantes da marca */
  --bg:            #FAF7F0;
  --bg-grad:       radial-gradient(1200px 600px at 85% -10%, rgba(91,75,225,.10), transparent 60%);
  --surface:       #FFFFFF;
  --surface-2:     #F4F0E6;
  --surface-3:     #EBE5D7;
  --fg:            #1B1915;
  --fg-2:          #3A362E;
  --fg-muted:      #6E6759;
  --border:        #E4DDCD;
  --border-strong: #D3CAB5;

  /* acento do tenant + sinais */
  --brand:         #5B4BE1;
  --brand-strong:  #4133C2;
  --brand-fg:      #FFFFFF;
  --brand-soft:    rgba(91, 75, 225, .10);
  --brand-line:    rgba(91, 75, 225, .28);
  --signal:        #1B8055;
  --signal-soft:   rgba(27, 128, 85, .12);
  --warn:          #9C5B06;
  --warn-soft:     rgba(156, 91, 6, .12);
  --danger:        #A82A22;
  --danger-soft:   rgba(168, 42, 34, .12);

  --radius:    14px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --shadow:    0 1px 2px rgba(27,25,21,.05), 0 10px 30px -12px rgba(27,25,21,.16);
  --shadow-lg: 0 2px 4px rgba(27,25,21,.06), 0 26px 60px -22px rgba(27,25,21,.28);

  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --header-h: 60px;
  --maxw: 1140px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

html.dark {
  --bg:            #14120E;
  --bg-grad:       radial-gradient(1200px 600px at 85% -10%, rgba(154,140,255,.14), transparent 60%);
  --surface:       #1C1914;
  --surface-2:     #232019;
  --surface-3:     #2C281F;
  --fg:            #F2ECE0;
  --fg-2:          #DCD4C5;
  --fg-muted:      #A99F8C;
  --border:        rgba(255,255,255,.10);
  --border-strong: rgba(255,255,255,.18);

  --brand:         #9C8DFF;
  --brand-strong:  #B7ACFF;
  --brand-fg:      #17142A;
  --brand-soft:    rgba(156,141,255,.14);
  --brand-line:    rgba(156,141,255,.34);
  --signal:        #6FD3A2;
  --signal-soft:   rgba(111,211,162,.14);
  --warn:          #E7A24A;
  --warn-soft:     rgba(231,162,74,.14);
  --danger:        #F08A80;
  --danger-soft:   rgba(240,138,128,.14);

  --shadow:    0 1px 2px rgba(0,0,0,.5), 0 10px 30px -12px rgba(0,0,0,.6);
  --shadow-lg: 0 2px 6px rgba(0,0,0,.5), 0 30px 70px -24px rgba(0,0,0,.75);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--sans);
  background: var(--bg);
  background-image: var(--bg-grad);
  background-repeat: no-repeat;
  color: var(--fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}
@media (min-width: 861px) { body { padding-bottom: 0; } }

img { max-width: 100%; display: block; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 6px;
}

::selection { background: var(--brand-soft); }

/* ---------- tipografia ---------- */
h1, h2, h3, h4 { margin: 0 0 .45em; line-height: 1.15; letter-spacing: -.022em; font-weight: 640; }
h1 { font-size: clamp(30px, 5.2vw, 46px); }
h2 { font-size: clamp(21px, 3vw, 28px); }
h3 { font-size: 17px; letter-spacing: -.012em; }
p  { margin: 0 0 1em; }
.lead { font-size: clamp(16px, 2.1vw, 19px); color: var(--fg-2); max-width: 62ch; }
.small { font-size: 13px; }
.muted { color: var(--fg-muted); }

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--brand);
  font-weight: 600;
  margin: 0 0 .8em;
}
.eyebrow.neutral { color: var(--fg-muted); }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- símbolo ---------- */
.mark { width: 30px; height: 30px; flex: 0 0 auto; }

/* ---------- cabeçalho ---------- */
.header {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top);
}
.header-in {
  height: var(--header-h);
  display: flex; align-items: center; gap: 14px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.1; }
.brand-txt b { font-size: 15px; letter-spacing: -.01em; }
.brand-txt span {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--fg-muted);
}

.nav { display: none; margin-left: 10px; gap: 2px; }
@media (min-width: 861px) { .nav { display: flex; } }
.nav a {
  font-size: 14px; font-weight: 520; color: var(--fg-muted);
  padding: 7px 12px; border-radius: 999px; text-decoration: none;
  transition: color .18s var(--ease), background .18s var(--ease);
}
.nav a:hover { color: var(--fg); background: var(--surface-2); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--brand); background: var(--brand-soft); }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.iconbtn {
  position: relative; display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 11px;
  background: transparent; color: var(--fg-2);
  border: 1px solid transparent; cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.iconbtn:hover { background: var(--surface-2); color: var(--fg); border-color: var(--border); }
.iconbtn:active { transform: scale(.94); }

.badge {
  position: absolute; top: 2px; right: 2px;
  min-width: 17px; height: 17px; padding: 0 4px;
  background: var(--brand); color: var(--brand-fg);
  font-size: 10.5px; font-weight: 700; font-variant-numeric: tabular-nums;
  border-radius: 9px; display: grid; place-items: center;
  border: 2px solid var(--bg);
  animation: pop .28s var(--ease);
}
@keyframes pop { from { transform: scale(.4); } to { transform: scale(1); } }

/* seletor de idioma */
.lang { position: relative; }
.lang-btn {
  display: flex; align-items: center; gap: 5px; height: 38px; padding: 0 10px;
  border-radius: 11px; border: 1px solid transparent; background: transparent;
  color: var(--fg-2); cursor: pointer;
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  transition: background .18s var(--ease), border-color .18s var(--ease);
}
.lang-btn:hover { background: var(--surface-2); border-color: var(--border); color: var(--fg); }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 70;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 6px; min-width: 190px;
  animation: drop .18s var(--ease);
}
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.lang-menu button {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; padding: 9px 10px; border: 0; background: transparent; cursor: pointer;
  border-radius: var(--radius-sm); color: var(--fg); font-size: 14px; text-align: left;
  font-family: var(--sans);
}
.lang-menu button:hover { background: var(--surface-2); }
.lang-menu button[aria-checked="true"] { color: var(--brand); font-weight: 600; }
.lang-menu small { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; color: var(--fg-muted); text-transform: uppercase; }

/* ---------- barra de estado ao vivo ---------- */
.statusbar { border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.statusbar-in { display: flex; gap: 7px; padding: 9px 0; overflow-x: auto; scrollbar-width: none; }
.statusbar-in::-webkit-scrollbar { display: none; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--fg-muted);
  transition: color .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease);
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.pill.ok   { color: var(--signal); border-color: color-mix(in srgb, var(--signal) 40%, transparent); background: var(--signal-soft); }
.pill.warn { color: var(--warn);   border-color: color-mix(in srgb, var(--warn) 40%, transparent);   background: var(--warn-soft); }
.pill.bad  { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: var(--danger-soft); }
.pill.ok .dot { animation: breathe 2.6s ease-in-out infinite; }
@keyframes breathe { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--sans); font-size: 14.5px; font-weight: 600; letter-spacing: -.005em;
  padding: 11px 18px; border-radius: 12px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .14s var(--ease), background .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease), opacity .18s var(--ease);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--brand); color: var(--brand-fg); box-shadow: 0 6px 18px -8px var(--brand); }
.btn-primary:hover:not(:disabled) { background: var(--brand-strong); }
.btn-ghost { background: var(--surface); color: var(--fg); border-color: var(--border-strong); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); border-color: var(--fg-muted); }
.btn-quiet { background: transparent; color: var(--fg-muted); }
.btn-quiet:hover:not(:disabled) { background: var(--surface-2); color: var(--fg); }
.btn-sm { padding: 8px 13px; font-size: 13px; border-radius: 10px; }
.btn-full { width: 100%; }

/* ---------- secções ---------- */
main { padding: 26px 0 60px; }
.section { margin: 44px 0 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 4.4vw, 46px);
  box-shadow: var(--shadow);
}
.hero::after {
  content: ""; position: absolute; inset: auto -80px -140px auto;
  width: 340px; height: 340px; border-radius: 50%;
  background: radial-gradient(circle, var(--brand-soft), transparent 68%);
  pointer-events: none;
}
.hero > * { position: relative; }
.hero h1 { max-width: 16ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--border); }
.fact { display: flex; flex-direction: column; gap: 2px; }
.fact b { font-size: 19px; letter-spacing: -.02em; }
.fact span { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-muted); }

/* ---------- filtros ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search {
  display: flex; align-items: center; gap: 8px; flex: 1 1 220px; min-width: 0;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 12px; padding: 0 12px; height: 42px;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.search input {
  flex: 1; min-width: 0; border: 0; background: transparent; outline: none;
  font-family: var(--sans); font-size: 14.5px; color: var(--fg);
}
.search svg { color: var(--fg-muted); flex: 0 0 auto; }

.chips { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  font-size: 13px; font-weight: 550; white-space: nowrap;
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
  background: var(--surface); color: var(--fg-muted);
  border: 1px solid var(--border-strong);
  transition: all .18s var(--ease);
}
.chip:hover { color: var(--fg); border-color: var(--fg-muted); }
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-fg); }

select.select {
  height: 42px; padding: 0 34px 0 12px; border-radius: 12px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236E6759' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 16px;
  border: 1px solid var(--border-strong); color: var(--fg);
  font-family: var(--sans); font-size: 14px; cursor: pointer; appearance: none;
}
html.dark select.select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A99F8C' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }

/* ---------- grelha de produtos ---------- */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
@media (max-width: 560px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } }

.card-prod {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease);
  animation: rise .4s var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.card-prod:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.card-prod .thumb { position: relative; display: block; aspect-ratio: 1/1; background: var(--surface-2); overflow: hidden; }
.card-prod .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.card-prod:hover .thumb img { transform: scale(1.045); }
.card-prod .body { display: flex; flex-direction: column; gap: 3px; padding: 14px; flex: 1; }
.card-prod .cat { font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--fg-muted); }
.card-prod h3 { margin: 0; font-size: 15px; }
.card-prod h3 a { color: var(--fg); }
.card-prod h3 a:hover { color: var(--brand); text-decoration: none; }
.card-prod .price { font-size: 17px; font-weight: 660; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.card-prod .card-foot { margin-top: auto; padding-top: 14px; }
.tag {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px; background: var(--fg); color: var(--bg); font-weight: 600;
}
.tag.brand { background: var(--brand); color: var(--brand-fg); }

.empty-state { text-align: center; padding: 50px 20px; color: var(--fg-muted); border: 1px dashed var(--border-strong); border-radius: var(--radius); }

/* ---------- página de produto ---------- */
.pdp { display: grid; gap: 30px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 861px) { .pdp { grid-template-columns: minmax(0,1fr) minmax(0,.86fr); gap: 46px; } }
.pdp-media { max-width: 560px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.pdp-media img { width: 100%; aspect-ratio: 1/1; object-fit: cover; }
.pdp h1 { font-size: clamp(24px, 4vw, 34px); }
.pdp .price-lg { font-size: 27px; font-weight: 680; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.specs { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 14px; }
.specs td { padding: 10px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.specs td:first-child { color: var(--fg-muted); width: 42%; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 12px; overflow: hidden; background: var(--surface); }
.qty button { width: 40px; height: 42px; border: 0; background: transparent; color: var(--fg); font-size: 18px; cursor: pointer; }
.qty button:hover { background: var(--surface-2); }
.qty span { min-width: 38px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.breadcrumb { font-size: 13px; color: var(--fg-muted); margin-bottom: 16px; display: flex; gap: 8px; align-items: center; }
.breadcrumb a { color: var(--fg-muted); }
.breadcrumb a:hover { color: var(--brand); }

/* ---------- cartões de conteúdo ---------- */
.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.card:hover { border-color: var(--border-strong); }
.card h3 { margin-bottom: .5em; }
.card p:last-child { margin-bottom: 0; }
.card-num {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  background: var(--brand-soft); color: var(--brand); border: 1px solid var(--brand-line);
  font-family: var(--mono); font-size: 13px; font-weight: 700; margin-bottom: 14px;
}
.card-file { font-family: var(--mono); font-size: 11.5px; letter-spacing: .04em; color: var(--fg-muted); margin-top: 14px; }
.card-icon { color: var(--brand); margin-bottom: 12px; }

.prose { max-width: 68ch; }
.prose h2 { margin-top: 1.6em; }
.callout {
  border-left: 3px solid var(--brand); background: var(--brand-soft);
  padding: 14px 18px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 22px 0;
  font-size: 14.5px; color: var(--fg-2);
}
.callout.neutral { border-left-color: var(--border-strong); background: var(--surface-2); }
ul.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
ul.plain li { padding-left: 26px; position: relative; color: var(--fg-2); }
ul.plain li::before {
  content: ""; position: absolute; left: 4px; top: 10px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--brand);
}

/* ---------- laboratório ---------- */
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; counter-reset: s; }
.step {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
  transition: border-color .25s var(--ease);
}
.step[data-done="true"] { border-color: color-mix(in srgb, var(--signal) 46%, transparent); }
.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.step-n {
  counter-increment: s; display: grid; place-items: center; width: 28px; height: 28px;
  border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border-strong);
  font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--fg-muted); flex: 0 0 auto;
}
.step[data-done="true"] .step-n { background: var(--signal-soft); border-color: color-mix(in srgb, var(--signal) 46%, transparent); color: var(--signal); }
.step h3 { margin: 0; flex: 1; min-width: 140px; }
.step-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; align-items: center; }

details.tip { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
details.tip summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--brand); list-style: none; }
details.tip summary::-webkit-details-marker { display: none; }
details.tip summary::before { content: "＋ "; font-family: var(--mono); }
details.tip[open] summary::before { content: "－ "; }
details.tip p { margin: 12px 0 0; font-size: 14px; color: var(--fg-2); }

pre.out {
  font-family: var(--mono); font-size: 11.5px; line-height: 1.6; color: var(--fg-2);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px; margin: 14px 0 0;
  overflow-x: auto; white-space: pre; max-height: 260px;
}

.diag { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.diag td { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.diag tr:last-child td { border-bottom: 0; }
.diag td:first-child { color: var(--fg-muted); }
.diag td:last-child { text-align: right; font-family: var(--mono); font-size: 12px; }
.diag .yes { color: var(--signal); }
.diag .no  { color: var(--danger); }
.diag .meh { color: var(--warn); }

/* ---------- gaveta do carrinho ---------- */
.scrim {
  position: fixed; inset: 0; z-index: 90; background: rgba(18,16,12,.5);
  backdrop-filter: blur(3px); animation: fade .22s var(--ease);
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.drawer {
  position: fixed; z-index: 100; top: 0; right: 0; bottom: 0; width: min(420px, 100%);
  background: var(--surface); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
  animation: slide .3s var(--ease);
  padding-top: env(safe-area-inset-top);
}
@keyframes slide { from { transform: translateX(100%); } to { transform: none; } }
.drawer-top { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.drawer-top h2 { margin: 0; font-size: 18px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 18px; }
.drawer-foot { border-top: 1px solid var(--border); padding: 16px 18px calc(16px + env(safe-area-inset-bottom)); background: var(--surface-2); }
.line { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; font-size: 14px; color: var(--fg-muted); }
.line.total { font-size: 17px; color: var(--fg); font-weight: 660; margin-bottom: 14px; }
.line.total b { font-variant-numeric: tabular-nums; }

.citem { display: grid; grid-template-columns: 62px 1fr auto; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); }
.citem:last-child { border-bottom: 0; }
.citem img { width: 62px; height: 62px; border-radius: 10px; object-fit: cover; background: var(--surface-2); }
.citem b { font-size: 14px; font-weight: 600; display: block; }
.citem .u { font-size: 12.5px; color: var(--fg-muted); font-variant-numeric: tabular-nums; }
.citem .qty { transform: scale(.86); transform-origin: right center; }
.citem .qty button { width: 32px; height: 34px; }
.rm { background: none; border: 0; color: var(--fg-muted); font-size: 12px; cursor: pointer; padding: 4px 0; text-decoration: underline; }
.rm:hover { color: var(--danger); }

/* ---------- toast ---------- */
.toast-wrap {
  position: fixed; z-index: 120; left: 50%; transform: translateX(-50%);
  bottom: calc(84px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  width: max-content; max-width: calc(100vw - 32px); pointer-events: none;
}
@media (min-width: 861px) { .toast-wrap { bottom: 26px; } }
.toast {
  background: var(--fg); color: var(--bg); font-size: 14px; font-weight: 550;
  padding: 11px 18px; border-radius: 999px; box-shadow: var(--shadow-lg);
  animation: toastin .28s var(--ease); text-align: center;
}
@keyframes toastin { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }
.toast.out { animation: toastout .26s var(--ease) forwards; }
@keyframes toastout { to { opacity: 0; transform: translateY(8px) scale(.97); } }

/* ---------- barra inferior (mobile, sensação de app) ---------- */
.tabbar {
  position: fixed; z-index: 80; left: 0; right: 0; bottom: 0;
  display: flex; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 861px) { .tabbar { display: none; } }
.tabbar a, .tabbar button {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 0 8px; background: none; border: 0; cursor: pointer;
  color: var(--fg-muted); text-decoration: none; font-size: 10.5px; font-weight: 550;
  position: relative;
}
.tabbar a[aria-current="page"] { color: var(--brand); }
.tabbar .badge { top: 2px; right: 22%; border-color: var(--bg); }

/* ---------- rodapé ---------- */
.foot { border-top: 1px solid var(--border); padding: 30px 0 40px; margin-top: 60px; color: var(--fg-muted); font-size: 13.5px; }
.foot-in { display: flex; gap: 18px; justify-content: space-between; flex-wrap: wrap; align-items: center; }
.foot a { color: var(--fg-muted); text-decoration: underline; }
.foot a:hover { color: var(--brand); }

/* ---------- aviso offline ---------- */
.offline-bar {
  background: var(--warn-soft); color: var(--warn); border-bottom: 1px solid color-mix(in srgb, var(--warn) 36%, transparent);
  font-size: 13px; font-weight: 550; text-align: center; padding: 8px 16px;
}

/* ---------- confirmação de encomenda ---------- */
.order-card { max-width: 560px; margin: 0 auto; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: clamp(26px, 5vw, 46px); box-shadow: var(--shadow); }
.order-check { width: 62px; height: 62px; margin: 0 auto 20px; border-radius: 50%; display: grid; place-items: center; background: var(--signal-soft); color: var(--signal); border: 1px solid color-mix(in srgb, var(--signal) 40%, transparent); }
.order-ref { font-family: var(--mono); font-size: 13px; letter-spacing: .1em; color: var(--fg-muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- ícones do toggle de tema ---------- */
html:not(.dark) .icon-moon { display: none; }
html.dark .icon-sun { display: none; }

/* ---------- ajustes de telemóvel ---------- */
@media (max-width: 560px) {
  .hero { padding: 22px 20px 24px; }
  .hero h1 { font-size: clamp(26px, 8vw, 34px); }
  .hero-facts { gap: 6px 18px; margin-top: 18px; padding-top: 16px; }
  .fact b { font-size: 16px; }
  .fact span { font-size: 9px; letter-spacing: .1em; }
  .tabbar a, .tabbar button { font-size: 10px; }
}

/* ---------- guia de instalação (quando não há prompt nativo) ---------- */
.guide-scrim {
  position: fixed; inset: 0; z-index: 130; display: grid; place-items: end center;
  background: rgba(18,16,12,.55); backdrop-filter: blur(3px); animation: fade .2s var(--ease);
  padding: 16px;
}
@media (min-width: 700px) { .guide-scrim { place-items: center; } }
.guide {
  width: min(520px, 100%); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 22px 22px calc(22px + env(safe-area-inset-bottom));
  animation: guidein .26s var(--ease);
}
@keyframes guidein { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.guide-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.guide-top h2 { margin: 0; font-size: 19px; }
.guide-steps { margin: 14px 0 0; padding: 0 0 0 20px; display: grid; gap: 12px; }
.guide-steps li { color: var(--fg-2); font-size: 15px; padding-left: 4px; }
.guide-steps li::marker { color: var(--brand); font-weight: 700; font-variant-numeric: tabular-nums; }
.guide p { margin: 16px 0 0; }

/* Em ecrãs estreitos o rótulo não cabe ao lado da marca e dos outros controlos —
   mas o caminho de instalação não pode desaparecer do cabeçalho no telemóvel,
   que é onde as demonstrações se fazem. Fica em ícone, com nome acessível. */
@media (max-width: 620px) {
  .header-actions .install-btn {
    width: 38px; height: 38px; padding: 0; font-size: 0; border-radius: 11px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.5v11'/%3E%3Cpath d='M7.5 10.5L12 15l4.5-4.5'/%3E%3Cpath d='M4.5 18.5h15'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: center; background-size: 20px;
  }
}
