:root {
  --ink: #201d1c;
  --muted: #6f6a66;
  --bg: #f7f4f1;
  --card: #ffffff;
  --line: #e8e1db;
  --dark: #1d1b1a;
  --accent: #c2703f;
  --wa: #23c15e;
  --wa-dark: #1aa451;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(32, 29, 28, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  padding-bottom: 72px;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; }

.container { max-width: 520px; margin: 0 auto; padding: 16px; }

/* ---------- Header ---------- */
.app-header {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  height: 54px; padding: 0 16px;
  background: var(--dark); color: #fff;
}
.brand { font-weight: 800; font-size: 1.15rem; letter-spacing: 0.4px; }
.brand span { color: #e0a06e; }
.icon-btn {
  background: none; border: 0; color: #fff;
  font-size: 1.15rem; cursor: pointer; width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
}

.search-bar {
  background: var(--dark);
  padding: 0 16px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.search-bar input {
  width: 100%; padding: 10px 14px;
  border: 0; border-radius: 999px;
  background: #2d2a29; color: #fff; font-size: 0.95rem;
  outline: none;
}
.search-bar input::placeholder { color: #a9a29e; }

/* ---------- Catalog head ---------- */
.catalog-head {
  max-width: 520px; margin: 0 auto;
  padding: 14px 16px 4px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.cat-badge {
  background: var(--accent); color: #fff;
  font-size: 0.85rem; font-weight: 700;
  padding: 6px 14px; border-radius: 999px;
}
.sort-row { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--muted); }
.sort-row select {
  border: 1px solid var(--line); background: var(--card);
  border-radius: 999px; padding: 6px 10px; font-size: 0.85rem; color: var(--ink);
  outline: none;
}

/* ---------- Product grid ---------- */
.product-grid {
  max-width: 520px; margin: 0 auto;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.card {
  background: var(--card); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.card-media { aspect-ratio: 4 / 5; overflow: hidden; background: #efe9e3; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title { font-weight: 600; font-size: 0.92rem; line-height: 1.3; }
.card-price { font-weight: 800; font-size: 1.05rem; }
.card-price .from { font-weight: 400; color: var(--muted); font-size: 0.78rem; text-decoration: line-through; margin-right: 5px; }
.buy-btn {
  margin-top: auto;
  background: var(--wa); color: #fff; border: 0;
  border-radius: 999px; padding: 9px 12px;
  font-size: 0.9rem; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: background 0.2s;
}
.buy-btn:hover { background: var(--wa-dark); }

.empty-state { text-align: center; color: var(--muted); padding: 30px 0; }
.btn-outline {
  display: block; width: calc(100% - 32px); max-width: 488px;
  margin: 0 auto 8px; padding: 12px;
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: 999px;
  font-size: 0.95rem; font-weight: 700; cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Info card ---------- */
.info-card {
  max-width: 520px; margin: 8px auto 0; padding: 16px;
  background: var(--card); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  display: grid; gap: 6px; font-size: 0.92rem;
}
.info-card p:first-child { font-weight: 700; }

/* ---------- Footer ---------- */
.footer {
  background: #f1ece7;
  border-top: 1px solid var(--line);
  padding: 24px 16px 32px;
  display: grid; gap: 22px;
  max-width: 520px; margin: 0 auto;
}
.seller-block h3, .footer-block h3 { font-size: 0.95rem; margin-bottom: 10px; color: var(--dark); }
.wa-btn {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--wa); color: #fff;
  border-radius: 14px; padding: 14px 16px;
  font-size: 0.9rem;
}
.wa-btn:hover { background: var(--wa-dark); }
.wa-name { font-weight: 800; font-size: 1rem; }
.wa-phone { font-weight: 700; }
.complaint-link { display: inline-block; margin-top: 8px; font-size: 0.82rem; color: var(--muted); text-decoration: underline; }
.pay-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.pay-badges span {
  border: 1px solid var(--line); background: var(--card);
  border-radius: 8px; padding: 6px 12px; font-size: 0.8rem; font-weight: 600;
}
.social-links { display: flex; gap: 12px; }
.social-links a { font-size: 0.88rem; color: var(--accent); font-weight: 600; }
.store-info { display: grid; gap: 2px; font-size: 0.85rem; color: var(--muted); }
.store-info strong { color: var(--dark); }
.platform-note { text-align: center; font-size: 0.8rem; color: #a49d98; }
.platform-note::before { content: "Loja feita com "; }
.platform-note span { color: var(--accent); font-weight: 700; }

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: var(--card);
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
}
.nav-item {
  background: none; border: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 9px 4px; font-size: 0.68rem; color: var(--muted);
}
.nav-icon { font-size: 1.1rem; line-height: 1; }
.nav-item.active { color: var(--accent); font-weight: 700; }

/* ---------- Sheets (modal) ---------- */
.sheet { position: fixed; inset: 0; z-index: 60; visibility: hidden; }
.sheet.open { visibility: visible; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(20, 18, 17, 0.45); opacity: 0; transition: opacity 0.25s; }
.sheet.open .sheet-backdrop { opacity: 1; }
.sheet-panel {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: var(--card);
  border-radius: 18px 18px 0 0;
  padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform 0.3s;
  max-height: 80vh; overflow-y: auto;
}
.sheet.open .sheet-panel { transform: translateY(0); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.sheet-head h3 { font-size: 1.1rem; }
.sheet-close { background: none; border: 0; font-size: 1.6rem; cursor: pointer; color: var(--muted); line-height: 1; }
.sheet-label { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); margin: 14px 0 8px; }
.sheet-list { display: grid; gap: 4px; }
.sheet-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-radius: 10px;
  background: var(--bg); font-size: 0.92rem; cursor: pointer;
}
.sheet-item.active { background: rgba(194, 112, 63, 0.12); color: var(--accent); font-weight: 700; }
.sheet-item .count { color: var(--muted); font-size: 0.82rem; }

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 72px; z-index: 80;
  padding: 16px;
  max-width: 520px; margin: 0 auto;
}
.cookie-inner {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  font-size: 0.85rem;
}
.cookie-inner p { color: var(--muted); }
.cookie-inner strong { color: var(--ink); }
.cookie-inner a { color: var(--accent); text-decoration: underline; }
.cookie-actions { display: flex; gap: 8px; margin: 12px 0 8px; }
.cookie-btn {
  flex: 1; padding: 10px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); font-size: 0.88rem; font-weight: 700; cursor: pointer;
}
.cookie-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.cookie-hint { font-size: 0.75rem; text-align: center; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%);
  background: var(--dark); color: #fff;
  padding: 11px 18px; border-radius: 999px;
  font-size: 0.88rem; z-index: 90;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
}

/* ---------- Desktop center ---------- */
@media (min-width: 620px) {
  .app-header, .search-bar, .catalog-head, .product-grid, .info-card, .footer {
    max-width: 620px; margin-left: auto; margin-right: auto;
  }
}
