/* ============================================================
   MEGATOON — Catálogo B2B — main.css v3.0
   Clean · Light · Mobile-first · Brand: navy #1E3A7B + lime #A4CE39
   Autocontido: sem @import / sem fontes externas (economia de dados)
   ============================================================ */

/* ── RESET ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── TOKENS ─────────────────────────────────────────────────── */
:root {
  /* Marca Megatoon */
  --mt-navy:       #1E3A7B;
  --mt-navy-dark:  #152C61;
  --mt-navy-soft:  #EDF1F9;
  --mt-lime:       #A4CE39;
  --mt-lime-dark:  #7FA81F;
  --mt-lime-text:  #5F8A0B;
  --mt-lime-soft:  #F2F8E1;

  /* Compat: nomes antigos apontam para a marca */
  --primary:        var(--mt-navy);
  --primary-light:  #3D5CA6;
  --primary-dark:   var(--mt-navy-dark);
  --accent:         var(--mt-lime);
  --cyan:           var(--mt-navy);

  --success:     #16A34A;
  --success-bg:  #EAF7EF;
  --danger:      #DC2626;
  --danger-bg:   #FDECEC;
  --warning:     #C2740A;
  --warning-bg:  #FDF3E3;

  /* Superfícies */
  --bg:          #F4F6F9;
  --surface:     #FFFFFF;
  --surface-2:   #F8FAFC;
  --border:      #E3E8F0;
  --border-hi:   #C8D2E0;
  --text:        #1B2A41;
  --muted:       #5B6B7F;
  --faint:       #5A6473;

  /* Compat tokens antigos usados em estilos inline */
  --gray-400: var(--faint);
  --gray-700: var(--muted);
  --gray-800: var(--text);
  --c-text:   var(--text);
  --c-muted:  var(--muted);
  --c-faint:  var(--faint);
  --color-action: var(--mt-navy);

  --radius-sm:  8px;
  --radius:     12px;
  --radius-lg:  16px;
  --radius-xl:  22px;

  --shadow-sm:  0 1px 2px rgba(21,44,97,.06), 0 1px 6px rgba(21,44,97,.05);
  --shadow:     0 4px 14px rgba(21,44,97,.10);
  --shadow-md:  0 8px 24px rgba(21,44,97,.12);
  --shadow-lg:  0 16px 44px rgba(21,44,97,.18);

  /* Fonte do sistema: zero download, renderização instantânea */
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
          'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
}

/* ── BASE ───────────────────────────────────────────────────── */
html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  color: var(--text);
  line-height: 1.5;
  background: var(--bg);
  overflow-x: clip; /* clip não cria scroll container, mantém position:sticky funcionando */
}

img    { display: block; max-width: 100%; }
button { font-family: var(--font); cursor: pointer; border: none; background: none; color: inherit; }
a      { color: var(--mt-navy); text-decoration: none; transition: color .15s; }
a:hover { color: var(--primary-light); }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--mt-navy);
  outline-offset: 2px;
}

* { scrollbar-width: thin; scrollbar-color: #C2CCDA transparent; }
*::-webkit-scrollbar       { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #C2CCDA; border-radius: 99px; }

/* ── UTILIDADES ─────────────────────────────────────────────── */
.text-center  { text-align: center; }
.text-muted   { color: var(--muted); }
.text-sm      { font-size: 0.8rem; }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-primary { color: var(--mt-navy); }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }

/* ── BOTÕES ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 10px 18px; border-radius: 10px;
  font-size: 0.9rem; font-weight: 600;
  transition: background .18s ease, box-shadow .18s ease, transform .1s ease, border-color .18s ease;
  cursor: pointer;
  border: 1.5px solid transparent; line-height: 1.2;
  min-height: 44px; font-family: var(--font);
  text-decoration: none;
}
.btn:active { transform: scale(.98); }

.btn-primary {
  background: var(--mt-navy);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--mt-navy-dark); box-shadow: var(--shadow); }

.btn-success {
  background: var(--mt-lime);
  color: var(--mt-navy-dark);
  box-shadow: var(--shadow-sm);
}
.btn-success:hover { background: var(--mt-lime-dark); color: #fff; }

.btn-whatsapp {
  background: #25D366;
  color: #fff; font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.btn-whatsapp:hover { background: #1EBE5B; }

.btn-outline {
  border-color: var(--border-hi);
  color: var(--text);
  background: var(--surface);
}
.btn-outline:hover { border-color: var(--mt-navy); color: var(--mt-navy); background: var(--mt-navy-soft); }

.btn-ghost {
  color: var(--muted);
  background: transparent;
  border-color: transparent;
}
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }

.btn-block { width: 100%; display: flex; }
.btn-lg    { padding: 14px 24px; font-size: 1rem; }
.btn-sm    { padding: 6px 12px; font-size: 0.8rem; min-height: 36px; border-radius: 8px; }

/* ── HEADER (sticky) ────────────────────────────────────────── */
.cat-header {
  position: sticky; top: 0; z-index: 100;
  padding: 6px 14px 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(21,44,97,.05);
}
/* Faixa de marca: lime → navy */
.cat-header::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--mt-lime) 0%, var(--mt-lime) 35%, var(--mt-navy) 100%);
}

.cat-header-top {
  display: flex; align-items: center; gap: 8px;
  padding-top: 3px; margin-bottom: 5px;
}
.cat-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* Encolhe ao rolar: oculta o texto da marca/cliente e aperta os espaçamentos
   da busca/toolbar/abas — nada some, só fica mais compacto — pra sobrar mais
   altura de tela pro card do produto (senão o cabeçalho fixo + o card não
   cabem juntos e o topo do produto some atrás do cabeçalho ao rolar até o
   +/- de quantidade). Logo, botão de Histórico e timer permanecem sempre visíveis. */
.cat-header.is-compact .cat-brand-name, .cat-header.is-compact .cat-seller-line { display: none; }
.cat-header.is-compact .cat-customer-line { font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55vw; }
.cat-header.is-compact .cat-header-top { margin-bottom: 4px; }
.cat-header.is-compact .cat-logo { width: 30px; height: 30px; border-radius: 9px; }
.cat-header.is-compact .cat-logo svg { width: 20px; height: 20px; }
.cat-header.is-compact .cat-search-bar { margin-bottom: 4px; }
.cat-header.is-compact .search-wrap input { height: 34px; }
.cat-header.is-compact .cat-toolbar { margin-bottom: 4px; }
.cat-header.is-compact .tb-btn { height: 30px; padding: 0 10px; }
.cat-header.is-compact .cat-tabs { padding: 3px; margin-bottom: 4px; }
.cat-header.is-compact .cat-tab { padding: 4px 8px; min-height: 30px; }
.cat-header.is-compact .assist-strip { padding-top: 1px; padding-bottom: 1px; }

/* Tela baixa (pouca altura, independe da largura): já entra "compacta" desde
   o primeiro carregamento, sem esperar rolar — senão a 1ª fileira de
   produtos (a mais importante) já nasce cortada antes do +/- de quantidade. */
@media (max-height: 700px) {
  .cat-brand-name, .cat-seller-line { display: none !important; }
  .cat-customer-line { font-size: .78rem !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55vw; }
  .cat-header-top { margin-bottom: 3px !important; }
  .cat-logo { width: 28px !important; height: 28px !important; }
  .cat-search-bar { margin-bottom: 4px !important; }
  .search-wrap input { height: 32px !important; }
  .cat-toolbar { margin-bottom: 4px !important; }
  .tb-btn { height: 28px !important; padding: 0 10px !important; }
  .cat-tabs { padding: 3px !important; margin-bottom: 4px !important; }
  .cat-tab { padding: 3px 8px !important; min-height: 26px !important; }
  .cat-header .assist-strip { margin: 2px 0 3px !important; padding-top: 1px !important; padding-bottom: 1px !important; }
}

.cat-brand { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.cat-logo {
  width: 32px; height: 32px; flex-shrink: 0;
  background: var(--mt-navy);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: width .2s ease, height .2s ease;
}
.cat-brand-text { display: flex; flex-direction: column; min-width: 0; gap: 0; }
.cat-brand-name {
  color: var(--mt-navy); font-weight: 800; font-size: 0.88rem;
  letter-spacing: 0.2px; line-height: 1.1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cat-customer-line {
  color: var(--muted); font-size: 0.68rem; line-height: 1.15;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cat-customer-line strong { color: var(--text); font-weight: 600; }
.cat-seller-line {
  color: var(--faint); font-size: 0.64rem; line-height: 1.1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Timer */
.cat-timer {
  display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0;
  background: var(--mt-navy-soft);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 5px 9px; color: var(--mt-navy); font-size: 0.76rem; font-weight: 600;
}
.cat-timer.timer-warning  { background: var(--warning-bg); color: var(--warning); }
.cat-timer.timer-critical { background: var(--danger-bg);  color: var(--danger); animation: pulse-opacity 1s infinite; }

/* Botão histórico no header */
.btn-historico {
  display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0;
  background: var(--surface); color: var(--mt-navy);
  border: 1.5px solid var(--border-hi); border-radius: 8px;
  padding: 6px 10px; font-size: 0.74rem; font-weight: 700;
  text-decoration: none; white-space: nowrap;
  transition: all .15s;
}
.btn-historico:hover { border-color: var(--mt-navy); background: var(--mt-navy-soft); }

/* Barra de busca */
.cat-search-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.search-wrap { flex: 1; position: relative; display: flex; align-items: center; }
.search-wrap svg { position: absolute; left: 12px; color: var(--faint); pointer-events: none; }
.search-wrap input {
  width: 100%; height: 34px; padding: 0 36px 0 40px;
  border: 1.5px solid var(--border);
  border-radius: 11px;
  font-size: 0.92rem; font-family: var(--font);
  background: var(--surface-2);
  color: var(--text); outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
  -webkit-appearance: none; appearance: none;
}
.search-wrap input::placeholder { color: var(--faint); }
.search-wrap input:focus {
  border-color: var(--mt-navy);
  box-shadow: 0 0 0 3px rgba(30,58,123,.12);
  background: var(--surface);
}
.search-clear {
  position: absolute; right: 8px; width: 24px; height: 24px;
  border-radius: 50%; background: var(--border); color: var(--muted);
  font-size: 0.72rem; display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.search-clear:hover { background: var(--border-hi); color: var(--text); }

/* ── TOOLBAR: Filtros / Ordenar / contagem ──────────────────── */
.cat-toolbar {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
}
.tb-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 11px;
  background: var(--surface);
  border: 1.5px solid var(--border-hi);
  border-radius: 10px;
  color: var(--text); font-size: 0.82rem; font-weight: 600;
  white-space: nowrap; position: relative;
  transition: all .15s;
  flex-shrink: 0;
}
.tb-btn:hover, .tb-btn:active { border-color: var(--mt-navy); color: var(--mt-navy); }
.tb-btn svg { flex-shrink: 0; color: var(--mt-navy); }
.tb-btn.tb-active { border-color: var(--mt-navy); background: var(--mt-navy-soft); color: var(--mt-navy); }
/* Em telas estreitas o botão de ordenação mostra só o ícone */
@media (max-width: 520px) {
  #btnOpenSort .tb-label { display: none; }
}

.filter-badge {
  min-width: 19px; height: 19px; padding: 0 5px;
  background: var(--mt-lime);
  border-radius: 10px; font-size: 0.68rem; font-weight: 800;
  color: var(--mt-navy-dark); display: inline-flex; align-items: center; justify-content: center;
}

.products-count {
  margin-left: auto; color: var(--faint); font-size: 0.76rem;
  white-space: nowrap; flex-shrink: 0;
}
/* Em telas estreitas, esconde a contagem para a toolbar caber */
@media (max-width: 430px) {
  .products-count { display: none; }
}

/* Tabs de modo (botões principais de navegação) */
.cat-tabs {
  display: flex;
  gap: 6px;
  overflow: hidden;
  background: linear-gradient(135deg, #F7FAFE 0%, #EEF4FB 100%);
  border: 1px solid var(--border-hi);
  border-radius: 14px; padding: 4px;
  margin-bottom: 6px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.8);
}
.cat-tab {
  flex: 1 1 0;
  min-width: 0;
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 5px 8px; min-height: 28px;
  border: 1.5px solid var(--border-hi);
  border-radius: 11px;
  background: #fff;
  color: var(--mt-navy); font-size: clamp(.68rem, 2.8vw, .82rem); font-weight: 850;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(30,58,123,.07);
  transition: box-shadow .16s ease, background .16s ease, color .16s ease, border-color .16s ease;
}
.cat-tab svg { color: var(--mt-navy); opacity: .82; flex: 0 0 auto; }
.cat-tab:hover,
.cat-tab:active {
  border-color: var(--mt-navy);
  box-shadow: 0 8px 18px rgba(30,58,123,.13);
}
.cat-tab.active {
  background: linear-gradient(135deg, var(--mt-navy-dark), var(--mt-navy));
  color: #fff;
  border-color: var(--mt-navy-dark);
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(30,58,123,.24);
}
.cat-tab.active svg { color: var(--mt-lime); opacity: 1; }
.cat-tab.active::after {
  content: '';
  position: absolute;
  left: 50%; bottom: 4px;
  width: 26px; height: 3px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: var(--mt-lime);
  box-shadow: 0 0 0 1px rgba(255,255,255,.35);
}
@media (max-width: 420px) {
  .cat-tabs { gap: 4px; padding: 4px; }
  .cat-tab { min-height: 40px; padding: 8px 4px; gap: 4px; letter-spacing: -.01em; }
  .cat-tab svg { width: 13px; height: 13px; }
}
/* Barra de filtros aplicados (chips removíveis) */
.applied-bar {
  display: flex; gap: 6px; align-items: center;
  padding: 2px 0 10px;
}
.applied-bar-scroll {
  display: flex; gap: 6px; align-items: center;
  overflow-x: auto; scrollbar-width: none;
  flex: 1; min-width: 0;
}
.applied-bar-scroll::-webkit-scrollbar { display: none; }
.applied-chip {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  background: var(--mt-navy-soft);
  border: 1px solid #D4DEF0;
  color: var(--mt-navy);
  border-radius: 999px; padding: 5px 7px 5px 11px;
  font-size: 0.76rem; font-weight: 600;
  transition: background .15s;
}
.applied-chip .ac-x {
  width: 17px; height: 17px; border-radius: 50%;
  background: rgba(30,58,123,.14); color: var(--mt-navy);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.66rem; line-height: 1;
}
.applied-chip:hover { background: #E2E9F6; }
.applied-chip-clear {
  flex-shrink: 0; border: none; background: var(--surface, #fff);
  color: var(--danger); font-size: 0.76rem; font-weight: 700;
  padding: 5px 8px 5px 12px; white-space: nowrap;
  border-left: 1px solid var(--border); margin-left: 2px;
}

/* ── CONTEÚDO PRINCIPAL ─────────────────────────────────────── */
.cat-main {
  padding-bottom: 110px;
  min-height: 100vh;
}

.products-header { padding: 10px 14px 2px; display: flex; align-items: center; }

/* ── GRID DE PRODUTOS ───────────────────────────────────────── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 10px 10px 6px;
}
@media (min-width: 900px) { .products-grid { padding-top: 6px; } }

@media (min-width: 600px)  { .products-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px)  { .products-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1200px) { .products-grid { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 1500px) { .products-grid { grid-template-columns: repeat(6, 1fr); } }

/* ── CARD DO PRODUTO ────────────────────────────────────────── */
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease, border-color .2s ease;
  position: relative;
  display: flex; flex-direction: column;
  cursor: pointer;
  /* Pula renderização fora da tela (grande ganho em listas longas) */
  content-visibility: auto;
  contain-intrinsic-size: 1px 430px;
}
.product-card:hover { box-shadow: var(--shadow); border-color: var(--border-hi); }
.product-card.out-of-stock .product-img-wrap { opacity: .55; }
.product-card.hidden { display: none; }

/* Imagem */
.product-img-wrap {
  position: relative;
  background: #FFFFFF;
  border-bottom: 1px solid var(--border);
  padding-top: 110%;
  overflow: hidden;
}
/* Foto valorizada por padrão (mais alta) — só fica compacta quando a
   ALTURA da janela é curta (não depende da largura: uma janela pode ser
   larga e baixa ao mesmo tempo, comum em notebook não maximizado), senão
   a foto grande + o resto do card não cabem e corta o +/- de quantidade. */
@media (min-width: 900px)  { .product-img-wrap { padding-top: 90%; } }
@media (min-width: 1200px) { .product-img-wrap { padding-top: 82%; } }
@media (min-width: 1500px) { .product-img-wrap { padding-top: 78%; } }
@media (max-height: 700px) and (min-width: 600px)  { .product-img-wrap { padding-top: 70% !important; } }
@media (max-height: 700px) and (min-width: 900px)  { .product-img-wrap { padding-top: 52% !important; } }
@media (max-height: 700px) and (min-width: 1200px) { .product-img-wrap { padding-top: 44% !important; } }
@media (max-height: 700px) and (min-width: 1500px) { .product-img-wrap { padding-top: 40% !important; } }
.product-img {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  object-fit: contain;
  background: #fff;
}
.product-img-placeholder {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--faint); font-size: 2rem;
  background: var(--surface-2);
}
.product-img-download {
  position: absolute; right: 6px; bottom: 6px; z-index: 3;
  width: 26px; height: 26px; border-radius: 50%; border: none;
  background: rgba(15,23,42,.5); color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0; transition: background .15s, transform .15s;
}
.product-img-download:hover  { background: rgba(15,23,42,.75); }
.product-img-download:active { transform: scale(.9); }
.product-img-download.is-loading { opacity: .6; pointer-events: none; }

/* Badges */
.product-badges {
  position: absolute; top: 8px; left: 8px; right: 8px;
  display: flex; flex-wrap: wrap; gap: 4px;
  pointer-events: none;
}
.badge-pill {
  padding: 2px 8px; border-radius: 20px;
  font-size: 0.64rem; font-weight: 700;
  line-height: 1.7; letter-spacing: 0.3px;
  box-shadow: 0 1px 3px rgba(21,44,97,.15);
}
.badge-repurchase { background: var(--mt-navy);  color: #fff; }
.badge-new        { background: var(--mt-lime);  color: var(--mt-navy-dark); }
.badge-nostock    { background: var(--danger);   color: #fff; }
.badge-destaque   { background: #F5A623;         color: #4A3000; }
.badge-sugerido   { background: var(--mt-lime);   color: #1F3300; }
.badge-composite  { background: #7C5CDB;         color: #fff; }
.badge-lowstock   { background: var(--warning);  color: #fff; }
.badge-instock    { background: var(--success-bg); color: var(--success); }
.badge-purchase-order { background: #2563EB; color: #fff; }
.badge-restock { background: var(--warning); color: #fff; display: inline-flex; align-items: center; gap: 3px; }
.badge-restock svg { flex-shrink: 0; }
.ps-hint-restock { color: var(--warning); }

/* Pareto badges (escala navy) */
.badge-pareto     { color: #fff; font-weight: 700; }
.badge-pareto-50  { background: var(--mt-navy-dark); }
.badge-pareto-60  { background: var(--mt-navy); }
.badge-pareto-70  { background: #2C4E9E; }
.badge-pareto-80  { background: #4467B6; }
.badge-pareto-90  { background: #6B89C8; }
.badge-pareto-100 { background: var(--border-hi); color: var(--muted); }

/* Info do produto */
.product-info { padding: 10px; flex: 1; display: flex; flex-direction: column; gap: 0; }
@media (max-height: 700px) { .product-info { padding: 6px 10px !important; } }

.product-code {
  color: var(--faint); font-size: 0.66rem;
  font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase; margin-bottom: 2px;
}
.product-desc {
  font-size: 0.94rem; font-weight: 700; color: var(--text);
  line-height: 1.32; margin-bottom: 5px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
@media (max-height: 700px) {
  .product-desc { font-size: 0.84rem !important; font-weight: 600 !important; line-height: 1.28 !important; margin-bottom: 3px !important; }
}
/* Uma linha só, com rolagem horizontal se não couber tudo — evita que o card
   cresça pra 2 linhas de chip (o que empurra o +/- de quantidade pra fora
   da tela em telas mais baixas). */
.product-meta { display: flex; gap: 4px; flex-wrap: nowrap; overflow-x: auto; margin-bottom: 6px; scrollbar-width: none; -ms-overflow-style: none; }
.product-meta::-webkit-scrollbar { display: none; }
@media (max-height: 700px) { .product-meta { margin-bottom: 4px !important; } }
.product-meta span {
  font-size: 0.68rem; color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 2px 7px; border-radius: 5px;
  white-space: nowrap; flex-shrink: 0;
}
.product-price {
  color: var(--mt-navy);
  font-size: 1.22rem; font-weight: 800;
  margin-bottom: 2px;
}
.product-price.price-promo { color: var(--mt-lime-text); }
@media (max-height: 700px) { .product-price { font-size: 1.05rem !important; } }
.in-stock-text  { color: var(--success); font-weight: 600; }
.out-stock-text { color: var(--danger);  font-weight: 600; }

/* Pill de histórico colapsável */
.history-pill-wrap { margin: 6px 0 8px; }
@media (max-height: 700px) { .history-pill-wrap { margin: 2px 0 1px !important; } }
.history-pill {
  display: flex; align-items: center; gap: 6px;
  width: 100%; padding: 7px 10px;
  background: var(--mt-navy-soft);
  border: 1px solid #D4DEF0;
  border-radius: var(--radius-sm);
  cursor: pointer; font-size: 0.72rem; color: var(--mt-navy);
  transition: border-color .15s, background .15s;
  text-align: left;
}
.history-pill:hover { border-color: var(--mt-navy); }
.history-pill-icon  { font-size: 0.85rem; flex-shrink: 0; }
.history-pill-total { font-weight: 700; font-size: 0.76rem; white-space: nowrap; }
.history-pill-date  { flex: 1; font-size: 0.68rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-chevron    { flex-shrink: 0; transition: transform .22s ease; color: var(--faint); }
.history-pill.history-pill-open .history-chevron { transform: rotate(180deg); }

.history-detail {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding: 6px 10px 8px;
  font-size: 0.72rem; color: var(--muted);
  animation: slide-up .18s ease;
}
.history-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 3px 0; border-top: 1px solid var(--border);
  color: var(--muted);
}
.history-row:first-child { border-top: none; }
.history-qty { font-weight: 600; color: var(--text); white-space: nowrap; margin-left: 8px; }
.history-devolution { color: var(--danger); }
/* Caixa de código de barras — discreta de propósito (só o número + copiar,
   sem rótulo), mesmo azul do aviso "Pedido de compra a chegar"
   (.ps-purchase-order). Usada no card do grid e na ficha de detalhes. */
.barcode-box { margin: 6px 0; }
.barcode-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 4px 8px; margin-bottom: 4px;
  background: #EFF6FF; border: 1px solid #BFDBFE; border-radius: var(--radius-sm);
}
.barcode-row:last-child { margin-bottom: 0; }
.barcode-code { font-size: 0.72rem; font-weight: 700; color: #1D4ED8; letter-spacing: .2px; font-variant-numeric: tabular-nums; }
.barcode-copy {
  flex: 0 0 auto; width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid #BFDBFE; border-radius: 5px;
  background: #fff; color: #1D4ED8;
  transition: all .15s;
}
.barcode-copy:hover, .barcode-copy:active { background: #1D4ED8; border-color: #1D4ED8; color: #fff; }
.history-total-row {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 5px; margin-top: 3px;
  border-top: 1px solid var(--border-hi);
  font-weight: 700; color: var(--mt-navy); font-size: 0.74rem;
}

/* Controle de quantidade */
.qty-control {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  margin-top: auto;
}
.qty-btn {
  width: 42px; height: 42px; border-radius: 9px;
  font-size: 1.35rem; font-weight: 700; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, transform .1s; flex-shrink: 0;
  background: var(--mt-lime);
  color: var(--mt-navy-dark);
}
.qty-btn:hover  { background: var(--mt-lime-dark); color: #fff; }
.qty-btn:active { transform: scale(.92); }
.qty-btn.qty-minus { background: var(--border); color: var(--muted); }
.qty-btn.qty-minus:hover { background: var(--border-hi); color: var(--text); }
.qty-btn.qty-minus.has-qty { background: var(--danger-bg); color: var(--danger); }
.qty-btn.qty-minus.has-qty:hover { background: #F9D8D8; }
/* Tela baixa: aperta o controle de quantidade pra sobrar altura no card
   (em tela alta o botão grande de sempre é melhor de clicar/tocar). */
@media (max-height: 700px) and (min-width: 900px) {
  .qty-control { padding: 3px !important; }
  .qty-btn { width: 34px !important; height: 34px !important; font-size: 1.1rem !important; }
}

.qty-input {
  flex: 1; text-align: center; border: none; background: transparent;
  font-size: 1.1rem; font-weight: 700; color: var(--text); min-width: 0;
  height: 42px;
  -moz-appearance: textfield; appearance: textfield;
}
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button { -webkit-appearance: none; }

.in-cart-indicator {
  background: var(--mt-lime-soft);
  border: 1px solid #DBEBB2;
  border-radius: var(--radius-sm);
  padding: 4px 8px; font-size: 0.74rem; font-weight: 600;
  color: var(--mt-lime-text); margin-bottom: 6px;
  display: flex; align-items: center; gap: 4px;
}
.in-cart-indicator svg { width: 12px; height: 12px; flex-shrink: 0; }

/* Stock dot */
.stock-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: middle; flex-shrink: 0; }
.stock-dot-in  { background: var(--success); }
.stock-dot-out { background: var(--danger); }
.stock-line    { display: flex; align-items: center; margin-bottom: 6px; font-size: 0.72rem; color: var(--text); }
@media (max-height: 700px) { .stock-line { margin-bottom: 2px !important; } }
.purchase-order-line { margin-bottom: 6px; font-size: 0.72rem; font-weight: 700; color: #1D4ED8; }
.ps-purchase-order { margin-top: 8px; padding: 8px 10px; border-radius: var(--radius-sm); background: #EFF6FF; color: #1D4ED8; font-size: .82rem; font-weight: 700; }

/* ── BOTTOM SHEETS (filtros / ordenação / produto) ──────────── */
.sheet {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: flex-end; justify-content: center;
  pointer-events: none; visibility: hidden;
  transition: visibility .28s;
}
.sheet.open { pointer-events: all; visibility: visible; }

.sheet-overlay {
  position: absolute; inset: 0;
  background: rgba(20,32,58,0); transition: background .28s;
}
.sheet.open .sheet-overlay { background: rgba(20,32,58,.45); }

.sheet-body {
  position: relative; width: 100%; max-width: 560px;
  background: var(--surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  max-height: 88vh; max-height: 88dvh;
  display: flex; flex-direction: column; overflow: hidden;
  transform: translateY(100%); transition: transform .28s ease;
  box-shadow: var(--shadow-lg);
  /* Mantém a camada de composição sempre "promovida" (GPU). Sem isso, em
     alguns Chrome/Edge, rolar uma lista rolável ANINHADA (.fgroup-options
     dentro de .sheet-scroll dentro deste container arredondado+overflow
     hidden) faz o navegador perder o layer e pintar tudo em branco —
     reproduzido ao rolar bem pra baixo na lista de Tamanho. */
  will-change: transform;
}
.sheet.open .sheet-body { transform: translateY(0); }

.sheet-handle {
  width: 40px; height: 4px; border-radius: 99px;
  background: var(--border-hi); margin: 8px auto 0; flex-shrink: 0;
}
.sheet-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px 10px; flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}
.sheet-header h3 { font-size: 1.05rem; font-weight: 800; color: var(--text); }
.sheet-close {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 1.15rem; color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.sheet-close:hover { background: var(--border); color: var(--text); }

.sheet-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; transform: translateZ(0); }

.sheet-footer {
  display: flex; gap: 10px; padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  background: var(--surface); flex-shrink: 0;
}
.sheet-footer .btn-ghost   { flex: 0 0 auto; }
.sheet-footer .btn-primary { flex: 1; }

/* Grupos do filtro (acordeão) */
.fgroup { border-bottom: 1px solid var(--border); }
.fgroup-head {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 15px 18px; text-align: left;
  font-size: 0.92rem; font-weight: 700; color: var(--text);
  background: var(--surface);
  transition: background .12s;
}
.fgroup-head:hover { background: var(--surface-2); }
.fgroup-title { flex-shrink: 0; }
.fgroup-sel {
  flex: 1; text-align: right;
  font-size: 0.78rem; font-weight: 600; color: var(--mt-lime-text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fgroup-chevron { flex-shrink: 0; color: var(--faint); transition: transform .22s ease; }
.fgroup.open .fgroup-chevron { transform: rotate(180deg); }

.fgroup-body { display: none; padding: 0 18px 14px; }
.fgroup.open .fgroup-body { display: block; animation: slide-down .18s ease; }

.fgroup-search { margin-bottom: 8px; }
.fgroup-search input {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1.5px solid var(--border); border-radius: 9px;
  font-size: 0.85rem; font-family: var(--font);
  background: var(--surface-2); color: var(--text); outline: none;
}
.fgroup-search input:focus { border-color: var(--mt-navy); background: var(--surface); }

.fgroup-options { max-height: 230px; overflow-y: auto; overscroll-behavior: contain; transform: translateZ(0); }

.fopt {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 2px; cursor: pointer; user-select: none;
  font-size: 0.88rem; color: var(--text);
  border-bottom: 1px solid var(--surface-2);
}
.fopt:last-child { border-bottom: none; }
.fopt input { position: absolute; opacity: 0; pointer-events: none; }
.fopt-box {
  width: 21px; height: 21px; border-radius: 6px; flex-shrink: 0;
  border: 2px solid var(--border-hi); background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.fopt-box::after {
  content: ''; width: 11px; height: 6px;
  border-left: 2.5px solid #fff; border-bottom: 2.5px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px) scale(0);
  transition: transform .12s;
}
.fopt input:checked + .fopt-box { background: var(--mt-navy); border-color: var(--mt-navy); }
.fopt input:checked + .fopt-box::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.fopt-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fopt-count { flex-shrink: 0; font-size: 0.74rem; color: var(--faint); font-weight: 600; }

/* Chips (single-select dentro do filtro) */
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 9px 15px; border-radius: 999px; font-size: 0.82rem; font-weight: 600;
  border: 1.5px solid var(--border-hi); color: var(--muted);
  background: var(--surface); transition: all .15s; cursor: pointer;
  min-height: 38px;
}
.chip:hover { border-color: var(--mt-navy); color: var(--mt-navy); }
.chip.active {
  background: var(--mt-navy);
  border-color: var(--mt-navy);
  color: #fff;
}

/* Ordenação (lista de opções) */
.sort-opt {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; text-align: left;
  font-size: 0.9rem; color: var(--text); font-weight: 500;
  border-bottom: 1px solid var(--surface-2);
  transition: background .12s;
}
.sort-opt:hover { background: var(--surface-2); }
.sort-radio {
  width: 21px; height: 21px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--border-hi);
  display: inline-flex; align-items: center; justify-content: center;
  transition: border-color .15s;
}
.sort-radio::after {
  content: ''; width: 11px; height: 11px; border-radius: 50%;
  background: var(--mt-navy); transform: scale(0); transition: transform .12s;
}
.sort-opt.active { font-weight: 700; color: var(--mt-navy); }
.sort-opt.active .sort-radio { border-color: var(--mt-navy); }
.sort-opt.active .sort-radio::after { transform: scale(1); }

/* ── FICHA DO PRODUTO (bottom sheet) ────────────────────────── */
.ps-photo-wrap {
  position: relative; background: #fff;
  border-bottom: 1px solid var(--border);
  cursor: zoom-in;
}
.ps-photo {
  width: 100%; height: 42vh; min-height: 240px;
  object-fit: contain; background: #fff;
}
.ps-photo-placeholder {
  position: relative;
  width: 100%; height: 30vh; min-height: 180px;
  display: flex; align-items: center; justify-content: center;
  color: var(--faint); font-size: 3rem; background: var(--surface-2);
}
.ps-zoom-hint {
  position: absolute; right: 10px; bottom: 10px;
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(27,42,65,.78); color: #fff;
  font-size: 0.7rem; font-weight: 600;
  padding: 6px 10px; border-radius: 999px;
  pointer-events: none;
}
.ps-badges { position: absolute; top: 10px; left: 10px; right: 56px; display: flex; flex-wrap: wrap; gap: 4px; pointer-events: none; }
.ps-info { padding: 14px 18px 18px; }
.ps-code { color: var(--faint); font-size: 0.7rem; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.ps-title { font-size: 1.06rem; font-weight: 800; color: var(--text); line-height: 1.3; margin: 3px 0 10px; }
.ps-attrs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.ps-attr {
  display: inline-flex; flex-direction: column; gap: 1px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 9px; padding: 6px 12px;
}
.ps-attr small { font-size: 0.62rem; color: var(--faint); text-transform: uppercase; letter-spacing: .4px; font-weight: 700; }
.ps-attr span  { font-size: 0.84rem; color: var(--text); font-weight: 600; }
.ps-price-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.ps-price { font-size: 1.5rem; font-weight: 800; color: var(--mt-navy); }
.ps-price.price-promo { color: var(--mt-lime-text); }
.ps-price-base { font-size: .9rem; color: var(--faint); text-decoration: line-through; }
.ps-hint { font-size: 0.78rem; color: var(--muted); margin-bottom: 10px; }
.ps-hint strong { color: var(--mt-lime-text); }

.pp-wrap { margin-bottom: 12px; }
.pp-track {
  position: relative;
  height: 8px;
  background: var(--mt-navy-soft);
  border-radius: 999px;
  overflow: hidden;
}
.pp-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: var(--mt-navy);
  border-radius: 999px;
  transition: width .2s ease;
}
.pp-marks { position: relative; height: 16px; margin-top: 2px; }
.pp-mark {
  position: absolute;
  transform: translateX(-50%);
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--faint);
  white-space: nowrap;
}
.pp-callout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  background: var(--mt-lime-soft);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 7px 11px;
  border-radius: 9px;
  margin-top: 6px;
}
.pp-callout strong { color: var(--mt-lime-text); }
.pp-save { color: var(--mt-lime-text); font-weight: 700; }
.pp-callout-max { background: var(--success-bg); color: var(--success); }

/* Versão compacta da barra de progresso, dentro do card do grid */
.pp-wrap-card .pp-wrap { margin-bottom: 6px; }
.pp-wrap-card .pp-track { height: 6px; }
.pp-wrap-card .pp-marks { height: 13px; }
.pp-wrap-card .pp-mark { font-size: 0.56rem; }
.pp-wrap-card .pp-callout {
  display: block;
  font-size: 0.68rem;
  padding: 5px 8px;
  margin-top: 4px;
}
.ps-stock {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.8rem; font-weight: 600; margin-bottom: 12px;
  padding: 6px 12px; border-radius: 999px;
}
.ps-stock.in  { background: var(--success-bg); color: var(--success); }
.ps-stock.out { background: var(--danger-bg);  color: var(--danger); }
.ps-section-title {
  font-size: 0.74rem; font-weight: 800; color: var(--faint);
  text-transform: uppercase; letter-spacing: .5px;
  margin: 14px 0 6px;
}
.ps-history { border: 1px solid var(--border); border-radius: 10px; padding: 4px 12px; }
.ps-footer {
  display: flex; align-items: center; gap: 12px;
}
.ps-footer .qty-control { flex: 1; margin-top: 0; }
.ps-total { flex-shrink: 0; text-align: right; min-width: 92px; }
.ps-total small  { display: block; font-size: 0.66rem; color: var(--faint); text-transform: uppercase; font-weight: 700; letter-spacing: .4px; }
.ps-total strong { font-size: 1.05rem; color: var(--mt-navy); }

/* ── FABs ───────────────────────────────────────────────────── */
.fab-cart {
  position: fixed; bottom: 24px; right: 18px; z-index: 150;
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--mt-navy);
  color: #fff; box-shadow: var(--shadow-md);
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s, box-shadow .2s, background .2s;
}
.fab-cart:hover  { transform: scale(1.06); background: var(--mt-navy-dark); }
.fab-cart:active { transform: scale(.92); }

.fab-badge {
  position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px;
  background: var(--mt-lime);
  border-radius: 11px; color: var(--mt-navy-dark);
  font-size: 0.72rem; font-weight: 800; display: flex; align-items: center;
  justify-content: center; padding: 0 5px; border: 2px solid var(--surface);
  box-shadow: var(--shadow-sm);
}

.fab-wa {
  position: fixed; bottom: 24px; left: 18px; z-index: 150;
  width: 54px; height: 54px; border-radius: 50%;
  background: #25D366;
  color: #fff; box-shadow: var(--shadow-md);
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s;
  text-decoration: none;
}
.fab-wa:hover  { transform: scale(1.06); }
.fab-wa:active { transform: scale(.92); }
@media (max-width: 480px) {
  .fab-wa  { width: 50px; height: 50px; bottom: 18px; left: 14px; }
  .fab-wa svg { width: 24px; height: 24px; }
  .fab-cart { width: 56px; height: 56px; bottom: 18px; right: 14px; }
}

/* ── MODAIS (carrinho / checkout) ───────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(20,32,58,.45);
  display: flex; align-items: flex-end; justify-content: center;
}

.cart-modal {
  background: var(--surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%; max-width: 560px; max-height: 90vh; max-height: 90dvh;
  display: flex; flex-direction: column; overflow: hidden;
  animation: slide-up .28s ease;
  box-shadow: var(--shadow-lg);
}
.cart-modal-header {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.cart-modal-header h2 { flex: 1; font-size: 1.08rem; font-weight: 800; color: var(--text); }
.modal-close-btn, .back-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 1.2rem;
  color: var(--muted); display: flex; align-items: center; justify-content: center;
  transition: all .15s; flex-shrink: 0;
}
.modal-close-btn:hover, .back-btn:hover { background: var(--border); color: var(--text); }
.cart-modal-body   { flex: 1; overflow-y: auto; padding: 14px 18px; overscroll-behavior: contain; }
.cart-modal-footer {
  padding: 14px 18px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  background: var(--surface); flex-shrink: 0;
}

/* Itens do carrinho */
.cart-item-row {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.cart-item-row:last-child { border-bottom: none; }
.cart-item-thumb {
  width: 56px; height: 68px; border-radius: var(--radius-sm);
  object-fit: contain; background: #fff;
  border: 1px solid var(--border); flex-shrink: 0;
}
.cart-item-details        { flex: 1; min-width: 0; }
.cart-item-details strong { font-size: 0.86rem; color: var(--text); display: block; }
.cart-item-details small  { font-size: 0.75rem; color: var(--muted); }
.cart-item-price { font-size: 0.9rem; font-weight: 700; color: var(--mt-navy); margin-top: 4px; display: block; }
.cart-item-remove {
  background: var(--danger-bg); border: none; color: var(--danger);
  width: 30px; height: 30px; border-radius: 8px; font-size: 1.05rem;
  line-height: 1; cursor: pointer; transition: background .15s; flex-shrink: 0;
}
.cart-item-remove:hover { background: #F9D8D8; }

/* Stepper de quantidade na tela do carrinho */
.cart-qty-control { margin-top: 8px; max-width: 168px; }
.cart-qty-control .qty-btn { width: 38px; height: 38px; font-size: 1.25rem; }
.cart-qty-control .qty-input { height: 38px; font-size: 1.02rem; }
.cart-item-partial {
  margin-top: 6px; font-size: 0.72rem; font-weight: 600;
  color: var(--warning); background: var(--warning-bg);
  border: 1px solid #EBD3A8; border-radius: 8px; padding: 4px 8px;
  display: inline-block;
}

.cart-summary { margin-bottom: 12px; }
.cart-summary-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 0; font-size: 0.9rem; color: var(--muted);
}
.cart-summary-value { font-size: 1.02rem; color: var(--text); }
.cart-summary-value strong { color: var(--mt-navy); font-size: 1.25rem; }

/* Checkout */
.checkout-summary {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px; margin-bottom: 16px; font-size: 0.86rem;
  color: var(--text);
}
.checkout-form .form-group { margin-bottom: 16px; }
.checkout-form label { display: block; font-weight: 600; color: var(--text); margin-bottom: 6px; font-size: 0.84rem; }
.checkout-form .form-control {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--border-hi);
  border-radius: 10px; font-size: 0.95rem; color: var(--text);
  transition: border-color .18s, box-shadow .18s; font-family: var(--font);
  background: var(--surface);
}
.checkout-form .form-control:focus { outline: none; border-color: var(--mt-navy); box-shadow: 0 0 0 3px rgba(30,58,123,.12); }
.checkout-form textarea.form-control { resize: vertical; min-height: 80px; }

/* Alerts */
.alert { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 0.88rem; }
.alert-error   { background: var(--danger-bg);  color: var(--danger);  border: 1px solid #F5C2C2; }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid #BFE5CB; }

/* Spinner */
.btn-spinner {
  width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.35);
  border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── TOAST ──────────────────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 92px; left: 50%; transform: translateX(-50%);
  z-index: 500; display: flex; flex-direction: column; gap: 8px; align-items: center;
}
.toast {
  padding: 10px 20px; border-radius: 999px; font-size: 0.86rem; font-weight: 600;
  box-shadow: var(--shadow-md); animation: slide-up .25s ease;
  white-space: nowrap; max-width: 92vw; overflow: hidden; text-overflow: ellipsis;
}
.toast-success { background: var(--mt-lime); color: var(--mt-navy-dark); }
.toast-error   { background: var(--danger);  color: #fff; }
.toast-info    { background: var(--mt-navy); color: #fff; }

/* ── LOADING / EMPTY ────────────────────────────────────────── */
.loading-spinner {
  grid-column: 1 / -1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 60px; color: var(--faint);
}
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--mt-navy); border-radius: 50%;
  animation: spin .8s linear infinite; margin-bottom: 16px;
}
.empty-state {
  padding: 60px 24px; display: flex; flex-direction: column;
  align-items: center; gap: 12px; text-align: center;
}
.empty-state h3 { font-size: 1.1rem; color: var(--text); }
.empty-state p  { color: var(--muted); font-size: 0.9rem; }

/* ── TELA EXPIRADA / CONFIRMADA ─────────────────────────────── */
.confirmation-screen {
  position: fixed; inset: 0; z-index: 400;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; overflow-y: auto;
}
.confirmation-box { text-align: center; max-width: 400px; width: 100%; }
.confirmation-icon {
  width: 88px; height: 88px; border-radius: 50%;
  background: var(--mt-lime-soft);
  border: 2px solid var(--mt-lime);
  color: var(--mt-lime-text);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
}
.confirmation-box h2 { font-size: 1.55rem; color: var(--text); margin-bottom: 12px; }
.confirmation-box p  { color: var(--muted); margin-bottom: 8px; }
.confirmation-details {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-top: 20px;
  box-shadow: var(--shadow-sm);
}
.confirmed-row {
  display: flex; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem;
  color: var(--text);
}
.confirmed-row:last-child { border-bottom: none; }

.expired-card, .confirmed-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 44px 30px;
  max-width: 420px; width: 100%; text-align: center;
  box-shadow: var(--shadow-md); margin: 16px;
}
.confirmed-icon, .expired-icon {
  width: 96px; height: 96px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
}
.expired-icon   { color: var(--warning); background: var(--warning-bg); border: 2px solid #EBD3A8; }
.confirmed-icon { color: var(--mt-lime-text); background: var(--mt-lime-soft); border: 2px solid var(--mt-lime); }
.expired-card h1, .confirmed-card h1 { font-size: 1.5rem; margin-bottom: 12px; color: var(--text); }
.expired-card p, .confirmed-card p { color: var(--muted); margin-bottom: 8px; }
.confirmed-details { margin-top: 20px; }

/* ── RELATÓRIO / HISTÓRICO ──────────────────────────────────── */
.rel-body { background: var(--bg); min-height: 100vh; }

.rel-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; box-shadow: 0 2px 10px rgba(21,44,97,.05);
}
.rel-back-btn {
  color: var(--muted); display: flex; align-items: center; flex-shrink: 0;
  background: none; border: none; cursor: pointer; padding: 4px;
  text-decoration: none; transition: color .15s;
}
.rel-back-btn:hover { color: var(--mt-navy); }
.rel-header-info { flex: 1; min-width: 0; }
.rel-title    { display: block; color: var(--text); font-size: 0.9rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rel-subtitle { display: block; color: var(--muted); font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.rel-save-fab {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); color: var(--mt-navy);
  border: 1.5px solid var(--border-hi); border-radius: var(--radius-sm);
  padding: 7px 13px; font-size: 0.8rem; font-weight: 700;
  cursor: pointer; flex-shrink: 0; transition: all .15s;
}
.rel-save-fab:hover { border-color: var(--mt-navy); background: var(--mt-navy-soft); }
.rel-save-fab.rel-save-dirty {
  background: var(--mt-lime);
  border-color: var(--mt-lime-dark);
  color: var(--mt-navy-dark);
  animation: pulse-opacity 1.4s infinite;
}

/* Stats bar */
.rel-stats {
  display: flex; gap: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.rel-stat {
  flex: 1; text-align: center; padding: 12px 4px;
  border-right: 1px solid var(--border);
}
.rel-stat:last-child { border-right: none; }
.rel-stat-val { display: block; font-size: 1.05rem; font-weight: 800; color: var(--mt-navy); }
.rel-stat-lbl { display: block; font-size: 0.68rem; color: var(--faint); text-transform: uppercase; letter-spacing: 0.4px; }

/* Filter chips bar */
.rel-filter-bar {
  display: flex; gap: 6px; overflow-x: auto; padding: 10px 14px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}
.rel-filter-bar::-webkit-scrollbar { display: none; }
.rel-chip { flex-shrink: 0; }

/* Table */
.rel-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.rel-table {
  width: 100%; border-collapse: collapse; font-size: 0.82rem;
  background: var(--surface);
}
.rel-table th {
  background: var(--surface-2); color: var(--muted);
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; padding: 8px 10px; text-align: left;
  border-bottom: 1.5px solid var(--border-hi); white-space: nowrap;
  position: sticky; top: 57px; z-index: 10;
}
.rel-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text); }
.rel-row:nth-child(even) td { background: var(--surface-2); }
.rel-row:hover td { background: var(--mt-navy-soft); }

.rel-th-prod   { min-width: 160px; }
.rel-th-qty    { min-width: 70px; }
.rel-th-rev    { min-width: 90px; }
.rel-th-pareto { min-width: 70px; }
.rel-th-cart   { min-width: 120px; }
.rel-td-num    { white-space: nowrap; color: var(--text); font-variant-numeric: tabular-nums; }
.rel-td-pareto { white-space: nowrap; }
.rel-td-prod   { display: flex; align-items: center; gap: 8px; }
.rel-thumb     { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); flex-shrink: 0; background: #fff; }
.rel-prod-info { display: flex; flex-direction: column; min-width: 0; }
.rel-prod-desc { font-weight: 600; color: var(--text); font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.rel-prod-meta { color: var(--faint); font-size: 0.7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }

.rel-qty-ctrl { display: flex; align-items: center; gap: 4px; }
.rel-qty-ctrl .qty-btn { width: 34px; height: 34px; font-size: 1.1rem; }
.rel-qty-input {
  width: 50px; height: 34px; text-align: center;
  border: 1.5px solid var(--border-hi); border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 600; color: var(--text);
  background: var(--surface); transition: border-color .2s;
}
.rel-qty-input:focus { border-color: var(--mt-navy); outline: none; box-shadow: 0 0 0 2px rgba(30,58,123,.12); }

/* Toast relat */
.rel-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-hi);
  padding: 12px 20px; border-radius: var(--radius-sm);
  font-size: 0.85rem; font-weight: 500;
  box-shadow: var(--shadow-md);
  z-index: 9999; max-width: calc(100vw - 32px);
  text-align: center; white-space: pre-wrap; word-break: break-word;
}
.rel-toast-success { background: var(--mt-lime); border-color: var(--mt-lime-dark); color: var(--mt-navy-dark); }
.rel-toast-error   { background: var(--danger);  border-color: var(--danger); color: #fff; }

/* ── Pareto summary ─────────────────────────────────────────── */
.rel-pareto-summary {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem; color: var(--muted);
}
.rel-pareto-label { font-weight: 600; flex-shrink: 0; color: var(--muted); }

/* ── Photo modal (zoom com pinça / duplo toque) ─────────────── */
.photo-modal {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(10,18,34,.96);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  animation: fade-in .18s ease;
}
.photo-modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.14);
  color: #fff; font-size: 1.5rem; line-height: 1; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 2; transition: background .15s;
}
.photo-modal-close:hover { background: rgba(255,255,255,.28); }
.photo-modal-download {
  position: absolute; top: 14px; right: 68px;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.14);
  color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 2; transition: background .15s;
}
.photo-modal-download:hover { background: rgba(255,255,255,.28); }
.photo-modal-download:active { transform: scale(.92); }
.photo-modal-download.is-loading { opacity: .6; pointer-events: none; }
.pz-stage {
  flex: 1; width: 100%;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; touch-action: none;
}
.photo-modal-img {
  max-width: 94vw; max-height: 78vh; object-fit: contain;
  border-radius: var(--radius-sm);
  transform-origin: center center;
  will-change: transform;
  user-select: none; -webkit-user-drag: none;
  cursor: zoom-in;
}
.photo-modal-caption {
  color: rgba(255,255,255,.85); font-size: 0.85rem;
  padding: 4px 16px 2px; text-align: center; max-width: 90vw;
}
.photo-modal-hint {
  color: rgba(255,255,255,.5); font-size: 0.7rem;
  padding: 0 16px calc(14px + env(safe-area-inset-bottom, 0px)); text-align: center;
}

/* ── Botão de ajuda (?) no header ───────────────────────────── */
.btn-help {
  width: 34px; height: 34px; flex-shrink: 0;
  border-radius: 50%;
  background: var(--mt-lime);
  color: var(--mt-navy-dark);
  font-size: 1.05rem; font-weight: 800; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: transform .15s, background .15s;
  min-height: 34px;
}
.btn-help:hover  { background: var(--mt-lime-dark); color: #fff; }
.btn-help:active { transform: scale(.92); }

/* Lista de vídeos de ajuda */
.help-list { padding: 6px 0 10px; }
.help-video-row {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; text-align: left;
  border-bottom: 1px solid var(--surface-2);
  transition: background .12s;
}
.help-video-row:hover { background: var(--surface-2); }
.help-thumb {
  position: relative; flex-shrink: 0;
  width: 104px; height: 60px; border-radius: 9px; overflow: hidden;
  background: var(--mt-navy-soft); border: 1px solid var(--border);
}
.help-thumb img { width: 100%; height: 100%; object-fit: cover; }
.help-play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(21,44,97,.35); color: #fff;
}
.help-play svg { filter: drop-shadow(0 1px 3px rgba(0,0,0,.4)); }
.help-video-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.help-video-info strong { font-size: 0.9rem; color: var(--text); line-height: 1.3; }
.help-video-info small  { font-size: 0.76rem; color: var(--muted); line-height: 1.35; }

/* Player de vídeo (YouTube embed) */
.video-modal {
  position: fixed; inset: 0; z-index: 9100;
  background: rgba(10,18,34,.96);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  animation: fade-in .18s ease; padding: 16px;
}
.video-modal-box { width: 100%; max-width: 760px; }
.video-frame {
  width: 100%; aspect-ratio: 16 / 9;
  background: #000; border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-lg);
}
.video-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.video-title { color: rgba(255,255,255,.9); font-size: 0.92rem; font-weight: 600; text-align: center; padding: 12px 8px 0; }

/* ── Limpar carrinho ────────────────────────────────────────── */
.btn-clear-cart {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 11px; min-height: 34px;
  border: 1.5px solid #F5C2C2; border-radius: 8px;
  background: var(--surface); color: var(--danger);
  font-size: 0.76rem; font-weight: 700;
  transition: background .15s;
}
.btn-clear-cart:hover { background: var(--danger-bg); }

.btn-danger {
  background: var(--danger); color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-danger:hover { background: #B91C1C; }

.cart-clear-confirm {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
  padding: 10px 18px;
  background: var(--danger-bg);
  border-bottom: 1px solid #F5C2C2;
  font-size: 0.84rem; color: #7F1D1D;
  animation: slide-down .18s ease;
}
.cart-clear-confirm-actions { display: flex; gap: 8px; }

/* ── Sugestões na ficha do produto (related/upsell/crosssell) ─ */
.relp-tabs { display: flex; gap: 6px; flex-wrap: nowrap; margin-bottom: 10px; overflow-x: auto; scrollbar-width: none; }
.relp-tabs::-webkit-scrollbar { display: none; }
.relp-tab {
  padding: 7px 13px; min-height: 34px;
  border-radius: 999px; font-size: 0.78rem; font-weight: 700;
  border: 1.5px solid var(--border-hi); color: var(--muted);
  background: var(--surface); transition: all .15s;
}
.relp-tab.active { background: var(--mt-navy); border-color: var(--mt-navy); color: #fff; }

.relp-strip {
  display: none; gap: 10px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding: 2px 2px 12px; scrollbar-width: none;
  scroll-snap-type: x mandatory;
}
.relp-strip::-webkit-scrollbar { display: none; }
.relp-strip.active { display: flex; }

.relp-card {
  position: relative; flex: 0 0 calc((100% - 10px) / 2); width: calc((100% - 10px) / 2);
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px; overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer; scroll-snap-align: start;
  transition: border-color .15s, box-shadow .15s;
}
.relp-card:hover { border-color: var(--border-hi); box-shadow: var(--shadow); }
@media (min-width: 640px) {
  /* Acima de 640px a ficha do produto vira um modal largo (não mais uma
     folha deslizando de baixo pra cima só com scroll horizontal) — sem
     indicador de scroll visível, o 3º card e os seguintes ficavam cortados
     na borda. Em telas largas, deixa quebrar em grid em vez de rolar. */
  .relp-strip.active { display: flex; flex-wrap: nowrap; overflow-x: auto; }
  .relp-card { flex: 0 0 180px; width: 180px; }
}
.relp-card.relp-out { opacity: .6; }
.relp-thumb {
  display: block; width: 100%; height: 104px;
  background: #fff; border-bottom: 1px solid var(--border);
}
.relp-thumb img { width: 100%; height: 100%; object-fit: contain; }
.relp-noimg { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 1.6rem; color: var(--faint); }
.relp-code  { font-size: 0.6rem; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .4px; padding: 6px 8px 0; }
.relp-desc  {
  font-size: 0.72rem; font-weight: 600; color: var(--text); line-height: 1.3;
  padding: 1px 8px 0; min-height: 2.6em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.relp-attrs { font-size: 0.66rem; color: var(--muted); padding: 1px 8px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.relp-history { margin: 5px 8px 0; padding: 3px 6px; border-radius: 999px; font-size: 0.62rem; font-weight: 800; line-height: 1.1; text-align: center; }
.relp-history-bought { background: var(--success-bg); color: var(--success); }
.relp-history-new { background: var(--mt-navy-soft); color: var(--mt-navy); }
.relp-price { font-size: 0.84rem; font-weight: 800; color: var(--mt-navy); padding: 5px 8px 4px; }
.relp-qty { display: grid; grid-template-columns: 30px 1fr 30px; gap: 4px; padding: 0 8px 8px; }
.relp-qty-btn { min-height: 30px; width: 30px; border-radius: 8px; background: var(--mt-lime); color: var(--mt-navy-dark); font-size: 1rem; font-weight: 900; display: flex; align-items: center; justify-content: center; }
.relp-qty-btn:hover { background: var(--mt-lime-dark); color: #fff; }
.relp-qty-input { min-width: 0; height: 30px; border: 1px solid var(--border-hi); border-radius: 8px; text-align: center; font-size: .82rem; font-weight: 800; color: var(--text); background: var(--surface); }
.ps-back-product { width: 100%; justify-content: center; margin: 0 0 10px; min-height: 38px; border-radius: 10px; background: var(--mt-navy-soft); color: var(--mt-navy); font-weight: 800; }
.ps-back-product:hover { background: var(--mt-navy); color: #fff; }

/* ── Animações ──────────────────────────────────────────────── */
@keyframes slide-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slide-down {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pulse-opacity {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.65; }
}

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

/* Menu hierárquico de temas: compacto estilo e-commerce */
.theme-rail {
  position: relative;
  margin: 0 0 8px;
  padding: 0;
  border: 1px solid rgba(30,58,123,.12);
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(30,58,123,.07);
  z-index: 4;
}
.theme-rail-title {
  display: block;
  padding: 7px 10px 5px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.theme-rail-scroll {
  display: flex;
  gap: 0;
  overflow-x: auto;
  padding: 0;
  background: var(--mt-navy);
  border-radius: 0 0 12px 12px;
  scrollbar-width: none;
}
.theme-rail-scroll::-webkit-scrollbar { display: none; }
.theme-chip {
  flex: 0 0 auto;
  min-width: auto;
  max-width: none;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  border: 0;
  border-right: 1px solid rgba(255,255,255,.16);
  border-radius: 0;
  background: transparent;
  color: #fff;
  box-shadow: none;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .01em;
}
.theme-chip::after { content: '▾'; color: var(--mt-lime); font-size: .64rem; }
.theme-chip span { overflow: visible; text-overflow: clip; white-space: nowrap; font-size: inherit; font-weight: inherit; }
.theme-chip small { display: none; }
.theme-chip.active,
.theme-chip:active {
  border-color: transparent;
  background: #fff;
  color: var(--mt-navy);
}
.theme-submenu {
  position: absolute;
  left: 0;
  top: calc(100% - 1px);
  width: min(290px, 88vw);
  max-height: 310px;
  overflow: auto;
  margin: 0;
  padding: 6px 0;
  border: 1px solid rgba(30,58,123,.14);
  border-top: 0;
  border-radius: 0 0 13px 13px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(30,58,123,.20);
}
.theme-subtitle {
  display: block;
  padding: 7px 14px 6px;
  color: var(--mt-navy);
  background: #F8FBFF;
  border-bottom: 1px solid var(--border);
  font-size: .74rem;
  font-weight: 900;
}
.theme-subchips { display: grid; gap: 0; overflow: visible; }
.theme-subchip {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid #EEF3FA;
  background: #fff;
  color: var(--text);
  text-align: left;
  font-size: .82rem;
  font-weight: 750;
}
.theme-subchip:hover,
.theme-subchip.active,
.theme-subchip:active { background: #F6FBEA; color: var(--mt-navy); }
.theme-subchip small {
  min-width: 22px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--mt-navy-soft);
  color: var(--mt-navy);
  font-size: .67rem;
  font-weight: 900;
}
.date-filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.date-filter-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
}
.date-filter-grid input {
  width: 100%;
  height: 40px;
  border: 1.5px solid var(--border-hi);
  border-radius: 10px;
  padding: 0 10px;
  color: var(--text);
  background: var(--surface);
  font: inherit;
}
.filter-help {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: .75rem;
  line-height: 1.35;
}
.days-filter-label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.35;
}
.days-filter-label input {
  height: 40px;
  border: 1.5px solid var(--border-hi);
  border-radius: 10px;
  padding: 0 10px;
  color: var(--text);
  background: var(--surface);
  font: inherit;
}

/* Árvore de temas no filtro mobile */
.theme-filter-tree {
  display: grid;
  gap: 8px;
}
.theme-filter-node {
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  overflow: hidden;
}
.theme-filter-head {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 11px 12px;
  background: linear-gradient(135deg, #fff 0%, #F5FAEF 100%);
  color: var(--mt-navy);
  text-align: left;
  font-weight: 900;
}
.theme-filter-head small {
  min-width: 54px;
  text-align: center;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--mt-navy-soft);
  color: var(--mt-navy);
  font-size: .68rem;
  font-weight: 900;
}
.theme-filter-head b { transition: transform .18s ease; color: var(--muted); }
.theme-filter-node.open .theme-filter-head b { transform: rotate(180deg); }
.theme-filter-children { display: none; padding: 4px 10px 10px; }
.theme-filter-node.open .theme-filter-children { display: block; }
.theme-filter-all { background: #F8FBFF; border-radius: 10px; padding-left: 8px; padding-right: 8px; }
.theme-filter-sub { padding-left: 8px; padding-right: 8px; }

/* ── PROMOÇÃO ESCALONADA (ex.: Renova Estoque Gemar) ─────────── */
.promo-banners { padding: 6px 10px 0; display: grid; gap: 6px; }
.promo-banners:empty { display: none; }
.promo-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden;
}
.promo-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--mt-navy); color: #fff; padding: 6px 12px;
}
.promo-badge {
  background: #F5B800; color: var(--mt-navy-dark); font-weight: 800;
  font-size: .72rem; letter-spacing: .04em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 6px;
}
.promo-title { font-weight: 800; font-size: 1rem; flex: 1 1 auto; min-width: 140px; }
.promo-until { font-size: .74rem; opacity: .85; white-space: nowrap; }
.promo-body { padding: 12px 14px 14px; }
.promo-desc { font-size: .84rem; color: var(--muted); margin: 0 0 12px; }
.promo-status { font-size: .9rem; color: var(--text); margin: 0 0 10px; line-height: 1.4; }
.promo-status strong { color: var(--mt-navy); }
.promo-status .promo-ok { color: var(--mt-lime-text); font-weight: 800; }
.promo-track {
  position: relative; height: 10px; border-radius: 999px;
  background: var(--mt-navy-soft); margin: 4px 0 30px;
}
.promo-fill {
  height: 100%; border-radius: 999px; width: 0;
  background: linear-gradient(90deg, var(--mt-lime-dark), var(--mt-lime));
  transition: width .3s ease;
}
.promo-mark {
  position: absolute; top: 14px; transform: translateX(-50%);
  font-size: .66rem; line-height: 1.15; text-align: center; color: var(--muted);
  white-space: nowrap;
}
.promo-mark::before {
  content: ''; position: absolute; left: 50%; top: -14px; width: 2px; height: 10px;
  background: var(--border-hi); transform: translateX(-50%);
}
.promo-mark b { display: block; color: var(--mt-navy); font-size: .74rem; }
.promo-mark.reached b { color: var(--mt-lime-text); }
.promo-mark:first-of-type { transform: translateX(-20%); }
.promo-mark:last-of-type  { transform: translateX(-90%); }
.promo-toggle {
  background: none; border: 0; padding: 0; color: var(--mt-navy);
  font-weight: 700; font-size: .8rem; cursor: pointer; text-decoration: underline;
}
.promo-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: .82rem; display: none; }
.promo-table.open { display: table; }
.promo-table th {
  background: var(--mt-navy); color: #fff; padding: 7px 8px; text-align: center; font-size: .74rem;
}
.promo-table td { padding: 7px 8px; border-bottom: 1px solid var(--border); text-align: center; }
.promo-table tr.current td { background: var(--mt-lime-soft); font-weight: 800; color: var(--mt-lime-text); }
.cart-promo-summary {
  background: var(--mt-lime-soft); border: 1px solid #DCEBB0; color: var(--mt-lime-text);
  border-radius: var(--radius-sm); padding: 8px 10px; margin: 6px 0; font-size: .82rem; font-weight: 700;
}
.cart-promo-summary small { display: block; font-weight: 600; color: var(--muted); }
.checkout-promo {
  margin-top: 10px; padding: 10px 12px; border-radius: 10px;
  background: var(--mt-lime-soft); border: 1px solid #DCEBB0; color: var(--text);
}
.checkout-promo strong { color: var(--mt-lime-text); }

/* ── RECADO DO VENDEDOR (link com produtos escolhidos) ───────── */
.suggest-note {
  margin: 10px 10px 0; padding: 10px 14px; border-radius: var(--radius);
  background: var(--mt-lime-soft); border: 1px solid #DCEBB0; color: var(--text);
  font-size: .88rem; line-height: 1.4;
}
.suggest-note strong { display: block; color: var(--mt-navy); margin-bottom: 2px; }
.promo-stock-note { color: var(--muted); font-size: .74rem; }

/* ── ORDENAÇÃO EM ATÉ 3 NÍVEIS ────────────────────────────────── */
.sort-panel { padding: 14px 16px 18px; }
.sort-sec { font-size: .74rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 4px 0 10px; }
.sort-sec small { text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--faint); margin-left: 4px; }

.sort-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.sort-preset {
  padding: 9px 14px; border-radius: 999px; font-size: .86rem; font-weight: 700;
  color: var(--mt-navy); background: var(--mt-navy-soft); border: 1.5px solid transparent;
  transition: background .15s, border-color .15s;
}
.sort-preset:active { background: #dbe3f3; border-color: var(--mt-navy); }

.sort-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.sort-slot {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  min-height: 62px; padding: 9px 10px; border-radius: 12px;
  border: 1.5px dashed var(--border-hi); background: var(--surface-2); color: var(--faint);
  font-size: .8rem; line-height: 1.2;
}
.sort-slot b {
  width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: .75rem; background: var(--border); color: var(--muted);
}
.sort-slot.is-filled { border: 1.5px solid var(--mt-navy); background: var(--mt-navy-soft); color: var(--mt-navy); font-weight: 700; }
.sort-slot.is-filled b { background: var(--mt-navy); color: #fff; }
.sort-slot-x {
  position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%;
  font-size: 1.1rem; line-height: 1; color: var(--muted); background: rgba(255,255,255,.85);
}
.sort-slot-x[hidden] { display: none; }

.sort-group { margin-bottom: 14px; }
.sort-group-title { font-size: .8rem; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.sort-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sort-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 13px; border-radius: 999px;
  font-size: .86rem; font-weight: 600; color: var(--text); background: var(--surface);
  border: 1.5px solid var(--border-hi); transition: all .15s; -webkit-tap-highlight-color: transparent;
}
.sort-chip i {
  display: none; width: 20px; height: 20px; border-radius: 50%; align-items: center; justify-content: center;
  font-style: normal; font-size: .72rem; font-weight: 800; background: var(--mt-lime); color: #1F3300;
}
.sort-chip.is-on { background: var(--mt-navy); border-color: var(--mt-navy); color: #fff; }
.sort-chip.is-on i { display: inline-flex; }
@media (max-width: 330px) { .sort-slots { grid-template-columns: 1fr; } .sort-slot { min-height: 0; flex-direction: row; align-items: center; } }
#sortSheet .sheet-footer .btn { flex: 1; }
#sortLabel { max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }

/* ── ASSISTENTE (ROBÔ) ────────────────────────────────────────── */
.tb-assist { position: relative; color: var(--mt-navy); }
.tb-assist svg { color: var(--mt-navy); }
.tb-assist.has-tips { border-color: var(--mt-lime-dark); background: var(--mt-lime-soft); }
.tb-assist.has-tips svg { animation: assist-wiggle 5s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes assist-wiggle { 0%, 88%, 100% { transform: rotate(0); } 91% { transform: rotate(-9deg); } 94% { transform: rotate(9deg); } 97% { transform: rotate(-5deg); } }
@media (prefers-reduced-motion: reduce) { .tb-assist.has-tips svg { animation: none; } }
.assist-badge {
  min-width: 20px; height: 20px; padding: 0 5px; margin-left: 2px;
  background: var(--mt-lime); color: var(--mt-navy-dark); border-radius: 10px;
  font-size: .7rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center;
}
.assist-badge[hidden] { display: none; }

/* Faixa com a dica da vez (rola junto com a página, não cobre os produtos) */
.assist-strip {
  display: flex; align-items: center; gap: 8px; margin: 10px 10px 0; padding: 7px 8px 7px 10px;
  background: var(--mt-lime-soft); border: 1px solid #DCEBB0; border-radius: 12px; color: var(--text);
}
.assist-strip[hidden] { display: none; }
.assist-strip-ico { display: inline-flex; color: var(--mt-navy); flex-shrink: 0; }
.assist-strip-text { flex: 1; min-width: 0; font-size: .84rem; font-weight: 600; line-height: 1.25; }
.assist-strip-text.fade { animation: assist-fade .5s ease; }
@keyframes assist-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.assist-strip-go {
  flex-shrink: 0; padding: 6px 14px; border-radius: 999px; font-size: .8rem; font-weight: 800;
  background: var(--mt-navy); color: #fff;
}
.assist-strip-x { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; font-size: 1.1rem; color: var(--muted); background: transparent; }
.assist-whybox { margin: 4px 12px 18px; padding: 12px; border: 1.5px dashed var(--border-hi); border-radius: 12px; background: var(--surface-2); font-size: .8rem; }
.assist-whybox strong { display: block; margin-bottom: 8px; color: var(--muted); text-transform: uppercase; font-size: .7rem; letter-spacing: .05em; }
.assist-whybox div { padding: 6px 0; border-top: 1px solid var(--border); }
.assist-whybox b { display: block; color: var(--text); }
.assist-whybox small { color: var(--muted); line-height: 1.35; display: block; }
.assist-intro { margin: 12px 16px 6px; font-size: .84rem; color: var(--muted); }
.assist-desc { margin: 12px 16px 4px; font-size: .84rem; color: var(--muted); line-height: 1.4; }
.assist-desc:empty { display: none; }
.assist-list { padding: 4px 12px 16px; display: grid; gap: 8px; }
.assist-card {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px;
  border: 1.5px solid var(--border); border-radius: 14px; background: var(--surface); transition: border-color .15s, background .15s;
}
.assist-card:active { background: var(--mt-navy-soft); border-color: var(--mt-navy); }
.assist-ico { flex: 0 0 42px; height: 42px; border-radius: 12px; background: var(--mt-navy-soft); display: flex; align-items: center; justify-content: center; font-size: 1.35rem; }
.assist-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.assist-txt strong { font-size: .95rem; color: var(--text); }
.assist-txt small { font-size: .78rem; color: var(--muted); line-height: 1.3; }
.assist-go { font-size: 1.5rem; color: var(--faint); }
.assist-empty { padding: 20px 16px; color: var(--muted); font-size: .9rem; }

.assist-line { display: grid; grid-template-columns: auto 46px 1fr; gap: 8px 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.assist-line.off { opacity: .45; }
.assist-chk input { width: 20px; height: 20px; accent-color: var(--mt-navy); }
.assist-th { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; background: var(--surface-2); display: block; }
.assist-lmain { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.assist-lmain strong { font-size: .82rem; line-height: 1.25; color: var(--text); }
.assist-lmain small { font-size: .72rem; color: var(--muted); }
.assist-lmain em { font-style: normal; font-size: .72rem; color: var(--mt-lime-text); font-weight: 700; }
.assist-lmain em.assist-note { color: var(--warning); }
.assist-lright { grid-column: 2 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.assist-qty { display: inline-flex; align-items: center; border: 1.5px solid var(--border-hi); border-radius: 10px; overflow: hidden; }
.assist-qty button { width: 36px; height: 34px; font-size: 1.1rem; font-weight: 700; color: var(--mt-navy); background: var(--surface-2); }
.assist-qty input { width: 52px; height: 34px; text-align: center; border: 0; font-size: .95rem; font-weight: 700; -moz-appearance: textfield; }
.assist-qty input::-webkit-outer-spin-button, .assist-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.assist-lt { font-weight: 800; font-size: .92rem; color: var(--mt-navy); white-space: nowrap; }
.assist-foot { align-items: center; }
.assist-sum { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.assist-sum small { font-size: .72rem; color: var(--muted); }
.assist-sum strong { font-size: 1.05rem; color: var(--mt-navy); }
.assist-foot .btn { flex: 0 0 auto; }
.assist-foot .btn-primary { flex: 0 0 auto; padding-left: 18px; padding-right: 18px; }

/* ── PROMOÇÃO COMPACTA (recolhida por padrão; toque para abrir) ───── */
.promo-banners { padding: 8px 10px 0; gap: 8px; }
.promo-card { border-radius: 12px; }
.promo-head {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; flex-wrap: nowrap;
  background: var(--mt-navy); color: #fff; padding: 9px 12px; border: 0; cursor: pointer;
}
.promo-head .promo-badge { flex-shrink: 0; }
.promo-headtxt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.promo-headtxt b { font-size: .92rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.promo-headtxt small { font-size: .74rem; opacity: .92; line-height: 1.25; }
.promo-headtxt small b { display: inline; font-size: inherit; overflow: visible; }
.promo-chev { flex-shrink: 0; font-size: 1.1rem; transition: transform .2s; opacity: .9; }
.promo-card.is-open .promo-chev { transform: rotate(180deg); }
.promo-mini { height: 4px; background: var(--mt-navy-soft); }
.promo-mini .promo-fill { height: 100%; }
.promo-body[hidden] { display: none; }
.promo-until { margin: 0 0 6px; font-size: .74rem; color: var(--muted); font-weight: 700; }
@media (max-width: 560px) { .tb-assist .tb-label { display: none; } .tb-assist { padding-left: 10px; padding-right: 10px; } }

/* ── Barras compactas no celular: sobra mais tela para as fotos dos produtos ── */
.promo-banners { padding: 4px 10px 0; gap: 6px; }
.promo-head { padding: 4px 10px; gap: 8px; min-height: 30px; }
.promo-head .promo-badge { font-size: .62rem; padding: 2px 7px; }
.promo-name { flex: 1 1 auto; min-width: 0; font-size: .86rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.promo-short { flex: 0 0 auto; font-size: .76rem; font-weight: 700; white-space: nowrap; color: #F5D76E; }
.promo-mini { height: 3px; }
.assist-strip { margin: 6px 10px 0; padding: 3px 4px 3px 10px; gap: 8px; border-radius: 10px; }
.assist-strip-ico svg { width: 18px; height: 18px; }
.assist-strip-text { font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.assist-strip-go { padding: 4px 12px; font-size: .74rem; }
.assist-strip-x { width: 26px; height: 26px; font-size: 1rem; }@media (max-width: 420px) { .promo-head .promo-badge { display: none; } }

/* ── Recado do vendedor: uma linha; toque para ler completo. Com o AlfaBot ligado ele vira dica/recado dentro do robô ── */
.suggest-note {
  display: flex; align-items: center; gap: 8px; margin: 6px 10px 0; padding: 6px 10px; cursor: pointer;
  border-radius: 10px; font-size: .8rem; line-height: 1.3; -webkit-tap-highlight-color: transparent;
}
.suggest-note[data-assist] { display: none !important; }
.suggest-ico { flex-shrink: 0; font-size: 1rem; }
.suggest-line { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest-line b { color: var(--mt-navy); }
.suggest-chev { flex-shrink: 0; color: var(--muted); transition: transform .2s; }
.suggest-note.open .suggest-line { white-space: normal; overflow: visible; }
.suggest-note.open .suggest-chev { transform: rotate(180deg); }
.suggest-note.open { align-items: flex-start; }
.assist-note { margin: 12px 12px 4px; padding: 10px 12px; border-radius: 12px; background: var(--mt-lime-soft); border: 1px solid #DCEBB0; font-size: .86rem; line-height: 1.4; }
.assist-note b { display: block; color: var(--mt-navy); margin-bottom: 2px; }
.assist-title { display: flex; align-items: center; gap: 10px; }
.assist-title small { display: block; font-size: .72rem; font-weight: 600; color: var(--muted); }
.assist-title span { line-height: 1.15; }/* Com 4 abas em telas estreitas, tira os ícones das abas para os nomes caberem inteiros */
@media (max-width: 400px) { .cat-tab svg { display: none; } .cat-tab { padding-left: 6px; padding-right: 6px; font-size: .8rem; } }
@media (max-width: 400px) { .cat-tab { flex: 1 1 auto; min-width: 0; white-space: nowrap; } }

/* AlfaBot: paleta rosa/lilás combinando com o ícone */
.tb-assist.has-tips { border-color: #C4B5FD; background: #F5F0FF; }
.assist-strip { background: #F5F0FF; border-color: #DDD3FB; }
.assist-strip-ico svg { filter: drop-shadow(0 1px 1px rgba(109,79,214,.25)); }
.assist-lmain em.assist-qwhy { color: var(--muted); font-weight: 600; }

/* Galeria de fotos (várias fotos por cor/tamanho) */
.pg-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(15,23,42,.45); color: #fff; font-size: 20px; line-height: 1; cursor: pointer; padding: 0 0 2px; display: flex; align-items: center; justify-content: center; }
.pg-nav:hover { background: rgba(15,23,42,.7); }
.pg-prev { left: 6px; } .pg-next { right: 6px; }
.pg-count { position: absolute; left: 6px; bottom: 6px; z-index: 3; padding: 1px 7px; border-radius: 999px; background: rgba(15,23,42,.55); color: #fff; font-size: .68rem; font-weight: 700; }
/* Carrossel do card */
.product-img-wrap[data-fotos] { touch-action: pan-y; }
.pg-dots { position: absolute; left: 50%; bottom: 7px; transform: translateX(-50%); z-index: 3; display: flex; gap: 4px; padding: 3px 6px; border-radius: 999px; background: rgba(15,23,42,.4); pointer-events: none; }
.pg-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.55); transition: background .15s, transform .15s; }
.pg-dots i.on { background: #fff; transform: scale(1.25); }
.pg-fade { animation: pg-fade-in .22s ease; }
@keyframes pg-fade-in { from { opacity: .25; } to { opacity: 1; } }

/* Carrossel da ficha do produto */
.ps-photo-wrap.has-gallery { cursor: zoom-in; }
.ps-track { display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.ps-track::-webkit-scrollbar { display: none; }
.ps-slide { flex: 0 0 100%; min-width: 0; scroll-snap-align: center; scroll-snap-stop: always; }
.ps-slide .ps-photo { display: block; -webkit-user-drag: none; user-select: none; }
.ps-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 4; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); color: #1b2a41; font-size: 28px; line-height: 1; padding: 0 0 3px; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(15,23,42,.28); transition: transform .12s, background .12s; }
.ps-nav:hover { background: #fff; transform: translateY(-50%) scale(1.08); }
.ps-nav:active { transform: translateY(-50%) scale(.94); }
.ps-prev { left: 8px; } .ps-next { right: 8px; }
.ps-counter { position: absolute; right: 10px; top: 10px; z-index: 4; padding: 3px 9px; border-radius: 999px; background: rgba(15,23,42,.62); color: #fff; font-size: .72rem; font-weight: 700; pointer-events: none; }
.ps-photo-wrap.has-gallery .ps-badges { right: 64px; }
.ps-dots { display: flex; justify-content: center; gap: 6px; padding: 8px 0 0; }
.ps-dot { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 999px; background: #cbd5e1; cursor: pointer; transition: width .18s, background .18s; }
.ps-dot.on { width: 22px; background: var(--primary, #1f3a7b); }
.ps-thumbs { position: relative; display: flex; gap: 8px; padding: 10px 14px 4px; overflow-x: auto; scrollbar-width: none; }
.ps-thumbs::-webkit-scrollbar { display: none; }
.ps-thumb { width: 60px; height: 60px; object-fit: cover; border-radius: 10px; border: 2px solid transparent; cursor: pointer; flex: none; background: #fff; opacity: .6; transition: opacity .15s, border-color .15s, transform .15s; }
.ps-thumb:hover { opacity: .9; }
.ps-thumb.on { border-color: var(--primary, #1f3a7b); opacity: 1; transform: translateY(-1px); }
@media (hover: none) { .ps-nav { display: none; } }

/* Carrossel do zoom em tela cheia */
.pm-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255,255,255,.16); color: #fff; font-size: 32px; line-height: 1; padding: 0 0 4px; cursor: pointer; display: none; align-items: center; justify-content: center; transition: background .15s; }
.pm-nav:hover { background: rgba(255,255,255,.3); }
.pm-prev { left: 14px; } .pm-next { right: 14px; }
.photo-modal.pm-multi .pm-nav { display: flex; }
.pm-counter { position: absolute; top: 24px; left: 50%; transform: translateX(-50%); z-index: 2; color: rgba(255,255,255,.9); font-size: .85rem; font-weight: 700; letter-spacing: .5px; pointer-events: none; }
.pm-thumbs { display: none; gap: 8px; max-width: 94vw; overflow-x: auto; padding: 6px 4px 8px; scrollbar-width: none; position: relative; }
.pm-thumbs::-webkit-scrollbar { display: none; }
.photo-modal.pm-multi .pm-thumbs { display: flex; }
.pm-thumb { width: 58px; height: 58px; object-fit: cover; border-radius: 8px; border: 2px solid transparent; opacity: .55; cursor: pointer; flex: none; background: #fff; transition: opacity .15s, border-color .15s; }
.pm-thumb:hover { opacity: .85; }
.pm-thumb.on { border-color: #fff; opacity: 1; }
.photo-modal-img.pm-in-next { animation: pm-in-next .24s ease; }
.photo-modal-img.pm-in-prev { animation: pm-in-prev .24s ease; }
@keyframes pm-in-next { from { opacity: 0; margin-left: 40px; } to { opacity: 1; margin-left: 0; } }
@keyframes pm-in-prev { from { opacity: 0; margin-left: -40px; } to { opacity: 1; margin-left: 0; } }
@media (max-width: 600px) { .pm-nav { width: 40px; height: 40px; font-size: 26px; } .pm-prev { left: 6px; } .pm-next { right: 6px; } .pm-thumb { width: 48px; height: 48px; } }

/* Sem foto: placeholder legível (o selo fica por cima, sem texto embaixo) */
.product-img-placeholder, .ps-photo-placeholder { flex-direction: column; gap: 4px; }
.pip-ico { font-size: 2.2rem; opacity: .55; line-height: 1; }
.product-img-placeholder small, .ps-photo-placeholder small { font-size: .7rem; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--faint); }
.ps-slide .ps-photo-placeholder { position: relative; width: 100%; height: 42vh; min-height: 240px; }
.product-info .barcode-box { margin: 1px 0 3px; }
.product-info .barcode-row { padding: 3px 6px; }

/* AlfaBot: faixa fixa dentro do cabeçalho */
.cat-header .assist-strip { margin: 3px 0 4px; padding: 4px 8px 4px 10px; }

/* Logo da empresa (Admin → Aparência): imagem no lugar do balão padrão */
.cat-logo.has-img { background: transparent; box-shadow: none; padding: 0; overflow: hidden; }
.cat-logo.has-img img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* ── Exibição em grade: card do produto + grade de cores × tamanhos ── */
.grade-card { cursor: pointer; }
.grade-price { font-size: 1rem; }
.grade-cart { min-height: 0; font-size: .74rem; font-weight: 700; color: var(--mt-lime-text); background: var(--mt-lime-soft); border: 1px solid #DBEBB2; border-radius: var(--radius-sm); padding: 4px 8px; margin-bottom: 6px; }
.grade-cart:empty { display: none; }
.grade-open-btn { width: 100%; min-height: 40px; border: 0; border-radius: var(--radius-sm); background: var(--mt-navy); color: #fff; font-weight: 800; font-size: .85rem; cursor: pointer; transition: background .15s, transform .1s; }
.grade-open-btn:hover { background: var(--mt-navy-dark); }
.grade-open-btn:active { transform: scale(.98); }
/* Grade (bottom sheet): foto (só eixo=cor) + chips do eixo principal (quebram linha, nunca rolam
   de lado) + lista vertical do eixo secundário. Sem tabela: funciona igual com 2 cores ou 32. */
.gr-photo { background: #fff; border-bottom: 1px solid var(--border); }
.gr-photo .ps-photo { height: 30vh; min-height: 180px; }
.gr-photo:empty { display: none; }

.gr-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px 4px; }
.gr-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  padding: 6px 12px 6px 6px; border: 1.5px solid var(--border-hi); border-radius: 999px;
  background: var(--surface); color: var(--text); font-size: .82rem; font-weight: 700;
  cursor: pointer; position: relative; transition: border-color .15s, background .15s;
}
.gr-chip:not(.on) .gr-chip-thumb { opacity: .85; }
.gr-chip.on { border-color: var(--mt-navy); background: var(--mt-navy-soft); color: var(--mt-navy); }
.gr-chip.has-qty:not(.on) { border-color: var(--mt-lime-dark); }
.gr-chip.was-bought:not(.on) { background: var(--mt-navy-soft); }
.gr-chip-bought {
  flex-shrink: 0; width: 16px; height: 16px; border-radius: 50%;
  background: var(--mt-navy); color: #fff; font-size: .58rem; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
.gr-chip-thumb { width: 26px; height: 26px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: #fff; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: .85rem; }
.gr-chip-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gr-chip-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.gr-chip-badge {
  flex-shrink: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--mt-lime); color: #1F3300; font-size: .68rem; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}

.gr-rows-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 10px 14px 0; border-top: 1px solid var(--border); }
.gr-rows-title { font-weight: 800; font-size: .88rem; color: var(--text); }
.gr-fill { display: flex; gap: 6px; align-items: center; }
.gr-fill input { width: 64px; height: 32px; padding: 0 8px; border: 1px solid var(--border-hi); border-radius: 8px; text-align: center; font-weight: 700; background: #fff; color: var(--text); }
.gr-fill .btn { padding: 6px 10px; font-size: .74rem; white-space: nowrap; }

.gr-filter-box { padding: 8px 14px 0; }
.gr-filter-box input { width: 100%; height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); font-size: .85rem; }

.gr-rows { display: flex; flex-direction: column; padding: 8px 8px 4px; }
.gr-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 6px;
  border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.gr-row:last-child { border-bottom: 0; }
.gr-row.gr-has-qty { background: var(--mt-lime-soft); border-radius: var(--radius-sm); }
.gr-row.gr-row-target { animation: gr-row-pulse 1.1s ease 2; border-radius: var(--radius-sm); }
@keyframes gr-row-pulse { 0%, 100% { background: transparent; } 50% { background: var(--mt-navy-soft); } }
.gr-row.gr-hide { display: none; }
.gr-row-thumb { width: 40px; height: 40px; border-radius: 8px; overflow: hidden; flex-shrink: 0; background: #fff; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; }
.gr-row-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gr-row-noimg { color: var(--faint); font-size: 1rem; }
.gr-row-label { flex: 1; min-width: 64px; font-weight: 700; font-size: .88rem; color: var(--text); }
.gr-row-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: .74rem; font-weight: 700; }
.gr-out-lbl { color: var(--danger); }
.gr-ean-wrap { flex-basis: 100%; margin: 4px 0 0 50px; display: flex; flex-wrap: wrap; gap: 4px; }
.gr-ean-item { display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; background: #EFF6FF; border: 1px solid #BFDBFE; border-radius: 6px; }
.gr-ean-code { font-size: .66rem; font-weight: 700; color: #1D4ED8; font-variant-numeric: tabular-nums; }
.gr-ean-copy { width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center; border: none; background: transparent; color: #1D4ED8; padding: 0; }
.gr-hist-wrap { flex-basis: 100%; margin: 4px 0 0 50px; }
.gr-hist-wrap .history-pill { font-size: .68rem; padding: 5px 8px; }

/* Estilo "timeline": mini linha do tempo sempre visível (Admin → Aparência) */
.gr-tl-trigger { display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 8px; background: transparent; border: none; cursor: pointer; text-align: left; }
.gr-tl-total { font-size: .68rem; font-weight: 800; color: var(--mt-navy); white-space: nowrap; }
.gr-tl-track { flex: 1; display: flex; align-items: center; min-width: 24px; }
.gr-tl-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border-hi); flex-shrink: 0; }
.gr-tl-dot.on { width: 9px; height: 9px; background: var(--mt-navy); }
.gr-tl-line { flex: 1; height: 2px; background: var(--border); min-width: 8px; }
.gr-tl-labels { display: flex; justify-content: space-between; font-size: .6rem; color: var(--faint); padding: 0 8px; }

/* Estilo "badge": selo mínimo (Admin → Aparência) */
.gr-badge-trigger { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; background: var(--mt-lime-soft); border: 1px solid #DBEBB2; color: var(--mt-lime-text); font-size: .66rem; font-weight: 700; cursor: pointer; }
.gr-due { color: var(--warning); text-transform: uppercase; letter-spacing: .3px; font-size: .68rem; font-weight: 800; margin-left: 4px; }

.gr-step { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
.gr-step button { width: 32px; height: 32px; border: 0; border-radius: 8px; background: var(--mt-lime); color: #1F3300; font-weight: 800; font-size: 1.1rem; line-height: 1; cursor: pointer; }
.gr-step button.gr-minus { background: var(--border); color: var(--muted); }
.gr-step button.gr-minus.has-qty { background: var(--mt-navy-soft); color: var(--mt-navy); }
.gr-input { width: 46px; height: 32px; text-align: center; border: 1px solid var(--border-hi); border-radius: 8px; font-weight: 800; font-size: .9rem; background: #fff; color: var(--text); -moz-appearance: textfield; }
.gr-input::-webkit-outer-spin-button, .gr-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.gr-hint { margin: 10px 14px 2px; font-size: .72rem; color: var(--muted); }

/* Sugestões: uma linha só com setas ‹ › */
.relp-wrap { position: relative; }
.relp-nav { position: absolute; top: 40%; z-index: 3; width: 34px; height: 34px; border-radius: 50%; border: 2px solid #fff; background: var(--mt-navy, #1E3A7B); color: #fff; font-size: 1.3rem; font-weight: 900; line-height: 1; cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,.3); display: flex; align-items: center; justify-content: center; padding: 0 0 3px; }
.relp-nav.p { left: -6px; } .relp-nav.n { right: -6px; }


/* ---- Avisos da equipe (módulo "avisos"): cartão no topo do catálogo aberto. Cores só por variáveis do tema. ---- */
.cn-host { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); width: min(520px, calc(100vw - 20px)); z-index: 9200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.cn-card { pointer-events: auto; position: relative; background: var(--surface, #fff); color: var(--text, #1B2A41); border: 1px solid var(--border, #E3E8F0); border-left: 5px solid var(--cn-accent, var(--mt-navy, #1E3A7B)); border-radius: var(--radius, 12px); box-shadow: 0 10px 30px rgba(21, 44, 97, .24); padding: 12px 42px 12px 14px; animation: cn-in .28s ease-out; }
.cn-card.promo { --cn-accent: var(--mt-lime-dark, #7FA81F); }
.cn-card.alerta { --cn-accent: var(--warning, #C2740A); }
.cn-tt { font-weight: 800; font-size: .95rem; margin: 0 0 3px; }
.cn-tx { font-size: .9rem; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; }
.cn-act { display: inline-block; margin-top: 9px; padding: 8px 14px; border-radius: 999px; background: var(--mt-navy, #1E3A7B); color: #fff; font-weight: 800; font-size: .85rem; text-decoration: none; }
.cn-x { position: absolute; top: 5px; right: 6px; width: 32px; height: 32px; border: 0; background: transparent; font-size: 1.4rem; line-height: 1; color: var(--muted, #5B6B7F); cursor: pointer; border-radius: 50%; }
.cn-x:hover { background: var(--surface-2, #F8FAFC); }
@keyframes cn-in { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .cn-card { animation: none; } }

/* Aviso em alerta (precisa de OK) */
.cn-modal { position: fixed; inset: 0; z-index: 9300; background: rgba(15,23,42,.55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.cn-modal .cn-card { width: min(440px, 100%); padding: 18px 18px 16px; animation: none; }
.cn-modal .cn-tx { font-size: 1rem; }
.cn-ok { display: block; width: 100%; margin-top: 14px; padding: 12px; border: 0; border-radius: 10px; background: var(--mt-navy, #1E3A7B); color: #fff; font-weight: 800; font-size: 1rem; cursor: pointer; }
.cn-modal .cn-act { margin-right: 8px; }
