/* =====================================================================
   AGROPECUÁRIA JG — estilo compartilhado (catálogo + admin)
   Paleta tirada da logo (marrom / terracota / creme) e do muro da loja
   (vermelho tijolo). Sem nenhum tom de verde, de propósito.
   ===================================================================== */

:root {
  --bg: #f7f1e6;
  --surface: #fffdf8;
  --surface-2: #f1e7d6;
  --ink: #241611;
  --ink-soft: #6b554a;

  --brand: #8e241a;        /* vermelho do muro */
  --brand-2: #a8321f;
  --brand-ink: #fdf6ea;    /* texto sobre o vermelho */
  --brown: #3b2a17;        /* marrom do escudo da logo */
  --accent: #c4732a;       /* terracota da faixa da logo */
  --accent-soft: #f7e6d1;
  --line: #e3d6c2;

  --ok: #8e241a;
  --ok-bg: #f8e0dc;
  --order: #7a6252;
  --order-bg: #eee4d7;

  --shadow: 0 1px 2px rgba(59, 42, 23, .07), 0 8px 24px rgba(59, 42, 23, .08);
  --radius: 14px;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17100c;
    --surface: #211711;
    --surface-2: #2a1e16;
    --ink: #f2e7d8;
    --ink-soft: #b39c8b;
    --brand: #e0705e;
    --brand-2: #ea8271;
    --brand-ink: #2a100c;
    --brown: #d8b78c;
    --accent: #e09a50;
    --accent-soft: #3a2a19;
    --line: #3a2a1f;
    --ok: #e0705e;
    --ok-bg: #3a1c17;
    --order: #c0a894;
    --order-bg: #2e241c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 28px rgba(0, 0, 0, .4);
  }
}
:root[data-theme="dark"] {
  --bg: #17100c;
  --surface: #211711;
  --surface-2: #2a1e16;
  --ink: #f2e7d8;
  --ink-soft: #b39c8b;
  --brand: #e0705e;
  --brand-2: #ea8271;
  --brand-ink: #2a100c;
  --brown: #d8b78c;
  --accent: #e09a50;
  --accent-soft: #3a2a19;
  --line: #3a2a1f;
  --ok: #e0705e;
  --ok-bg: #3a1c17;
  --order: #c0a894;
  --order-bg: #2e241c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 28px rgba(0, 0, 0, .4);
}

* { box-sizing: border-box; }

/* o atributo hidden tem que vencer qualquer display definido por classe */
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; display: block; }

.wrap { width: min(1180px, 100% - 2.5rem); margin-inline: auto; }

/* ---------- Avisos ---------- */
.aviso {
  background: var(--brown);
  color: #fdf6ea;
  font-size: .82rem;
  text-align: center;
  padding: .55rem 1rem;
}
.aviso a { font-weight: 700; }

/* ---------- Cabeçalho ---------- */
header.top {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-inner {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding-block: .7rem;
}
.logo {
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 12px;
  object-fit: cover;
  background: var(--surface-2);
  box-shadow: var(--shadow);
}
.brand-block { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-name {
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink);
}
.brand-tag {
  font-size: .74rem;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top-spacer { flex: 1; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-family: inherit;
  font-weight: 600;
  font-size: .9rem;
  padding: .62rem 1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .12s ease, filter .12s ease, background .12s ease;
}
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 18px; height: 18px; flex: none; }

/* o botão do WhatsApp é vermelho da marca — o verde do WhatsApp
   está fora da paleta da loja e não deve aparecer em lugar nenhum */
.btn-wa { background: var(--brand); color: var(--brand-ink); box-shadow: var(--shadow); }
.btn-primary { background: var(--brand); color: var(--brand-ink); box-shadow: var(--shadow); }
.btn-accent { background: var(--accent); color: #2b1a08; box-shadow: var(--shadow); }
.btn-ghost { background: var(--surface); color: var(--ink-soft); border-color: var(--line); }
.btn-ghost:hover { color: var(--ink); border-color: var(--brand); }
.btn-danger { background: transparent; color: var(--brand); border-color: color-mix(in srgb, var(--brand) 40%, transparent); }
.btn-danger:hover { background: var(--ok-bg); }
.btn-sm { padding: .42rem .75rem; font-size: .82rem; border-radius: 8px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; filter: none; }

.icon-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex: none;
}
.icon-btn:hover { color: var(--ink); border-color: var(--brand); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- Formulários ---------- */
.campo { display: flex; flex-direction: column; gap: .3rem; }
.campo label {
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
input, select, textarea {
  font-family: inherit;
  font-size: .95rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .62rem .8rem;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent);
}
textarea { resize: vertical; min-height: 76px; }
.dica { font-size: .78rem; color: var(--ink-soft); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- Rodapé ---------- */
footer {
  background: var(--brown);
  color: #eee2ce;
  margin-top: auto;
}
:root[data-theme="dark"] footer,
:root:not([data-theme="light"]) footer { border-top: 1px solid var(--line); }
.foot-grid {
  display: grid;
  gap: 2rem 2.5rem;
  padding-block: 2.6rem 1.4rem;
  grid-template-columns: 1.3fr 1fr 1fr;
}
footer h4 {
  margin: 0 0 .8rem;
  font-size: .74rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: color-mix(in srgb, #eee2ce 62%, transparent);
  font-weight: 700;
}
footer .f-name { font-family: var(--font-serif); font-size: 1.3rem; margin: 0 0 .5rem; color: #fff; }
footer p, footer a { color: #eee2ce; font-size: .9rem; text-decoration: none; margin: .25rem 0; }
footer a:hover { text-decoration: underline; }
.f-line { display: flex; gap: .55rem; align-items: flex-start; margin: .4rem 0; font-size: .9rem; }
.f-line svg { width: 16px; height: 16px; flex: none; margin-top: .18rem; opacity: .85; }
.socials { display: flex; gap: .6rem; margin-top: .7rem; }
.socials a {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .1);
}
.socials a:hover { background: var(--accent); color: #2b1a08; }
.socials svg { width: 19px; height: 19px; }
.foot-bottom {
  border-top: 1px solid rgba(255, 255, 255, .15);
  padding-block: 1rem 1.4rem;
  font-size: .8rem;
  color: color-mix(in srgb, #eee2ce 70%, transparent);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem;
}
.foot-bottom a { font-size: .8rem; }

@media (max-width: 760px) {
  .foot-grid { grid-template-columns: 1fr; gap: 1.6rem; }
  .brand-tag { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
