/* ============================================================
   Freecom Coml Util — catálogo de produtos
   Base visual: azul royal/cobalto, branco, preto e coral pontual.
   ============================================================ */

:root {
  --paper: #F7F8FC;
  --paper-deep: #EEF1FB;
  --card: #FFFFFF;
  --ink: #10131C;
  --ink-soft: #3F4655;
  --muted: #72798A;
  --line: #DDE2EF;
  --line-soft: #EDF0F6;
  --glass: #1B2CA8;
  --glass-deep: #071477;
  --amber: #9AA5BF;
  --amber-soft: #EEF1F7;
  --danger: #C24E5A;
  --promo: #da1c19;

  --font-display: 'Space Grotesk', 'Arial Narrow', sans-serif;
  --font-body: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Space Mono', 'SFMono-Regular', Consolas, monospace;

  --radius-card: 10px;
  --shadow-card: 0 2px 8px rgba(16, 19, 28, 0.06);
  --shadow-hover: 0 10px 24px rgba(16, 19, 28, 0.13);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--amber-soft); color: var(--ink); }

button, input, select { font-family: inherit; }

:focus-visible {
  outline: 2px solid var(--glass);
  outline-offset: 2px;
}

/* ---------- Header ---------- */

html { overflow-anchor: none; }

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 4px 18px rgba(7, 20, 119, 0.16);
}

.top :focus-visible { outline-color: #fff; }

.top-bar {
  background: radial-gradient(110% 170% at 88% -40%, #1B2CA8 0%, #0D1F95 38%, #071877 72%);
  border-bottom: 2px solid var(--amber);
  color: #fff;
}

.top-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 16px 28px 16px;
}

/* Bloco da marca: recolhe ao rolar a página */
.brand-collapse {
  display: grid;
  grid-template-rows: 1fr;
  margin-bottom: 16px;
  transition: grid-template-rows 0.3s ease, margin 0.3s ease;
}

.brand-row {
  min-height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 2px;
}

.top.is-compact .brand-collapse { grid-template-rows: 0fr; margin-bottom: 0; }
.top.is-compact .brand-row {
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.15s ease, visibility 0s 0.3s;
}

.brand-logo { display: block; flex: none; line-height: 0; border-radius: 6px; }
.brand-wordmark { display: block; height: 54px; width: auto; }

.brand {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-left: 20px;
  border-left: 1px solid rgba(255, 255, 255, 0.22);
}


.brand h1 {
  order: 2;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: #fff;
}

.brand .meta {
  order: 3;
  font-size: 12.5px;
  color: #ecefff;
  margin-top: 4px;
}

.brand-links { display: flex; gap: 10px; flex: none; }

.brand-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.brand-links a:hover { background: rgba(255, 255, 255, 0.13); border-color: rgba(255, 255, 255, 0.6); }

.brand-links svg {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Busca + botão de filtro + contador */
.controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 16px;
}

.counter {
  color: #B9C3FA;
  font-size: 14px;
  white-space: nowrap;
}

.counter strong {
  color: #fff;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
}

.search-wrap { position: relative; min-width: 0; }

.search-wrap svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  stroke: var(--glass);
  pointer-events: none;
}

#search {
  width: 100%;
  height: 48px;
  padding: 0 44px 0 46px;
  border: 0;
  border-radius: 12px;
  background: #fff;
  font-size: 16px;
  color: var(--ink);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.14);
  transition: box-shadow 0.15s ease;
}

#search::placeholder { color: var(--muted); }
#search:focus { outline: none; box-shadow: 0 0 0 3px rgba(154, 165, 191, 0.8); }

.clear-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: none;
}

.clear-btn.visible { display: block; }
.clear-btn:hover { color: var(--danger); }

/* ---------- Grid ---------- */

.grid-wrap {
  max-width: 1360px;
  margin: 0 auto;
  padding: 26px 28px 80px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 18px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(6px);
  animation: card-in 0.4s ease forwards;
}

@keyframes card-in {
  to { opacity: 1; transform: translateY(0); }
}

.card:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--glass);
}

.card:hover .thumb img { transform: scale(1.04); }

.thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #F1F3FA;
  overflow: hidden;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
  transition: transform 0.35s ease;
  display: block;
}

.thumb .sku-tag {
  position: absolute;
  top: 8px;
  left: 0;
  background: var(--glass-deep);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  padding: 3px 8px 3px 10px;
  border-radius: 0 3px 3px 0;
  z-index: 1;
}

.thumb .promo-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--promo);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: 0.02em;
  padding: 3px 8px;
  border-radius: 6px;
  z-index: 1;
}

.body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.categoria {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--glass);
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.desc {
  font-size: 13px;
  line-height: 1.35;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}

.row-bottom {
  margin-top: auto;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 8px;
}

.row-tags {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.box-qty,
.sub-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

.box-qty {
  color: var(--glass-deep);
  background: #E9EDFF;
}

.sub-tag {
  color: #3F4A66;
  background: var(--amber-soft);
}

/* ---------- Empty state ---------- */

.empty {
  display: none;
  text-align: center;
  padding: 90px 20px;
  color: var(--muted);
}

.empty.visible { display: block; }

.empty svg { width: 46px; height: 46px; stroke: var(--muted); margin-bottom: 14px; }

.empty h2 {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--ink-soft);
  margin: 0 0 6px;
  font-weight: 600;
}

.empty p { margin: 0; font-size: 14px; }

/* ---------- Sentinel / loader ---------- */

.sentinel {
  height: 1px;
}

.loading-more {
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  display: none;
}
.loading-more.visible { display: block; }

/* ---------- Modal ---------- */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(50, 50, 56, 0.808);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.overlay.visible { display: flex; }

.modal {
  background: var(--card);
  max-width: 780px;
  width: 100%;
  max-height: 88vh;
  overflow: auto;
  border-radius: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
}

@media (max-width: 640px) {
  .modal { grid-template-columns: 1fr; }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--glass-deep);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.modal-img {
  background: #F1F3FA;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  position: relative;
}

.modal-img img { max-width: 100%; max-height: 340px; object-fit: contain; }

.modal-img .promo-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--promo);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 3px;
}

.modal-info {
  padding: 30px 30px 30px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-sku {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--glass-deep);
  background: #E9EDFF;
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 3px;
}

.modal-breadcrumb {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
}

.modal-info h2 {
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.3;
  margin: 0;
  color: var(--ink);
  font-weight: 600;
}

.modal-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  border-top: 1px solid var(--line-soft);
  padding-top: 14px;
}

.fact-label {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 3px;
}

.fact-value {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
}

.fact-value.accent { color: var(--glass-deep); }

.copy-btn {
  margin-top: 4px;
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 2px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  font-family: var(--font-body);
}

.copy-btn:hover { background: var(--glass-deep); color: #fff; }
.copy-btn.copied { background: var(--glass); border-color: var(--glass); color: #fff; }

/* ---------- Responsive ---------- */

/* ================= Redesign: índice de subgrupos ================= */

.v-home .list-head, .v-home .promo-chip, .v-list .brand, .v-list #home, .v-home #list { display: none; }
.v-list .list-head, .v-list .promo-chip { display: flex; }
.v-list .brand-row { justify-content: space-between; }
.v-list .grid-wrap { padding-top: 22px; }

.list-head { align-items: center; gap: 12px; margin-bottom: 12px; }
.back-btn {
  flex: none; display: inline-flex; align-items: center; gap: 4px; height: 46px; padding: 0 18px 0 10px;
  border: 0; border-radius: 999px; background: #fff; color: var(--glass-deep);
  font: 700 15px var(--font-body); cursor: pointer; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.16);
}
.back-btn:active { transform: translateY(1px); box-shadow: none; }
.back-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.list-title { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.list-title h2 {
  margin: 0; font: 600 22px/1.15 var(--font-display); letter-spacing: -0.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.top .list-title .counter { display: block; height: auto; padding: 0; border: 0; font-size: 13.5px; color: #e4e8ff; }

.controls { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: none; }
.search-wrap { grid-area: auto; }
.promo-chip {
  align-items: center; gap: 8px; height: 48px; padding: 0 16px; border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px; color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; user-select: none;
}
.promo-chip input { width: 18px; height: 18px; margin: 0; accent-color: var(--amber); }
.promo-chip:has(input:checked) { background: var(--amber); border-color: var(--amber); }

.home-intro { margin: 10px 2px 20px; }
.home-intro h2 { display: inline-block; margin: 0; padding-bottom: 8px; font: 600 28px/1.1 var(--font-display); letter-spacing: -0.02em; color: var(--glass-deep); border-bottom: 3px solid var(--amber); }

.sub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.sub-card {
  display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 16px;
  background: #fff; color: var(--ink); text-decoration: none; -webkit-tap-highlight-color: transparent;
  box-shadow: 0 1px 2px rgba(16, 19, 28, 0.04), 0 10px 26px -14px rgba(7, 20, 119, 0.22);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.sub-card:hover { transform: translateY(-4px); border-color: #C5CDF2; box-shadow: 0 18px 38px -16px rgba(7, 20, 119, 0.4); }
.sub-card:active { transform: scale(0.98); }
.sub-card:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.sub-media {
  aspect-ratio: 1 / 0.8; display: grid; place-items: center; padding: 14px;
  background: radial-gradient(circle at 50% 35%, #fff 0%, #ECEFFC 100%);
}
.sub-media img { max-width: 100%; max-height: 100%; object-fit: contain; mix-blend-mode: multiply; transition: transform 0.35s ease; }
.sub-card:hover .sub-media img { transform: scale(1.07); }
/* Nome no topo (reserva 2 linhas) e contagem sempre na base: cards da mesma linha ficam alinhados */
.sub-info { flex: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; padding: 13px 14px 12px; border-top: 3px solid var(--amber); }
.sub-name { min-height: 2.4em; font: 600 15px/1.2 var(--font-display); letter-spacing: -0.005em; color: var(--glass-deep); overflow-wrap: anywhere; }
.sub-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sub-count { font-size: 12.5px; color: var(--muted); }
.sub-arrow {
  flex: none; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%;
  background: var(--glass-deep); color: #fff; transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.sub-card:hover .sub-arrow { background: var(--amber); color: var(--glass-deep); transform: translateX(3px); }
.sub-arrow svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

/* Botão de voltar mais discreto */
.back-btn { height: 30px; padding: 0 14px 0 8px; font-size: 14px; gap: 2px; }
.back-btn svg { width: 20px; height: 20px; }

@media (max-width: 720px) {
  .v-list .brand-collapse { margin-bottom: 10px; }
  .list-head { margin-bottom: 10px; }
  .list-title h2 { font-size: 18px; }
  .promo-chip { padding: 0 12px; }
  .v-list .grid-wrap { padding-top: 16px; }
  .home-intro { margin: 4px 2px 16px; }
  .home-intro h2 { font-size: 24px; }
  .sub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .sub-media { padding: 10px; aspect-ratio: 1 / 0.85; }
  .sub-info { padding: 11px 11px 11px; gap: 8px; }
  .sub-name { font-size: 14px; }
  .sub-arrow { width: 22px; height: 22px; }
  .sub-arrow svg { width: 12px; height: 12px; }
}

.v-home .controls { grid-template-columns: minmax(0, 1fr); }
.sub-media { position: relative; }
.sub-media img { position: absolute; inset: 14px; width: calc(100% - 28px); height: calc(100% - 28px); max-width: none; max-height: none; }
@media (max-width: 720px) { .sub-media img { inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); } }

.sub-media { overflow: hidden; }
.sub-media img.capa { inset: 0; width: 100%; height: 100%; object-fit: cover; mix-blend-mode: normal; }
.promo-chip:has(input:checked) { background: #fff; color: var(--glass-deep); border-color: #fff; }


/* ================= Acabamento final ================= */

.sub-media, .sub-media { aspect-ratio: 1 / 1; }
.sub-media { background: linear-gradient(110deg, #EEF1FB 30%, #F8F9FE 50%, #EEF1FB 70%); }
.sub-name { font-size: 15.5px; }

@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes shine { to { background-position: -200% 0; } }
.sub-card { animation: rise 0.5s ease backwards; animation-delay: calc(var(--i, 0) * 35ms); }
.sub-skel {
  aspect-ratio: 1 / 1.32; border-radius: 16px; border: 1px solid var(--line);
  background: linear-gradient(100deg, #EEF1FB 30%, #F8F9FE 50%, #EEF1FB 70%); background-size: 200% 100%;
  animation: shine 1.3s linear infinite;
}

@media (hover: none) {
  .sub-card:hover { transform: none; border-color: var(--line); box-shadow: 0 1px 2px rgba(16, 19, 28, 0.04), 0 10px 26px -14px rgba(7, 20, 119, 0.22); }
  .sub-card:hover .sub-media img, .card:hover .thumb img { transform: none; }
  .sub-card:hover .sub-arrow { background: var(--glass-deep); color: #fff; transform: none; }
  .card:hover { box-shadow: var(--shadow-card); border-color: var(--line); }
}

/* ---------- Rodapé ---------- */
.foot {
  margin-top: 28px;
  border-top: 1px solid var(--line);
  background: var(--glass-deep);
}

.foot-inner {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 28px 28px calc(24px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
}

.foot-logo {
  display: block;
  width: 110px;
  height: auto;
}

.foot-copy {
  margin: 0;
  color: var(--line);
  font-size: 12px;
  line-height: 1.5;
}

/* Voltar ao topo */
.to-top {
  position: fixed; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 35;
  width: 48px; height: 48px; display: grid; place-items: center; border: 0; border-radius: 50%;
  background: #fff; color: var(--glass-deep); border: 1px solid var(--line); cursor: pointer; box-shadow: 0 8px 22px rgba(7, 20, 119, 0.3);
  opacity: 0; visibility: hidden; transform: translateY(10px); transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s 0.2s;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; transition: opacity 0.2s ease, transform 0.2s ease; }
.to-top svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 720px) {
  .foot { margin-top: 20px; }
  .foot-inner { flex-wrap: wrap; padding: 22px 16px calc(84px + env(safe-area-inset-bottom, 0px)); gap: 14px 16px; }
  .foot-inner img { height: 38px; }
  .foot .brand-links { width: 100%; }
  .foot .brand-links a { flex: 1; justify-content: center; padding: 0 10px; font-size: 13px; }
  .sub-name { font-size: 14.5px; }
}
@media (prefers-reduced-motion: reduce) { .sub-card, .sub-skel { animation: none; } }

/* ============================================================
   RESPONSIVIDADE — layout atual
   ============================================================ */

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.top-inner,
.grid-wrap,
.foot-inner {
  width: 100%;
}

.controls,
.list-head,
.brand-row,
.sub-grid,
.grid,
.foot-inner {
  min-width: 0;
}

.search-wrap,
.list-title,
.brand,
.body,
.row-tags {
  min-width: 0;
}

@media (max-width: 720px) {
  .top-inner {
    padding: 12px 12px 14px;
  }

  .grid-wrap {
    padding: 14px 12px 52px;
  }

  /* Cabeçalho mobile real do projeto atual */
  .brand-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 10px 8px;
    padding: 0;
  }

  .brand-logo {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }

  .brand-wordmark {
    height: 40px;
    width: auto;
    max-width: 100%;
  }

  .brand-links {
    grid-column: 2;
    grid-row: 1;
    gap: 8px;
    min-width: 0;
  }

  .brand-links a {
    width: 42px;
    height: 42px;
    padding: 0;
    justify-content: center;
    border: 0;
    background: rgba(255, 255, 255, 0.14);
  }

  .brand-links a span {
    display: none;
  }

  .brand-links svg {
    width: 20px;
    height: 20px;
  }

  .brand {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    padding: 11px 0 0;
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(0, 1fr);
    grid-template-areas:
      "title title"
      "company meta";
    gap: 4px 0;
    align-items: baseline;
  }

  .brand h1 {
    grid-area: title;
    width: 100%;
    margin: 0;
    font-size: clamp(20px, 6vw, 23px);
    line-height: 1.15;
  }

  .brand .meta {
    grid-area: meta;
    min-width: 0;
    font-size: 12px;
    color: #ecefff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-left: 4px;
  }

  /* Lista: voltar + título + contador sem estourar a largura */
  .list-head {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
    margin-bottom: 10px;
  }

  .back-btn {
    flex: 0 0 auto;
    height: 30px;
    padding: 0 12px 0 7px;
    font-size: 13.5px;
  }

  .back-btn svg {
    width: 19px;
    height: 19px;
  }

  .list-title {
    flex: 1 1 auto;
    min-width: 0;
  }

  .list-title h2 {
    max-width: 100%;
    font-size: 18px;
  }

  .top .list-title .counter {
    font-size: 12px;
    white-space: nowrap;
  }

  /* Busca + promoção no layout que realmente existe no HTML atual */
  .controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "search promo";
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  .search-wrap {
    grid-area: search;
    min-width: 0;
  }

  #search {
    width: 100%;
    height: 46px;
    min-width: 0;
    padding-left: 44px;
    padding-right: 42px;
    font-size: 15px;
  }

  .promo-chip {
    grid-area: promo;
    min-width: 0;
    height: 46px;
    padding: 0 11px;
    gap: 7px;
    font-size: 13px;
  }

  .promo-chip input {
    width: 17px;
    height: 17px;
    flex: none;
  }

  /* No índice, não existe filtro de promoção: busca ocupa a linha inteira. */
  .v-home .controls {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "search";
  }

  .v-home .search-wrap {
    width: 100%;
  }

  /* Ao rolar, manter somente a busca em uma linha compacta. */
  .top.is-compact .top-inner {
    padding: 9px 12px;
  }

  .top.is-compact .controls {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "search promo";
    gap: 7px;
  }

  .top.is-compact .promo-chip {
    height: 42px;
  }

  .top.is-compact #search {
    height: 42px;
  }

  /* Produtos: duas colunas reais, sem largura mínima escondida */
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
  }

  .card {
    width: 100%;
    min-width: 0;
  }

  .thumb {
    width: 100%;
  }

  .thumb img {
    padding: 7px;
  }

  .thumb .sku-tag {
    top: 6px;
    font-size: 9px;
    padding: 3px 6px 3px 8px;
    max-width: 72%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .thumb .promo-tag {
    top: 30px;
    left: 0;
    right: auto;
    max-width: 70%;
    font-size: 8.5px;
    padding: 3px 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .body {
    min-width: 0;
    padding: 9px 9px 10px;
    gap: 5px;
  }

  .categoria {
    max-width: 100%;
    font-size: 9px;
  }

  .desc {
    min-width: 0;
    font-size: 11.5px;
    line-height: 1.35;
  }

  .row-bottom,
  .row-tags {
    min-width: 0;
    width: 100%;
  }

  .row-tags {
    justify-content: flex-end;
    gap: 4px;
  }

  .box-qty,
  .sub-tag {
    max-width: 100%;
    font-size: 9.5px;
    padding: 3px 6px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Índice de subgrupos */
  .home-intro {
    margin: 4px 2px 14px;
  }

  .home-intro h2 {
    font-size: 23px;
  }

  .sub-grid {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .sub-card {
    min-width: 0;
    width: 100%;
    border-radius: 13px;
  }

  .sub-media {
    width: 100%;
    aspect-ratio: 1 / 1;
    padding: 0;
  }

  .sub-media img.capa {
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .sub-info {
    min-width: 0;
    padding: 9px 9px 10px;
    gap: 7px;
  }

  .sub-name {
    min-width: 0;
    min-height: 2.4em;
    font-size: 13.5px;
    line-height: 1.2;
  }

  .sub-foot {
    min-width: 0;
  }

  .sub-count {
    min-width: 0;
    font-size: 11px;
    white-space: nowrap;
  }

  .sub-arrow {
    width: 21px;
    height: 21px;
  }

  /* Modal */
  .overlay {
    padding: 10px;
    align-items: center;
  }

  .modal {
    width: 100%;
    max-width: 100%;
    max-height: calc(100dvh - 20px);
    border-radius: 14px;
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .modal-img {
    min-height: 190px;
    max-height: 44dvh;
    padding: 24px;
  }

  .modal-img img {
    max-width: 100%;
    max-height: 38dvh;
  }

  .modal-info {
    padding: 20px 18px 22px;
    gap: 11px;
  }

  .modal-info h2 {
    font-size: 18px;
  }

  .modal-facts {
    gap: 10px;
  }

  .fact-value {
    font-size: 18px;
  }

  .copy-btn {
    width: 100%;
    min-height: 44px;
  }

}

@media (max-width: 720px) {
  .foot { margin-top: 20px; }

  .foot-inner {
    padding: 24px 14px calc(20px + env(safe-area-inset-bottom, 0px));
    gap: 10px;
  }

  .foot-logo { width: 96px; }

  .foot-copy { font-size: 11px; }
}

@media (max-width: 360px) {
  .top-inner,
  .grid-wrap {
    padding-left: 10px;
    padding-right: 10px;
  }

  .brand-links a {
    width: 38px;
    height: 38px;
  }

  .brand-wordmark {
    height: 36px;
  }

  .brand h1 {
    font-size: 21px;
  }

  .controls {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
  }

  .promo-chip {
    padding: 0 8px;
    font-size: 11.5px;
  }

  .promo-chip input {
    width: 15px;
    height: 15px;
  }

  .grid,
  .sub-grid {
    gap: 8px;
  }

  .body {
    padding-left: 8px;
    padding-right: 8px;
  }

  .desc {
    font-size: 11px;
  }

  .sub-name {
    font-size: 12.5px;
  }
}
