:root {
  --ink: #14171f;
  --ink-soft: #565d6b;
  --line: #e7e9ee;
  --bg: #fafbfc;
  --card: #ffffff;
  --brand: #1f2937;
  --accent: #0098d8;
  --accent-dark: #283e53;
  --accent-green: #5ca64f;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(20,23,31,.04), 0 8px 24px rgba(20,23,31,.06);
  --shadow-hover: 0 4px 10px rgba(20,23,31,.06), 0 16px 36px rgba(20,23,31,.10);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.hidden { display: none !important; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,.85); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 76px; }
.brand { display: flex; flex-direction: column; line-height: 1.05; flex-shrink: 0; }
.brand-logo { height: 30px; width: auto; display: block; }
.brand-mark { font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.brand-sub { font-size: 10.5px; letter-spacing: .14em; color: var(--ink-soft); text-transform: uppercase; margin-top: 5px; }

.search-wrap { position: relative; flex: 1; max-width: 520px; }
#search-input {
  width: 100%; padding: 12px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: #f2f3f5; font-size: 14.5px; outline: none; transition: box-shadow .15s, background .15s;
}
#search-input:focus { background: #fff; box-shadow: 0 0 0 3px rgba(0,152,216,.15); border-color: #a9d8ec; }
.suggestions {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: #fff;
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-hover);
  max-height: 360px; overflow-y: auto; z-index: 50;
}
.suggestion-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; }
.suggestion-item:hover { background: #f6f7f9; }
.suggestion-item img { width: 34px; height: 34px; border-radius: 8px; background: #fff; border: 1px solid var(--line); }
.suggestion-name { font-size: 13.5px; font-weight: 600; }
.suggestion-meta { font-size: 11.5px; color: var(--ink-soft); }

.header-actions { flex-shrink: 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; padding: 11px 20px; font-size: 14px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, background .12s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { box-shadow: var(--shadow-hover); filter: brightness(1.05); }
.btn-outline { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-outline:hover { border-color: #cfd4dc; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: #fff; }
.btn-sm { padding: 8px 14px; font-size: 13px; }

/* Hero */
.hero { padding: 56px 0 36px; text-align: center; }
.hero h1 { font-size: clamp(28px, 4vw, 42px); font-weight: 800; letter-spacing: -.02em; margin: 0 0 10px; }
.hero p { color: var(--ink-soft); font-size: 16px; margin: 0 0 26px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Sections */
.section { padding: 28px 0 56px; }
.section h2 { font-size: 22px; font-weight: 800; letter-spacing: -.01em; margin: 0 0 18px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }

/* Category grid */
.categoria-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.categoria-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 18px; box-shadow: var(--shadow); cursor: pointer; transition: box-shadow .15s, transform .15s;
}
.categoria-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.categoria-card img { width: 40px; height: 40px; margin-bottom: 14px; }
.categoria-card .cat-name { font-weight: 700; font-size: 14.5px; margin-bottom: 4px; }
.categoria-card .cat-count { font-size: 12.5px; color: var(--ink-soft); }

/* Filters */
.filters { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.filters select {
  padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff;
  font-size: 13.5px; color: var(--ink);
}
.filtro-resultado { font-size: 13px; color: var(--ink-soft); margin-left: auto; }
.view-toggle { display: flex; gap: 4px; background: #f2f3f5; border-radius: 10px; padding: 4px; }
.toggle-btn { border: none; background: transparent; padding: 6px 10px; border-radius: 8px; cursor: pointer; font-size: 15px; color: var(--ink-soft); }
.toggle-btn.active { background: #fff; color: var(--accent); box-shadow: var(--shadow); }

/* Product grid */
.produtos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.produtos-grid.list-mode { grid-template-columns: 1fr; }

.produto-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); transition: box-shadow .15s, transform .15s; display: flex; flex-direction: column;
}
.produto-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.produtos-grid.list-mode .produto-card { flex-direction: row; align-items: center; }

.produto-thumb { background: #fff; padding: 22px; display: flex; align-items: center; justify-content: center; aspect-ratio: 1/1; border-bottom: 1px solid var(--line); }
.produtos-grid.list-mode .produto-thumb { width: 96px; height: 96px; aspect-ratio: unset; border-bottom: none; border-right: 1px solid var(--line); flex-shrink: 0; padding: 14px; }
.produto-thumb img { width: 100%; height: 100%; object-fit: contain; }

.produto-body { padding: 14px 16px 16px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.produto-codigo { font-size: 11px; color: var(--ink-soft); font-weight: 600; letter-spacing: .04em; }
.produto-nome { font-size: 14px; font-weight: 700; line-height: 1.3; min-height: 2.6em; }
.produto-cat { font-size: 12px; color: var(--ink-soft); }
.produto-actions { display: flex; gap: 8px; margin-top: 8px; }
.produto-actions .btn { flex: 1; min-width: 0; padding: 8px 8px; overflow: hidden; text-overflow: ellipsis; }
.produto-actions .btn:hover { background: rgba(0, 152, 216, .12); border-color: var(--accent); color: var(--accent); }

.empty { text-align: center; padding: 60px 0; color: var(--ink-soft); }
.load-more { display: flex; margin: 28px auto 0; }

/* Product detail page */
.breadcrumb { font-size: 13px; color: var(--ink-soft); margin-bottom: 20px; }
.breadcrumb a:hover { text-decoration: underline; }
.produto-detalhe { display: grid; grid-template-columns: 380px 1fr; gap: 44px; align-items: start; }
@media (max-width: 800px) { .produto-detalhe { grid-template-columns: 1fr; } }

.produto-imagem-grande { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 40px; box-shadow: var(--shadow); }
.produto-imagem-grande img { width: 100%; }

.produto-info h1 { font-size: 26px; font-weight: 800; letter-spacing: -.01em; margin: 6px 0 14px; }
.info-row { display: flex; gap: 8px; margin-bottom: 6px; font-size: 14px; }
.info-row .label { color: var(--ink-soft); min-width: 110px; }
.tag { display: inline-block; background: rgba(0,152,216,.1); color: var(--accent); font-size: 12.5px; font-weight: 600; padding: 5px 12px; border-radius: 999px; }
.descricao { margin: 18px 0; line-height: 1.6; color: #2c313c; font-size: 14.5px; }
.detalhe-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 20px 0; }
.qrcode-box { margin-top: 22px; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: 14px; display: inline-flex; gap: 14px; align-items: center; }
.qrcode-box canvas, .qrcode-box img { border-radius: 8px; }
.qr-text { font-size: 12.5px; color: var(--ink-soft); max-width: 200px; }

.relacionados { margin-top: 56px; }
.relacionados h2 { font-size: 20px; font-weight: 800; margin-bottom: 16px; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-size: 13.5px;
  box-shadow: var(--shadow-hover); z-index: 100; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-6px); }

.site-footer { border-top: 1px solid var(--line); padding: 28px 0; margin-top: 20px; }
.site-footer .container { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.site-footer p { font-size: 12.5px; color: var(--ink-soft); text-align: center; margin: 0; }
.footer-credito {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  font-size: 12px; color: var(--ink-soft); transition: color .12s ease;
}
.footer-credito:hover { color: var(--accent); }
.footer-credito img { height: 26px; width: auto; display: block; }

@media (max-width: 640px) {
  .header-inner { gap: 12px; }
  .brand-sub { display: none; }
  .header-actions .btn span { display: none; }
}
