:root {
  --bg: #fdf8f6;
  --sidebar: #ffffff;
  --topbar: #ffffffee;
  --surface: #ffffff;
  --surface-hover: #fdece6;
  --surface-raised: #fbe0d5;
  --border: #f0e2da;
  --border-strong: #e0c7ba;
  --text: #1c1512;
  --text-muted: #6b5c54;
  --text-faint: #a3958d;
  --brand: #e5341e;
  --brand-hover: #f04b2e;
  --warning: #c97400;
  --danger-bg: #fbe3e8;
  --danger-text: #9c2440;
  --radius: 8px;
  --font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #050606;
    --sidebar: #0b0c0d;
    --topbar: #0b0c0df5;
    --surface: #111314;
    --surface-hover: #17191a;
    --surface-raised: #1d1f21;
    --border: #2a2d30;
    --border-strong: #3a3e42;
    --text: #f7f7f7;
    --text-muted: #a6a8ab;
    --text-faint: #6f7276;
    --brand: #ff5a38;
    --brand-hover: #ff7952;
    --warning: #ffad42;
    --danger-bg: #3a1420;
    --danger-text: #ff7d95;
  }
}
:root[data-theme="dark"] {
  --bg: #050606;
  --sidebar: #0b0c0d;
  --topbar: #0b0c0df5;
  --surface: #111314;
  --surface-hover: #17191a;
  --surface-raised: #1d1f21;
  --border: #2a2d30;
  --border-strong: #3a3e42;
  --text: #f7f7f7;
  --text-muted: #a6a8ab;
  --text-faint: #6f7276;
  --brand: #ff5a38;
  --brand-hover: #ff7952;
  --warning: #ffad42;
  --danger-bg: #3a1420;
  --danger-text: #ff7d95;
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0; overflow-x: hidden;
  background: var(--bg); color: var(--text);
  font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased;
  transition: background .16s ease, color .16s ease;
}
button, input, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
::selection { background: var(--brand); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border: 3px solid var(--bg); border-radius: 10px; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 30;
  width: 240px; padding: 22px 10px 16px;
  display: flex; flex-direction: column;
  overflow: hidden;
  background: var(--sidebar); border-right: 1px solid var(--border);
}
.sidebar-brand {
  min-height: 56px; padding: 0 10px;
  display: flex; align-items: center; gap: 11px;
}
.brand-logo {
  width: 44px; height: 44px; flex: 0 0 auto; display: block; object-fit: contain;
  border: 0; outline: 0; border-radius: 0; box-shadow: none; background: transparent;
}
.brand-title { height: 26px; width: auto; flex: 0 0 auto; display: block; object-fit: contain; }

/* botão sempre visível pra falar com o Ferinha — destacado com o gradiente
   da marca pra não se confundir com os links de navegação normais */
.sidebar-chat-btn {
  margin-top: 18px; min-height: 46px; padding: 0 14px;
  display: flex; align-items: center; gap: 10px;
  border-radius: 8px; text-decoration: none;
  background: linear-gradient(135deg, var(--brand), var(--brand-hover)); color: #fff;
  font: 800 13px var(--font); letter-spacing: -.01em;
  box-shadow: 0 4px 14px #e5341e33;
  transition: transform .16s ease, box-shadow .16s ease;
}
.sidebar-chat-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px #e5341e44; }
.sidebar-chat-btn.ativo { box-shadow: 0 0 0 3px #e5341e33, 0 6px 18px #e5341e44; }
.sidebar-chat-btn .nav-icon { stroke: #fff; }

.primary-nav { display: grid; gap: 6px; margin-top: 18px; }
.tipo-tab {
  min-height: 48px; padding: 0 14px;
  display: flex; align-items: center; gap: 12px;
  border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: var(--text-muted);
  cursor: pointer; font: 700 14px var(--font); text-align: left; text-decoration: none;
  transition: color .16s ease, background .16s ease, border-color .16s ease;
}
.tipo-tab:hover { color: var(--text); background: var(--surface-hover); }
.tipo-tab.ativo { color: #fff; background: var(--brand); border-color: var(--brand); }
.sidebar-label {
  margin: 22px 10px 8px; color: var(--text-faint);
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em;
}
.secondary-nav {
  min-height: 0; display: flex; flex: 1; flex-direction: column; gap: 4px;
  overflow-y: auto; padding-right: 2px; scrollbar-width: thin;
}
.sidebar-categorias { flex: 1; display: grid; grid-auto-rows: minmax(40px, 1fr); gap: 3px; }
.sidebar-category {
  width: 100%; padding: 0 12px;
  display: flex; align-items: center; gap: 10px;
  border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: var(--text-muted); cursor: pointer;
  font: 650 13px var(--font); text-align: left;
  transition: color .16s ease, background .16s ease, border-color .16s ease;
}
.sidebar-category:hover { color: var(--text); background: var(--surface-hover); }
.sidebar-category.ativo { color: var(--brand); background: var(--surface-raised); border-color: var(--border); }
.sidebar-category-icon {
  width: 19px; height: 19px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--brand); /* cor fixa distingue categoria dos outros itens (ícone neutro) da nav */
}
.sidebar-category-icon svg {
  width: 19px; height: 19px; fill: none; stroke: currentColor;
  stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round;
}
.side-link {
  min-height: 40px; padding: 0 14px;
  display: flex; align-items: center; gap: 12px;
  border-radius: 6px; color: var(--text-muted); text-decoration: none;
  font: 600 13px var(--font);
  transition: color .16s ease, background .16s ease;
}
.side-link:hover { color: var(--text); background: var(--surface-hover); }
.side-link.ativo { color: var(--brand); background: var(--surface-raised); font-weight: 800; }
button.side-link { width: 100%; border: 0; background: transparent; cursor: pointer; text-align: left; margin-top: 4px; }
.nav-icon, .ui-icon, .badge-icon, .inline-icon, .section-icon, .copy-icon {
  display: inline-block; flex: 0 0 auto; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.nav-icon { width: 20px; height: 20px; }
.ui-icon { width: 19px; height: 19px; }
.badge-icon, .inline-icon { width: 12px; height: 12px; }
.copy-icon { width: 13px; height: 13px; margin-left: auto; }

.btn-tema .icon-moon { display: none; }
:root[data-theme="dark"] .btn-tema .icon-sun { display: none; }
:root[data-theme="dark"] .btn-tema .icon-moon { display: inline-block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn-tema .icon-sun { display: none; }
  :root:not([data-theme="light"]) .btn-tema .icon-moon { display: inline-block; }
}

.app-main { min-width: 0; min-height: 100vh; margin-left: 240px; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--topbar); border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);
}
.topbar-inner {
  min-height: 86px; padding: 16px 24px;
  display: flex; align-items: center; gap: 14px;
}
.mobile-brand { display: none; }
.search-wrap {
  position: relative; min-width: 240px; flex: 1;
  display: flex; align-items: center;
}
.search-icon {
  position: absolute; left: 16px; width: 21px; height: 21px;
  fill: none; stroke: var(--text-muted); stroke-width: 1.8;
  stroke-linecap: round; pointer-events: none;
}
#busca {
  width: 100%; height: 48px; padding: 0 46px 0 48px;
  border: 1px solid var(--border-strong); outline: 0; border-radius: var(--radius);
  background: var(--surface); color: var(--text); font-size: 14px; font-weight: 500;
  transition: border-color .16s ease, background .16s ease;
}
#busca::placeholder { color: var(--text-faint); }
#busca:hover { background: var(--surface-hover); border-color: var(--border-strong); }
#busca:focus { background: var(--surface-hover); border-color: var(--brand); }
.busca-limpar {
  position: absolute; right: 10px; width: 30px; height: 30px;
  display: none; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: transparent;
  color: var(--text-muted); cursor: pointer;
}
.busca-limpar.show { display: inline-flex; }
.busca-limpar:hover { color: var(--text); background: var(--surface-raised); }

.utility-btn {
  position: relative; min-height: 44px; padding: 0 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--text); cursor: pointer;
  font: 700 12px var(--font); white-space: nowrap;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}
.utility-btn:hover { background: var(--surface-raised); border-color: var(--brand); color: var(--text); }
.btn-notificacoes {
  width: 44px; padding: 0;
  border: 0; border-radius: 50%; background: transparent;
}
.btn-notificacoes:hover {
  background: transparent; color: var(--brand);
}
#notif-count {
  position: absolute; top: -7px; right: -7px;
  min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 10px; background: var(--brand); color: #fff;
  font: 800 10px/19px var(--font); text-align: center;
}

.mobile-tabs { display: none; }
body[data-pagina="lojas"] .mobile-tabs,
body[data-pagina="loja"] .mobile-tabs,
body[data-pagina="chat"] .mobile-tabs { display: none; }

main { width: 100%; max-width: 1600px; margin-inline: auto; padding: 22px 24px 80px; }

/* ── hero ─────────────────────────────────────────────────────────── */
.hero {
  scroll-margin-top: 100px; margin: 8px auto 40px; padding: 16px 40px;
  max-width: 1100px;
  border-radius: 18px; overflow: visible; position: relative;
  background: linear-gradient(135deg, var(--brand), var(--brand-hover));
  grid-template-columns: minmax(0, 620px) minmax(0, 1fr);
  column-gap: 8px; align-items: end;
}
/* display:grid sem essa guarda vence o [hidden] do navegador (regra de autor
   sempre bate regra de user-agent) — o hero nunca sumia nas outras páginas */
.hero:not([hidden]) { display: grid; }
/* o mascote empurra a cabeça acima da topbar; abre espaço extra proporcional
   ao tamanho dele em cada faixa (ver .hero-mascote abaixo), com folga de
   verdade — não só o mínimo calculado, que já cortou antes */
@media (min-width: 1301px) { .hero { margin-top: 104px; } }
@media (min-width: 1101px) and (max-width: 1300px) { .hero { margin-top: 30px; } }
.hero::before {
  content: ''; position: absolute; inset: 0; opacity: .5; pointer-events: none;
  border-radius: inherit; overflow: hidden;
  background:
    radial-gradient(circle at 88% 18%, #ffffff33 0, transparent 42%),
    radial-gradient(circle at 6% 92%, #ffffff26 0, transparent 38%);
}
.hero-inner { grid-column: 1; position: relative; z-index: 1; min-width: 0; max-width: 620px; }
.hero-mascote {
  display: block; grid-column: 2; justify-self: center; align-self: end;
  position: absolute; z-index: 2; min-width: 0;
  /* align-self:end encosta o boneco no fim da área do grid (que já para antes
     do padding-bottom do .hero); margin-bottom soma mais espaço em cima disso */
  margin-bottom: 6px;
  width: 300px; max-width: none; aspect-ratio: 1056 / 1127;
  pointer-events: none; user-select: none;
}
.hero-mascote-img {
  display: block; width: 100%; height: 100%; object-fit: contain;
  pointer-events: none; user-select: none;
}
.hero-eye {
  position: absolute; z-index: 3; overflow: hidden; border-radius: 50%;
  background: radial-gradient(circle at 43% 34%, #fff 0 58%, #f4f3ee 100%);
  box-shadow: inset 0 0 1px #d7d4cc;
}
.hero-eye-esquerdo {
  left: 37.12%; top: 20.76%; width: 7.1%; height: 9.85%;
  transform: rotate(-2deg);
}
.hero-eye-direito {
  left: 52.94%; top: 22.8%; width: 8.43%; height: 10.47%;
  transform: rotate(2deg);
}
.hero-pupila {
  --pupila-x: 0px; --pupila-y: 0px;
  position: absolute; left: 18%; top: 29%; width: 64%; height: 69%;
  border-radius: 50%; background: #13212b;
  box-shadow: inset -1px -2px 2px #07101866;
  transform: translate3d(var(--pupila-x), var(--pupila-y), 0);
  transition: transform 110ms cubic-bezier(.2,.8,.2,1);
  will-change: transform;
}
.hero-pupila::after {
  content: ''; position: absolute; left: 18%; top: 17%;
  width: 31%; aspect-ratio: 1; border-radius: 50%; background: #fff;
  box-shadow: 0 0 1px #ffffffaa;
}
@media (max-width: 1300px) { .hero-mascote { width: 230px; } }
@media (max-width: 1100px) { .hero-mascote { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .hero-pupila { transition: none; }
}
.hero-title {
  margin: 0 0 14px; color: #fff;
  font-size: 34px; line-height: 1.16; font-weight: 800; letter-spacing: -.03em;
}
.hero-sub { margin: 0 0 22px; color: #ffffffd9; font-size: 14.5px; line-height: 1.55; max-width: 480px; }

/* teaser do chat com o Ferinha — parece uma barra de chat de verdade, mas
   clicar só leva pra página de chat própria (ver .chat-page) */
.hero-chat-teaser {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 52px; padding: 0 8px 0 20px; max-width: 420px;
  border-radius: 999px; background: #fff; text-decoration: none;
  box-shadow: 0 6px 18px #00000022;
  transition: transform .16s ease, box-shadow .16s ease;
}
.hero-chat-teaser:hover { transform: translateY(-1px); box-shadow: 0 10px 24px #00000030; }
.hero-chat-teaser-texto { color: var(--text-faint); font: 600 13px var(--font); }
.hero-chat-teaser-enviar {
  width: 38px; height: 38px; flex: 0 0 auto; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-hover));
}
.hero-chat-teaser-enviar svg {
  width: 18px; height: 18px;
  fill: none; stroke: #fff; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round;
}

/* ── seções: título comum ────────────────────────────────────────── */
.section-title {
  margin: 0 0 16px; color: var(--text);
  font-size: clamp(20px, 1.5vw, 24px); line-height: 1.25; font-weight: 800; letter-spacing: -.03em;
}
.categorias-section, .lojas-section { scroll-margin-top: 100px; margin-bottom: 40px; }

/* ── grid de categorias ───────────────────────────────────────────── */
.category-grid {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px;
}
.category-tile {
  min-height: 120px; padding: 18px 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); cursor: pointer; text-align: center;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.category-tile:hover { border-color: var(--brand); background: var(--surface-hover); transform: translateY(-2px); }
.category-tile.ativo { border-color: var(--brand); background: var(--surface-raised); }
.category-icon {
  width: 64px; height: 64px; border-radius: 16px; flex: 0 0 auto; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-raised); border: 1px solid var(--border);
  box-shadow: 0 4px 12px #1b252b14;
}
.category-icon img {
  width: 100%; height: 100%; display: block; object-fit: cover;
}
.category-label { color: var(--text); font-size: 14px; font-weight: 750; line-height: 1.35; text-wrap: balance; }

/* ── lojas ────────────────────────────────────────────────────────── */
.store-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px;
}
.store-tile {
  min-height: 92px; padding: 14px 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); cursor: pointer; text-align: center;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.store-tile:hover { border-color: var(--brand); background: var(--surface-hover); transform: translateY(-2px); }
.store-tile.ativo { border-color: var(--brand); background: var(--surface-raised); }
.store-logo {
  width: 40px; height: 40px; border-radius: 9px; flex: 0 0 auto; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: #fff;
}
.store-logo img { width: 100%; height: 100%; object-fit: contain; padding: 5px; }
.store-fallback {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-hover));
  color: #fff; font: 800 15px var(--font);
}
.store-nome {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text); font-size: 11.5px; font-weight: 700;
}
.ver-todas-lojas-btn {
  margin-top: 16px; display: inline-flex; align-items: center; gap: 6px;
  color: var(--brand); text-decoration: none; cursor: pointer; font: 700 12.5px var(--font);
}
.ver-todas-lojas-btn::after { content: '→'; }
.ver-todas-lojas-btn:hover { text-decoration: underline; }
.stores-list {
  margin-top: 14px; padding: 16px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px 14px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.store-link {
  padding: 6px 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border: 0; background: transparent; color: var(--text-muted); text-align: left; cursor: pointer;
  font: 600 12.5px var(--font);
}
.store-link:hover { color: var(--brand); }
.store-link.ativo { color: var(--brand); font-weight: 800; }

/* ── página da loja ───────────────────────────────────────────────── */
.loja-page { scroll-margin-top: 100px; }
.loja-voltar {
  margin-bottom: 18px; padding: 0; border: 0; background: transparent;
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-muted); cursor: pointer; font: 700 12.5px var(--font);
}
.loja-voltar:hover { color: var(--brand); }
.loja-voltar .ui-icon { width: 17px; height: 17px; }
.loja-header {
  margin-bottom: 34px; padding: 22px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface);
}
.loja-header-logo {
  width: 68px; height: 68px; border-radius: 14px; flex: 0 0 auto; overflow: hidden;
  display: flex; align-items: center; justify-content: center; background: #fff;
}
.loja-header-logo img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.loja-header-fallback {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-hover));
  color: #fff; font: 800 24px var(--font);
}
.loja-header-info { flex: 1; min-width: 200px; }
.loja-header-info h1 {
  margin: 0 0 4px; color: var(--text); font-size: 24px; font-weight: 800; letter-spacing: -.03em;
}
.loja-header-info p { margin: 0; color: var(--text-muted); font-size: 12.5px; }
.loja-visitar {
  margin-left: auto; min-height: 42px; padding: 0 18px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; background: var(--brand); color: #fff; text-decoration: none;
  font: 800 12.5px var(--font); white-space: nowrap;
  transition: background .16s ease;
}
.loja-visitar:hover { background: var(--brand-hover); }
.loja-bloco { margin-bottom: 40px; }
.ver-mais-btn {
  margin: 18px auto 0; padding: 11px 22px;
  border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--surface); color: var(--text); cursor: pointer;
  font: 800 12.5px var(--font);
  transition: border-color .16s ease, background .16s ease;
}
.ver-mais-btn:not([hidden]) { display: block; }
.ver-mais-btn:hover { border-color: var(--brand); background: var(--surface-hover); }

/* ── página da categoria (reaproveita .loja-header) ──────────────────── */
.categoria-header-icone { background: linear-gradient(135deg, var(--brand), var(--brand-hover)); }
.categoria-header-icone svg {
  width: 38px; height: 38px;
  fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* ── página com todas as lojas ────────────────────────────────────── */
.lojas-page { scroll-margin-top: 100px; }
.lojas-page-titulo {
  margin: 0 0 20px; color: var(--text); font-size: 26px; font-weight: 800; letter-spacing: -.03em;
}
.stores-list-pagina {
  margin-top: 0; padding: 0; display: block;
  border: 0; background: transparent;
}
.store-alpha-group + .store-alpha-group { margin-top: 30px; }
.store-alpha-letter {
  margin: 0 0 12px; display: flex; align-items: center; gap: 12px;
  color: var(--brand); font: 800 18px/1 var(--font); letter-spacing: -.02em;
}
.store-alpha-letter::after {
  content: ''; height: 1px; flex: 1; background: var(--border);
}
.store-alpha-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px;
}
.stores-list-pagina .store-tile {
  min-height: 78px; padding: 12px 14px;
  flex-direction: row; align-items: center; justify-content: flex-start; gap: 14px;
  text-align: left;
}
.stores-list-pagina .store-logo { width: 46px; height: 46px; border-radius: 10px; }
.stores-list-pagina .store-logo img { padding: 6px; }
.stores-list-pagina .store-nome {
  overflow: visible; text-overflow: clip; white-space: normal;
  color: var(--text); font-size: 14px; line-height: 1.35; font-weight: 750;
}

/* ── página de chat com o Ferinha ─────────────────────────────────── */
/* tela cheia de verdade: fixo por cima de sidebar/topbar (z-index maior que
   os dois), corpo travado pra não rolar por trás (ver body.chat-aberto).
   Mostrar/esconder é via classe .aberta (não [hidden]) pra dar pra animar —
   display:none não tem transição sem isso. */
.chat-page {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column;
  background: var(--bg);
  opacity: 0; transform: translateY(18px); pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
.chat-page.aberta { opacity: 1; transform: translateY(0); pointer-events: auto; }
body.chat-aberto { overflow: hidden; }

.chat-page-topo {
  flex: 0 0 auto; padding: 18px clamp(20px, 6vw, 120px);
  border-bottom: 1px solid var(--border); background: var(--surface);
}
.chat-page-topo .pagina-voltar {
  margin: 0 0 16px; font-size: 15px; gap: 8px;
}
.chat-page-topo .pagina-voltar .ui-icon { width: 21px; height: 21px; }
.chat-header { display: flex; align-items: center; gap: 16px; }
.chat-header-avatar {
  width: 64px; height: 64px; border-radius: 50%; flex: 0 0 auto; overflow: hidden;
  background: linear-gradient(135deg, var(--brand), var(--brand-hover));
}
.chat-header-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-header h1 { margin: 0 0 3px; color: var(--text); font-size: 23px; font-weight: 800; letter-spacing: -.02em; }
.chat-header p { margin: 0; color: var(--text-muted); font-size: 14px; }

.chat-mensagens {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 28px clamp(20px, 6vw, 120px);
  display: flex; flex-direction: column; gap: 14px;
}
.chat-bolha {
  max-width: min(80%, 680px); padding: 14px 18px; border-radius: 16px;
  font: 500 16px/1.6 var(--font); white-space: pre-wrap;
}
.chat-bolha-ferinha {
  align-self: flex-start; border-bottom-left-radius: 4px;
  background: var(--surface-raised); color: var(--text);
}
.chat-bolha-usuario {
  align-self: flex-end; border-bottom-right-radius: 4px;
  background: linear-gradient(135deg, var(--brand), var(--brand-hover)); color: #fff;
}
.chat-digitando { opacity: .6; font-style: italic; }
.chat-cinematica { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 28px; background: rgba(12, 14, 20, .82); backdrop-filter: blur(8px); animation: chat-cine-aparece .28s ease both; }
.chat-cinematica.saindo { opacity: 0; transition: opacity .42s ease; }
.chat-cinematica-palco { position: relative; width: min(96vw, 1120px); max-height: 88vh; overflow: hidden; padding: 34px; border: 1px solid rgba(255,255,255,.18); border-radius: 24px; background: linear-gradient(145deg, #252936, #12141c); box-shadow: 0 28px 90px rgba(0,0,0,.5); }
.chat-cinematica-chamada { color: #fff; text-align: center; font-size: clamp(16px, 2vw, 21px); font-weight: 800; }
.chat-cinematica-legenda { margin: 7px 0 22px; color: #ffb09f; text-align: center; font-size: 13px; font-weight: 700; }
.chat-cinematica-legenda span { display: inline-block; width: 20px; overflow: hidden; vertical-align: bottom; animation: chat-pontos 1s steps(4,end) infinite; }
.chat-cinematica-tesoura { position: absolute; z-index: 3; top: 50%; left: -110px; color: #fff; font-size: clamp(86px, 15vw, 150px); filter: drop-shadow(0 7px 12px #0008); transform: rotate(-22deg); animation: chat-tesoura-corta 2.8s cubic-bezier(.2,.7,.25,1) both; pointer-events: none; }
.chat-cinematica.precos-cortados .chat-cinematica-tesoura { opacity: 0; transition: opacity .25s ease; }
.chat-cinematica:not(.precos-cortados) .chat-card-preco strong { opacity: 0; }
.chat-cinematica:not(.precos-cortados) .chat-card-preco-antes { color: #fff; font-size: 17px; text-decoration: none; }
.chat-cinematica.precos-cortados .chat-card-preco strong { animation: chat-preco-aparece .45s ease both; }
.chat-cinematica-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; padding: 5px 0 8px; opacity: 0; transform: translateY(10px) scale(.97); transition: opacity .35s ease, transform .35s ease; }
.chat-cinematica.com-produtos .chat-cinematica-cards { opacity: 1; transform: none; }
.chat-cinematica-cards .chat-card-produto { width: 100%; max-width: none; min-width: 0; min-height: 150px; margin: 0; background: var(--surface); }
@keyframes chat-preco-aparece { from { opacity: 0; transform: translateY(4px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes chat-cine-aparece { from { opacity: 0; } to { opacity: 1; } }
@keyframes chat-tesoura-corta { 0% { left: -110px; transform: rotate(-22deg) scale(.8); } 72% { left: calc(100% - 35px); transform: rotate(18deg) scale(1); } 100% { left: calc(100% + 90px); transform: rotate(25deg) scale(.9); } }
@media (max-width: 650px) { .chat-cinematica { padding: 12px; } .chat-cinematica-palco { padding: 22px 14px; border-radius: 19px; } .chat-cinematica-cards { grid-template-columns: 1fr; } }
.chat-busca { display: inline-flex; align-items: center; gap: 10px; min-width: 230px; color: var(--text-muted); }
.chat-tesoura { display: inline-block; font-size: 24px; transform-origin: 50% 50%; animation: chat-corta .65s ease-in-out infinite alternate; }
.chat-busca-texto { font-weight: 700; }
.chat-reticencias { display: inline-block; width: 22px; overflow: hidden; animation: chat-pontos 1.15s steps(4, end) infinite; }
@keyframes chat-corta { from { transform: rotate(-18deg) translateY(1px); } to { transform: rotate(18deg) translateY(-2px); } }
@keyframes chat-pontos { 0% { width: 0; } 100% { width: 22px; } }
.chat-produtos { display: flex; flex-wrap: wrap; gap: 10px; width: 100%; align-self: flex-start; overflow: visible; padding: 2px 2px 8px; animation: chat-produtos-entra .35s ease both; }
.chat-produtos-titulo { flex: 0 0 100%; margin: 0 0 2px 4px; color: var(--text-muted); font-size: 13px; font-weight: 800; }
.chat-card-produto { display: flex; width: min(100%, 620px); min-height: 126px; overflow: hidden; margin: 0 0 10px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: 0 5px 18px #00000012; }
.chat-card-imagem { position: relative; flex: 0 0 116px; display: flex; align-items: center; justify-content: center; background: #fff; overflow: hidden; }
.chat-card-imagem img { width: 100%; height: 100%; min-height: 126px; object-fit: contain; }
.chat-card-sem-img { color: var(--text-faint); font-size: 11px; text-align: center; }
.chat-card-desconto { position: absolute; top: 7px; left: 7px; padding: 3px 6px; border-radius: 6px; background: var(--brand); color: #fff; font-size: 10px; font-weight: 800; }
.chat-card-conteudo { min-width: 0; display: flex; flex: 1; flex-direction: column; align-items: flex-start; gap: 4px; padding: 11px 13px; }
.chat-card-meta { width: 100%; overflow: hidden; color: var(--text-muted); font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.chat-card-titulo { display: -webkit-box; overflow: hidden; color: var(--text); font-size: 14px; line-height: 1.3; font-weight: 800; text-decoration: none; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.chat-card-titulo:hover { text-decoration: underline; text-underline-offset: 2px; }
.chat-nome-inline { display: inline; -webkit-line-clamp: unset; font-size: inherit; color: var(--brand); }
.chat-oferta-inline {
  color: var(--brand);
  font-weight: 750;
  text-decoration: none;
}
.chat-oferta-inline:hover { text-decoration: underline; text-underline-offset: 2px; }
.chat-card-preco { display: flex; align-items: baseline; gap: 7px; margin-top: auto; }
.chat-card-preco-antes { color: var(--text-faint); font-size: 11px; text-decoration: line-through; }
.chat-card-preco strong { color: var(--brand); font-size: 16px; }
.chat-card-botao { color: var(--brand); font-size: 11px; font-weight: 800; text-decoration: none; }
@keyframes chat-produtos-entra { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* conteúdo rico da resposta do Ferinha: link da oferta, negrito e separador */
.chat-bolha-ferinha strong { font-weight: 700; }
.chat-link {
  color: var(--brand); text-decoration: underline; text-underline-offset: 2px;
  word-break: break-all;
}
.chat-link:hover { color: var(--brand-hover); }
.chat-sep { border: 0; border-top: 1px solid var(--border); margin: 12px 0; }

.chat-form {
  flex: 0 0 auto; display: flex; gap: 12px; padding: 18px clamp(20px, 6vw, 120px);
  border-top: 1px solid var(--border); background: var(--surface);
}
.chat-form #chat-input {
  flex: 1; height: 58px; padding: 0 22px;
  border: 1px solid var(--border-strong); outline: 0; border-radius: 999px;
  background: var(--bg); color: var(--text); font-size: 16px;
  transition: border-color .16s ease, background .16s ease;
}
.chat-form #chat-input:focus { background: var(--surface-hover); border-color: var(--brand); }
.chat-enviar {
  width: 58px; height: 58px; flex: 0 0 auto; border: 0; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-hover));
  transition: transform .16s ease;
}
.chat-enviar:hover { transform: translateY(-1px); }
.chat-enviar svg {
  width: 24px; height: 24px;
  fill: none; stroke: #fff; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round;
}

/* ── página de reels (clips de vídeo do Mercado Livre) ───────────────── */
/* Modo imersivo: durante o Reels não existe chrome do site — somente o
   player, suas ações e o botão Voltar pedido pelo usuário. */
body[data-pagina="reels"] {
  overflow: hidden;
  background: #000;
}
body[data-pagina="reels"] .sidebar,
body[data-pagina="reels"] .topbar { display: none; }
body[data-pagina="reels"] .app-shell,
body[data-pagina="reels"] .app-main {
  min-height: 100dvh;
  height: 100dvh;
}
body[data-pagina="reels"] .app-main { margin-left: 0; }
body[data-pagina="reels"] main {
  width: 100%;
  max-width: none;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
}
.reels-page {
  position: relative;
  width: 100%;
  height: 100%;
  scroll-margin-top: 0;
  background: #000;
}
.reels-page .reels-voltar {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  left: max(14px, env(safe-area-inset-left));
  z-index: 40;
  min-height: 42px;
  margin: 0;
  padding: 0 15px 0 11px;
  border: 1px solid #ffffff26;
  border-radius: 999px;
  background: #050505a8;
  color: #fff;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 18px #0000003d;
}
.reels-page .reels-voltar:hover { color: #fff; background: #050505d9; }
.reels-page .reels-voltar:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

/* O container é o único elemento rolável. Cada reel ocupa exatamente um
   viewport e encaixa no próximo gesto, sem revelar dois vídeos ao mesmo tempo. */
.reels-feed {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  background: #000;
}
.reels-feed::-webkit-scrollbar { display: none; }
.reels-feed > .spinner {
  flex: 0 0 auto;
  margin: auto;
  border-color: #ffffff2b;
  border-top-color: var(--brand);
}
.reel-item {
  position: relative;
  flex: 0 0 100%;
  width: min(100%, 430px);
  height: 100%;
  min-height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
  background: #080808;
  isolation: isolate;
}
.reel-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #080808;
}
.reel-imagem-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #111;
}
.reel-imagem-fundo,
.reel-imagem-principal {
  position: absolute;
  width: 100%;
  height: 100%;
}
.reel-imagem-fundo {
  inset: -8%;
  width: 116%;
  height: 116%;
  object-fit: cover;
  filter: blur(26px) brightness(.48) saturate(.9);
  transform: scale(1.08);
  transition: transform 8s ease-out;
}
.reel-imagem-principal {
  inset: 0;
  z-index: 1;
  object-fit: contain;
  padding: 58px 10px 174px;
  filter: drop-shadow(0 12px 30px #0008);
  transform: scale(.985);
  transition: transform 8s ease-out;
}
.reel-item.ativo .reel-imagem-fundo { transform: scale(1.15); }
.reel-item.ativo .reel-imagem-principal { transform: scale(1.035); }
.reel-mute {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  z-index: 3;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid #ffffff24;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0505058f;
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(8px);
}
.reel-mute:hover { background: #050505c9; }
.reel-mute:focus-visible,
.reel-curtir:focus-visible,
.reel-comentar:focus-visible,
.reel-cta:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}
.reel-mute .ui-icon {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Rail vertical de curtida/comentário por cima do vídeo. */
.reel-acoes {
  position: absolute;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(126px, calc(112px + env(safe-area-inset-bottom)));
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.reel-curtir,
.reel-comentar {
  min-width: 44px;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 0;
  border-radius: 12px;
  background: #05050538;
  padding: 5px;
  cursor: pointer;
  color: #fff;
  backdrop-filter: blur(4px);
}
.reel-curtir:hover,
.reel-comentar:hover { background: #05050573; }
.reel-acao-icon {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.8;
}
.reel-curtir.ativo .reel-acao-icon {
  fill: var(--brand);
  stroke: var(--brand);
  transform: scale(1.08);
}
.reel-acao-count {
  font: 800 11px/1 var(--font);
  text-shadow: 0 1px 4px #000;
}
.reel-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 64px 70px max(18px, calc(14px + env(safe-area-inset-bottom))) 16px;
  background: linear-gradient(to top, #000 0%, #000000d6 42%, transparent 100%);
}
.reel-loja {
  margin: 0 0 7px;
  color: #fff;
  font: 800 11px/1.2 var(--font);
  letter-spacing: .055em;
  text-transform: uppercase;
  text-shadow: 0 1px 6px #000;
}
.reel-badge-desconto {
  display: inline-block;
  margin-bottom: 7px;
  padding: 4px 9px;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  font: 800 11px/1.2 var(--font);
}
.reel-titulo {
  margin: 0 0 7px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  text-wrap: balance;
}
.reel-preco {
  margin-bottom: 10px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.reel-preco-de {
  color: #ffffffa8;
  font-size: 12px;
  text-decoration: line-through;
}
.reel-preco-valor { color: #fff; font: 800 17px/1.2 var(--font); }
.reel-cta {
  min-height: 40px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  font: 800 12px var(--font);
  transition: background .16s ease, transform .16s ease;
}
.reel-cta:hover {
  background: var(--brand-hover);
  transform: translateY(-1px);
}
.reel-cta .ui-icon { width: 15px; height: 15px; }

.reels-vazio {
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 24px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  background: #000;
  color: #ffffffc7;
  font-size: 13px;
  line-height: 1.6;
  pointer-events: none;
}
.reels-vazio:not([hidden]) { display: flex; }
.reels-vazio .spinner {
  border-color: #ffffff2b;
  border-top-color: var(--brand);
}

/* Comentários: painel lateral no desktop e bottom sheet no celular. */
.modal-comentarios .modal-backdrop { background: #05050599; }
.modal-comentarios .modal-comentarios-card {
  width: min(440px, 100%);
  height: 100dvh;
  max-height: 100dvh;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.lista-comentarios {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.lista-comentarios > .spinner { margin: 28px auto; }
.comentario-item p {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.comentario-cabeca {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.comentario-cabeca strong { color: var(--text); font-size: 12.5px; }
.comentario-cabeca span { color: var(--text-faint); font-size: 11px; }
.form-comentario {
  margin-top: 16px;
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--border);
}
.form-comentario input {
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  outline: 0;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
}
.form-comentario input:focus { border-color: var(--brand); }
.form-comentario-linha { display: flex; gap: 8px; }
.form-comentario-linha input { min-width: 0; flex: 1; }
.comentario-enviar {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.comentario-enviar:hover { background: var(--brand-hover); }
.comentario-enviar:disabled { opacity: .55; cursor: wait; }
.comentario-enviar .ui-icon { stroke: #fff; }

@media (min-width: 600px) {
  .reel-item { box-shadow: 0 0 0 1px #ffffff0f, 0 0 56px #000; }
}
@media (max-width: 600px) {
  .modal-comentarios {
    align-items: flex-end;
    justify-content: stretch;
  }
  .modal-comentarios .modal-comentarios-card {
    width: 100%;
    height: min(78dvh, 680px);
    max-height: 78dvh;
    padding: 20px 16px max(16px, env(safe-area-inset-bottom));
    border-width: 1px 0 0;
    border-radius: 18px 18px 0 0;
  }
  .reel-overlay { padding-left: 14px; }
}

.feed-section { scroll-margin-top: 100px; }
.feed-section h2 {
  margin: 0 0 18px; color: var(--text);
  font-size: 28px; line-height: 1.15; font-weight: 800; letter-spacing: -.04em;
}
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.card {
  position: relative; min-width: 0; min-height: 336px; overflow: hidden;
  display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface);
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.card:not(.card-cupom):hover { background: var(--surface-hover); border-color: var(--brand); transform: translateY(-2px); }
.card-recencia {
  min-height: 0; padding: 3px 6px;
  display: inline-flex; align-items: center;
  border: 1px solid var(--border); border-radius: 4px;
  background: var(--surface-raised); color: var(--text-muted);
  font-size: 9px; font-weight: 600; white-space: nowrap;
}
.card-recencia-publicação, .card-recencia-captura { color: var(--text-muted); }
.card-media {
  position: relative; height: 168px; display: block; overflow: hidden;
  background: #f2f2f2;
}
.card-media img {
  width: 100%; height: 100%; display: block; object-fit: contain;
  padding: 10px; transition: transform .22s ease;
}
.card:not(.card-cupom):hover .card-media img { transform: scale(1.025); }
.card-media .sem-img {
  height: 100%; display: flex; align-items: center; justify-content: center;
  color: #686b6f; background: #e7e7e7; font-size: 11px;
}
.badge-desconto {
  position: absolute; top: 9px; left: 9px; z-index: 1;
  padding: 4px 8px; border-radius: 5px;
  background: var(--brand); color: #fff; font-size: 10px; font-weight: 800;
}
.card-body {
  min-width: 0; padding: 13px 12px 12px;
  display: flex; flex: 1; flex-direction: column; gap: 7px;
}
.card-top-line {
  min-height: 16px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
}
.loja-nome {
  max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text-muted); font-size: 9px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .055em;
}
button.loja-nome-link {
  padding: 0; border: 0; background: transparent; cursor: pointer; font: inherit;
  text-transform: uppercase; letter-spacing: .055em;
}
button.loja-nome-link:hover { color: var(--brand); text-decoration: underline; }
.categoria-tag {
  max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text-faint); font-size: 8.5px;
}
.card-titulo {
  min-height: 2.72em; overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  color: var(--text); text-decoration: none; font-size: 12px; line-height: 1.36; font-weight: 650;
}
.card-titulo:hover { text-decoration: underline; text-decoration-color: var(--brand); }
.preco-linha {
  min-height: 24px; margin-top: 1px;
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.preco-de { color: var(--text-faint); font-size: 9px; text-decoration: line-through; }
.preco-por { color: var(--brand); font-size: 17px; line-height: 1; font-weight: 800; }
.desconto-inline { color: var(--brand); font-size: 11px; font-weight: 800; }
.card-footer {
  min-height: 31px; margin-top: auto; padding-top: 9px;
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  border-top: 1px solid var(--border);
}
.card-footer.tem-cupom { flex-direction: column; align-items: stretch; gap: 6px; }
.footer-meta { display: flex; justify-content: flex-end; }
/* Botão "Ver Cupom": mesma estrutura e mecânica do botão da Cuponomia. */
.btn-ver-cupom {
  position: relative;
  width: 100%; min-height: 42px; padding: 0;
  overflow: visible; border: 0; border-radius: 6px;
  background: transparent; cursor: pointer;
  font: 800 12px var(--font); letter-spacing: .01em;
}
.btn-ver-cupom .item-promo-block {
  position: relative; width: 100%; height: 42px; display: block;
  border-radius: 6px;
}
.btn-ver-cupom .item-code-link,
.btn-ver-cupom .item-cover {
  position: absolute; inset: 0; min-width: 0; padding: 0 12px;
  display: flex; align-items: center;
  border-radius: 6px;
}
.btn-ver-cupom .item-code-link {
  justify-content: flex-end;
  overflow: hidden; border: 1px dashed var(--brand);
  background: var(--surface-raised); color: var(--brand);
  font: 800 12.5px var(--mono); letter-spacing: .03em;
  text-overflow: ellipsis; white-space: nowrap;
}
.btn-ver-cupom .item-cover {
  z-index: 1; justify-content: center; padding-right: 20px;
  margin-right: 40px;
  border-radius: 6px 0 0 6px;
  background: var(--brand); color: #fff;
  transition: margin-right .125s ease-in-out, background-color .125s ease-in-out, opacity .2s ease;
}
.btn-ver-cupom .item-cover::after {
  content: "";
  position: absolute; top: 5px; right: -17px; z-index: 3;
  width: 43px; height: 55px; margin-right: -27.5px;
  border: 0; border-radius: 5px 5px 0 0;
  background: linear-gradient(36deg, #ffb199, #ffd4c6 38%, #ffe0d5 47%, #ffd0c2 51%, transparent 54%);
  box-shadow: -2px 8px 7px #0000001a;
  transform: rotate(35deg); transform-origin: top;
  transition: all .125s ease-in-out;
}
.btn-ver-cupom .item-promo-block:hover .item-cover {
  margin-right: 60px;
  background-color: var(--brand-hover);
}
.btn-ver-cupom .item-promo-block:hover .item-cover::after {
  top: -3px; right: -25px;
  width: 44px; height: 76px;
  box-shadow: 0 8px 4px -2px #0000001a;
}
.btn-ver-cupom.revelado .item-cover {
  margin-right: 100%; opacity: 0; pointer-events: none;
}
.loja-ir {
  margin-top: 1px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--brand); text-decoration: none; font: 700 10.5px var(--font);
}
.loja-ir:hover { text-decoration: underline; }
.valida-tag { color: var(--warning); font-size: 8.5px; white-space: nowrap; }
.verif-tag {
  margin-left: auto; padding: 3px 5px;
  display: inline-flex; align-items: center; gap: 3px;
  border-radius: 4px; font-size: 7.5px; font-weight: 800;
}
.verif-tag.verif-ok { background: var(--surface-raised); color: var(--text); }
.verif-tag.verif-ruim { background: var(--danger-bg); color: var(--danger-text); }

/* Offer Score: 0-100 combinando desconto real, histórico de preço,
   confirmação em outras fontes e cupom disponível — ver calcular_offer_score()
   em site/db.php. Só aparece a partir de "Boa oferta" (score >= 50). */
.offer-score {
  padding: 3px 6px;
  display: inline-flex; align-items: center; gap: 3px;
  border-radius: 4px; font-size: 8.5px; font-weight: 800;
  white-space: nowrap;
}
.offer-score-boa { background: var(--surface-raised); color: var(--text); }
.offer-score-alta { background: var(--danger-bg); color: var(--warning); }
.offer-score-top { background: var(--brand); color: #fff; }
.menor-preco-tag {
  display: inline-flex; align-items: center; gap: 3px;
  color: var(--text-muted); font-size: 9px; font-weight: 700;
}

/* Comparação entre lojas do mesmo produto (mesma chave_produto no banco) —
   o card principal já é a melhor cópia (dedup em db_feed); isso só lista as
   alternativas pra decisão, sem trocar o card em si. */
.outras-lojas { margin: 0 0 4px; }
.outras-lojas-toggle {
  width: 100%; padding: 5px 0; border: 0; background: transparent; cursor: pointer;
  display: flex; align-items: center; gap: 4px;
  color: var(--text-muted); font: 700 9.5px var(--font);
}
.outras-lojas-toggle:hover { color: var(--brand); }
.oloja-toggle-icon { width: 11px; height: 11px; flex: 0 0 auto; }
.outras-lojas-lista {
  margin: 0 0 2px; padding: 0; list-style: none;
  display: none; flex-direction: column; gap: 4px;
}
.outras-lojas.aberta .outras-lojas-lista { display: flex; }
.outras-lojas-lista li {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 4px 7px; border-radius: 5px; background: var(--surface-raised);
}
.oloja-nome {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text-muted); font-size: 9.5px; font-weight: 700;
}
.oloja-preco {
  flex: 0 0 auto; color: var(--brand); text-decoration: none; font-size: 10.5px; font-weight: 800;
}
.oloja-preco:hover { text-decoration: underline; }

.vazio-msg {
  padding: 64px 0; color: var(--text-muted);
  text-align: center; font-size: 13px;
}
.retry-btn, .notif-toggle {
  padding: 10px 17px; border: 0; border-radius: 6px;
  background: var(--brand); color: #fff; cursor: pointer;
  font: 800 12px var(--font);
}
.retry-btn { margin-left: 8px; }
.retry-btn:hover, .notif-toggle:hover { background: var(--brand-hover); }
.notif-toggle.ativo { background: var(--text); color: var(--bg); }
.feed-sentinel { display: flex; justify-content: center; padding: 30px 0; }
.feed-sentinel.done { visibility: hidden; }
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--brand);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.skel {
  height: 336px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface-hover);
  animation: pulse 1.2s ease-in-out infinite alternate;
}
@keyframes pulse { to { background: var(--surface-raised); } }

#toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 80;
  padding: 10px 18px; border-radius: 6px;
  background: var(--brand); color: #fff; font-size: 12px; font-weight: 800;
  opacity: 0; pointer-events: none;
  transform: translate(-50%, 8px); transition: opacity .18s ease, transform .18s ease;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

.modal {
  position: fixed; inset: 0; z-index: 70;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-backdrop { position: absolute; inset: 0; background: #05070ccc; }
.modal-card {
  position: relative; width: min(920px, 100%); max-height: 86vh; overflow: auto;
  padding: 24px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface);
}
.modal-notificacoes {
  align-items: stretch; justify-content: flex-end; padding: 0;
}
.modal-notificacoes .modal-backdrop { background: #05070c73; }
.modal-notificacoes-card {
  width: min(440px, 100%); max-height: 100vh; padding: 24px 20px;
  border-width: 0 0 0 1px; border-radius: 0;
  box-shadow: -18px 0 48px #05070c33;
}
.modal-head {
  margin-bottom: 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px;
}
.modal-head strong { color: var(--text); font-size: 22px; line-height: 1.15; font-weight: 800; letter-spacing: -.035em; }
.modal-head p { margin: 6px 30px 0 0; color: var(--text-muted); font-size: 11px; }
.modal-close {
  width: 34px; height: 34px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 50%;
  background: var(--surface-raised); color: var(--text-muted); cursor: pointer;
}
.modal-close:hover { color: var(--text); border-color: var(--brand); }
.notif-actions { margin-bottom: 18px; display: flex; align-items: center; gap: 12px; }
#notif-status { color: var(--text-muted); font-size: 11px; }
#grid-notificacoes { grid-template-columns: minmax(0, 1fr); }

@media (max-width: 1100px) {
  .sidebar { width: 210px; }
  .app-main { margin-left: 210px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); }
  .utility-btn { padding: 0 12px; }
  .btn-notificacoes { padding: 0; }
}

@media (max-width: 900px) {
  .sidebar { display: none; }
  .app-main { margin-left: 0; }
  .topbar { position: sticky; }
  .topbar-inner {
    min-height: auto; padding: 12px 14px;
    flex-wrap: wrap; gap: 10px;
  }
  .mobile-brand {
    min-height: 42px; margin-right: auto;
    display: flex; align-items: center; gap: 8px;
  }
  .mobile-brand .brand-logo { width: 38px; height: 38px; }
  .mobile-brand .brand-title { height: 22px; }
  .utility-btn { min-height: 40px; padding: 0 11px; }
  .btn-notificacoes { width: 40px; padding: 0; }
  .utility-btn span { display: none; }
  .search-wrap { order: 4; flex: 1 0 100%; }
  #busca { height: 47px; }
  .mobile-tabs {
    min-height: 55px; display: flex; border-top: 1px solid var(--border);
  }
  .mobile-tabs .tipo-tab {
    position: relative; min-height: 55px; flex: 1;
    justify-content: center; border: 0; border-radius: 0;
    background: transparent; color: var(--text-muted);
  }
  .mobile-tabs .tipo-tab::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0;
    height: 3px; background: transparent;
  }
  .mobile-tabs .tipo-tab.ativo { color: var(--brand); background: transparent; }
  .mobile-tabs .tipo-tab.ativo::after { background: var(--brand); }
  main { padding: 20px clamp(14px, 3vw, 24px) 72px; }
  .hero { margin-bottom: 28px; padding: 32px 22px; border-radius: 14px; }
  .hero-title { font-size: 24px; }
  .hero-sub { font-size: 13px; margin-bottom: 18px; }
  .hero-chat-teaser { max-width: none; min-height: 46px; padding: 0 6px 0 16px; }
  .section-title { font-size: 20px; }
  .categorias-section, .lojas-section { margin-bottom: 28px; }
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .category-tile { min-height: 108px; padding: 15px 10px; gap: 10px; }
  .category-icon { width: 56px; height: 56px; border-radius: 14px; }
  .category-icon svg { width: 25px; height: 25px; }
  .category-label { font-size: 13.5px; line-height: 1.35; }
  .store-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .store-tile { min-height: 86px; padding: 11px 8px; gap: 8px; }
  .store-logo { width: 38px; height: 38px; }
  .stores-list { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .store-alpha-group + .store-alpha-group { margin-top: 24px; }
  .store-alpha-letter { margin-bottom: 10px; font-size: 17px; }
  .store-alpha-grid { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .stores-list-pagina .store-tile { min-height: 72px; padding: 11px 13px; gap: 12px; }
  .stores-list-pagina .store-logo { width: 44px; height: 44px; }
  .stores-list-pagina .store-nome { font-size: 13.5px; }
  .feed-section h2 { margin-bottom: 16px; font-size: 25px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card { min-height: 304px; }
  .card-recencia { min-height: 0; padding: 3px 6px; font-size: 9.5px; }
  .card-media { height: 137px; }
  .card-media img { padding: 7px; }
  .card-body { padding: 10px 9px 9px; gap: 6px; }
  .loja-nome { max-width: 140px; font-size: 10px; }
  .categoria-tag { display: none; }
  .card-titulo { font-size: 12.5px; line-height: 1.4; }
  .preco-por { font-size: 17px; }
  .preco-de { font-size: 9.5px; }
  .card-footer { gap: 5px; padding-top: 7px; }
  .btn-ver-cupom { min-height: 40px; font-size: 11.5px; }
  .bvc-icon { width: 13px; height: 13px; }
  .loja-ir { font-size: 10.5px; }
  .valida-tag { font-size: 9px; }
  .loja-header { padding: 16px; gap: 12px; }
  .loja-header-logo { width: 54px; height: 54px; border-radius: 11px; }
  .loja-header-info h1 { font-size: 19px; }
  .loja-header-info p { font-size: 11.5px; }
  .loja-visitar { margin-left: 0; width: 100%; order: 3; }
  .modal { padding: 10px; }
  .modal-notificacoes { padding: 0; }
  .modal-card { padding: 18px 14px; }
  .modal-notificacoes-card { width: min(400px, calc(100% - 28px)); max-height: 100vh; }
  .modal-head strong { font-size: 19px; }
  .notif-actions { align-items: flex-start; flex-direction: column; }
  #grid-notificacoes { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 520px) {
  .topbar-inner { padding: 10px 12px; gap: 8px; }
  .mobile-brand .brand-logo { width: 36px; height: 36px; }
  .mobile-brand .brand-title { height: 20px; max-width: 112px; }
  .utility-btn, .btn-notificacoes { min-width: 42px; min-height: 42px; }
  main { padding: 16px 12px 68px; }
  .hero { padding: 26px 18px; margin-bottom: 26px; }
  .hero-title { font-size: clamp(24px, 7vw, 28px); }
  .hero-sub { font-size: 14px; line-height: 1.55; }
  .hero-chat-teaser { min-width: 0; padding-left: 14px; }
  .hero-chat-teaser-texto { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
  .category-grid { gap: 10px; }
  .category-tile { min-height: 112px; padding: 15px 9px; }
  .category-label { font-size: 13.5px; }
  .store-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .card { min-height: 0; }
  .card-media { height: 190px; }
  .card-media img { padding: 12px; }
  .card-body { padding: 14px 13px 13px; gap: 8px; }
  .card-recencia { font-size: 10px; }
  .loja-nome { max-width: 220px; font-size: 10.5px; }
  .card-titulo { font-size: 13.5px; line-height: 1.42; }
  .preco-por { font-size: 19px; }
  .preco-de { font-size: 10px; }
  .btn-ver-cupom { min-height: 42px; font-size: 12px; }
  .loja-ir { font-size: 11px; }
  .loja-header { padding: 14px; }
  .loja-header-info { min-width: 0; }
  .loja-header-info h1 { overflow-wrap: anywhere; }
  .stores-list-pagina .store-tile { min-height: 76px; }
  .stores-list-pagina .store-nome { font-size: 14px; }
  .chat-page-topo { padding: 14px 16px; }
  .chat-header { gap: 12px; }
  .chat-header-avatar { width: 52px; height: 52px; }
  .chat-header h1 { font-size: 20px; }
  .chat-header p { font-size: 12.5px; }
  .chat-mensagens { padding: 18px 14px; }
  .chat-bolha { max-width: 92%; padding: 12px 14px; font-size: 14px; }
  .chat-form { gap: 8px; padding: 12px; }
  .chat-form #chat-input { height: 50px; padding: 0 17px; }
  .chat-enviar { width: 50px; height: 50px; }
  .modal-notificacoes-card { width: 100%; }
}

@media (max-width: 360px) {
  .mobile-brand .brand-title { height: 18px; max-width: 98px; }
  .category-tile { min-height: 108px; }
  .category-label { font-size: 13px; }
  .store-grid { grid-template-columns: minmax(0, 1fr); }
}

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