/* Queijos Fartura — folha de estilos única, sem framework CSS.
   Variáveis de tema (claro/escuro) para manter consistência visual. */

/* Paleta "Fazenda Fartura": terra (terracota), pasto (verde) e queijo/trigo
   (dourado) sobre uma base creme de laticínio — de dia. À noite, o mesmo
   campo sob luar, com o dourado virando o brilho de vaga-lumes. As variáveis
   --pasture/--gold/--glow são a camada "viva" usada nos micro-interações
   (glow em botões, bordas de cartão, contadores) — ver mais abaixo. */
:root {
  --bg: #FBF6EC;
  --bg-alt: #F1E7CE;
  --card: #FFFFFF;
  --border: #E4D5AE;
  --text: #241B10;
  --text-muted: #7C6640;
  --primary: #A8481E;
  --primary-hover: #883A17;
  --primary-contrast: #FFFFFF;
  --pasture: #3E6B39;
  --pasture-dark: #2B4C28;
  --pasture-bg: #E3EDDA;
  --gold: #C98F2B;
  --gold-soft: #F2DFA6;
  --glow: rgba(201, 143, 43, 0.45);
  --success: #4C7A3B;
  --success-bg: #E2EAD4;
  --warning: #B7791F;
  --warning-bg: #FBEBC7;
  --danger: #C0392B;
  --danger-bg: #FADBD8;
  --info: #2E6FA3;
  --info-bg: #DCEBF7;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 34px -12px rgba(61, 44, 27, 0.25);
  --gradient-fartura: linear-gradient(135deg, var(--primary), var(--gold));
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Inter', system-ui, sans-serif;
}

[data-theme="dark"] {
  --bg: #12140E;
  --bg-alt: #1A1E13;
  --card: #1F2417;
  --border: #3A4030;
  --text: #F2EEDC;
  --text-muted: #B7C09E;
  --primary: #E17F42;
  --primary-hover: #EE9A64;
  --primary-contrast: #16110A;
  --pasture: #7FBC69;
  --pasture-dark: #579350;
  --pasture-bg: #223018;
  --gold: #F0C463;
  --gold-soft: #3B3016;
  --glow: rgba(240, 196, 99, 0.5);
  --success: #8FC26E;
  --success-bg: #24311A;
  --warning: #E4B95B;
  --warning-bg: #3a2f14;
  --danger: #E4776B;
  --danger-bg: #3a1c17;
  --info: #7FB4E0;
  --info-bg: #16293a;
  --shadow: 0 10px 34px -12px rgba(0, 0, 0, 0.6);
  --gradient-fartura: linear-gradient(135deg, var(--primary), var(--gold));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s ease, color 0.2s ease;
  /* Textura bem sutil de "papel/linho", pra fugir do flat-design genérico
     sem pesar na leitura — é um SVG de ruído embutido, sem pedir nada da
     rede, então nunca falha nem atrasa o carregamento. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
}
h1, h2, h3, h4 { font-family: var(--font-serif); margin: 0 0 8px; line-height: 1.25; }
p { line-height: 1.65; margin: 0 0 12px; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

::selection { background: var(--gold); color: #241B10; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Scrollbar discreta, na paleta da fazenda — só em navegadores baseados em
   WebKit/Chromium e Firefox; em outros, cai no scrollbar padrão do SO sem
   quebrar nada. */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg-alt); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; border: 3px solid var(--bg-alt); }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }
html { scrollbar-color: var(--border) var(--bg-alt); }

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--text-muted); }

/* -------------------------------------------------------------------------
   Microinterações — revelar ao rolar a página
   Usado em conjunto com /js/reveal.js: qualquer elemento com a classe
   .reveal começa levemente descido e transparente, e ganha a classe
   .reveal-visivel (via IntersectionObserver) assim que entra na tela.
   Quem tem JavaScript desativado nunca vê o elemento escondido — a regra
   abaixo só entra em vigor depois que reveal.js adiciona .js-pronto ao
   <html>, então o conteúdo sempre aparece de qualquer forma.
------------------------------------------------------------------------- */
html.js-pronto .reveal {
  opacity: 0; transform: translateY(22px); transition: opacity 0.7s ease, transform 0.7s ease;
}
html.js-pronto .reveal-visivel { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  html.js-pronto .reveal { opacity: 1; transform: none; transition: none; }
}
.center-page {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(32px, env(safe-area-inset-top)) 16px max(32px, env(safe-area-inset-bottom));
  background: var(--bg);
}

/* -------------------------------------------------------------------------
   Cabeçalho / navegação
------------------------------------------------------------------------- */
.header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between; min-height: 76px;
  padding-top: max(0px, env(safe-area-inset-top));
}
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-serif); font-weight: 700; font-size: 20px; color: var(--text); }
.logo-badge {
  width: 38px; height: 38px; border-radius: 50%; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0;
  overflow: hidden;
}
.logo-badge img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a { color: var(--text); font-weight: 500; font-size: 14.5px; }
.nav-actions { display: flex; align-items: center; gap: 10px; }

/* Link de "voltar" dentro do conteúdo da página (não dentro de .nav-links)
   — fica visível em qualquer largura de tela, inclusive no celular, onde
   .nav-links some e não tem outro jeito de voltar pra Minha conta. */
.link-voltar {
  display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted);
  font-size: 13.5px; font-weight: 600; margin-bottom: 16px;
}
.link-voltar:hover { color: var(--primary); text-decoration: none; }

.theme-toggle {
  background: none; border: 1px solid var(--border); border-radius: 50%;
  width: 40px; height: 40px; cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center; color: var(--text);
  flex-shrink: 0; transition: background 0.2s ease, border-color 0.2s ease, transform 0.35s ease, box-shadow 0.2s ease;
}
.theme-toggle:hover { background: var(--bg-alt); border-color: var(--gold); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 18%, transparent); transform: rotate(-14deg); }

/* -------------------------------------------------------------------------
   Menu mobile do cabeçalho público (index.html)
------------------------------------------------------------------------- */
.nav-toggle { display: none; }
.mobile-panel {
  display: none; flex-direction: column; gap: 16px; padding: 18px 20px calc(20px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border); background: var(--bg);
}
.mobile-panel.aberto { display: flex; }
.mobile-panel-links { display: flex; flex-direction: column; gap: 4px; }
.mobile-panel-links a {
  padding: 12px 6px; color: var(--text); font-weight: 500; font-size: 15px;
  border-bottom: 1px solid var(--border);
}
.mobile-panel-actions { display: flex; flex-direction: column; gap: 10px; }
.mobile-panel-actions .btn { width: 100%; }

@media (max-width: 900px) {
  .nav-links, .area-sessao-desktop { display: none; }
  .nav-toggle { display: flex; }
}

/* -------------------------------------------------------------------------
   Botões
------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 999px; font-weight: 600; font-size: 14px;
  cursor: pointer; border: 1px solid transparent; transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  text-decoration: none; position: relative;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary {
  background: var(--gradient-fartura); background-size: 160% 160%; background-position: 0% 50%;
  color: var(--primary-contrast); box-shadow: 0 6px 18px -6px var(--glow);
}
.btn-primary:hover:not(:disabled) {
  background-position: 100% 50%; transform: translateY(-2px);
  box-shadow: 0 10px 26px -8px var(--glow); text-decoration: none;
}
.btn-secondary { background: var(--card); color: var(--text); border-color: var(--border); }
.btn-secondary:hover:not(:disabled) { background: var(--bg-alt); border-color: var(--gold); transform: translateY(-2px); text-decoration: none; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { opacity: 0.9; }
.btn-sm { padding: 7px 14px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: 50%; flex-shrink: 0; touch-action: manipulation; }
.btn:active:not(:disabled) { transform: translateY(0) scale(0.98); }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* -------------------------------------------------------------------------
   Cartões / formulários
------------------------------------------------------------------------- */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.field .hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
input, select, textarea {
  width: 100%; padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 14.5px; font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}
textarea { resize: vertical; min-height: 80px; }
/* Teto de largura: sem isso, um formulário de 2 colunas dentro de um
   .main-content largo (painel admin) vira campos de texto enormes e difíceis
   de escanear visualmente — inputs continuam confortáveis até 720px, depois
   disso o formulário só fica centralizado dentro do espaço do cartão. */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; max-width: 720px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.form-grid .span-2 { grid-column: 1 / -1; }

/* -------------------------------------------------------------------------
   Badges de status
------------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.badge-aguardando_pagamento { background: var(--warning-bg); color: var(--warning); }
.badge-pago { background: var(--info-bg); color: var(--info); }
.badge-saiu_entrega { background: var(--info-bg); color: var(--info); }
.badge-entregue { background: var(--success-bg); color: var(--success); }
.badge-concluido { background: var(--success-bg); color: var(--success); }
.badge-cancelado { background: var(--danger-bg); color: var(--danger); }
.badge-ativo { background: var(--success-bg); color: var(--success); }
.badge-inativo { background: var(--danger-bg); color: var(--danger); }

/* Ponto pulsante nos status "em andamento" (aguardando pagamento / a
   caminho) — o mesmo idioma visual do pulso dourado do hero, só que na cor
   do próprio badge (currentColor), pra chamar o olho sem precisar de mais
   uma cor nova no sistema. Status "parados" (pago, entregue, cancelado...)
   não pulsam — o movimento fica reservado pra quem ainda está em curso. */
.badge-aguardando_pagamento::before, .badge-saiu_entrega::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 6px; flex-shrink: 0;
  animation: badge-pulso 1.8s ease-out infinite;
}
@keyframes badge-pulso {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent); }
  70% { box-shadow: 0 0 0 6px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .badge-aguardando_pagamento::before, .badge-saiu_entrega::before { animation: none; }
}

/* -------------------------------------------------------------------------
   Hero / carrossel
------------------------------------------------------------------------- */
.hero { position: relative; height: 82vh; height: 82svh; min-height: 460px; max-height: 720px; overflow: hidden; }
@media (max-width: 640px) { .hero { height: 92vh; height: 92svh; min-height: 420px; } }
.hero-track { display: flex; height: 100%; transition: transform 0.6s ease; }
.hero-slide { position: relative; min-width: 100%; height: 100%; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; }
.hero-overlay {
  position: absolute; inset: 0;
  /* Gradiente com a dupla terracota (solo) + verde-pasto no canto, em vez de
     um preto/marrom neutro — mesmo em fotos genéricas, a cor de marca do
     "campo" já aparece na primeira dobra do site. */
  background:
    linear-gradient(0deg, rgba(20,15,9,0.86) 0%, rgba(20,15,9,0.38) 55%, rgba(20,15,9,0.12) 100%),
    linear-gradient(115deg, rgba(43,76,40,0.35) 0%, transparent 45%, rgba(168,72,30,0.28) 100%);
}
.hero-content { position: absolute; inset: 0; display: flex; align-items: center; z-index: 2; }
.hero-content .container { max-width: 640px; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  background: color-mix(in srgb, var(--primary) 88%, transparent); color: #fff;
  padding: 6px 16px; border-radius: 999px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
}
.hero-eyebrow::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--gold);
  box-shadow: 0 0 0 0 var(--gold); animation: pulso-vaga-lume 2.4s ease-out infinite;
}
@keyframes pulso-vaga-lume {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--gold) 70%, transparent); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.hero-title { color: #fff; font-size: clamp(30px, 5vw, 52px); margin: 18px 0 14px; }
.hero-subtitle { color: rgba(255,255,255,0.9); font-size: 17px; max-width: 480px; margin-bottom: 26px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  background: rgba(255,255,255,0.18); border: none; color: #fff; width: 44px; height: 44px;
  border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px); transition: background 0.2s ease, transform 0.2s ease;
}
.hero-arrow:hover { background: rgba(255,255,255,0.3); transform: translateY(-50%) scale(1.08); }
.hero-arrow.prev { left: 20px; }
.hero-arrow.next { right: 20px; }
.hero-dots { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 3; display: flex; gap: 8px; }
.hero-dots button { width: 9px; height: 9px; border-radius: 50%; border: none; background: rgba(255,255,255,0.5); cursor: pointer; padding: 0; transition: width 0.25s ease, background 0.25s ease; }
.hero-dots button.ativo { width: 26px; border-radius: 999px; background: var(--gold); }

/* Divisor orgânico entre o hero e o resto da página — uma "linha do
   horizonte" de colina, contínua com o verde-pasto da marca, em vez do
   corte reto tradicional entre seções. */
.hero-horizonte { position: absolute; left: 0; right: 0; bottom: -1px; z-index: 2; line-height: 0; }
.hero-horizonte svg { width: 100%; height: 48px; display: block; }
.hero-horizonte path { fill: var(--card); }

/* -------------------------------------------------------------------------
   Seções da landing page
------------------------------------------------------------------------- */
.section { padding: 76px 0; }
.section-alt {
  background:
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--text) 6%, transparent) 1px, transparent 0) 0 0/22px 22px,
    var(--bg-alt);
}
.section-head { max-width: 620px; margin: 0 auto 44px; text-align: center; }
.section-eyebrow {
  color: var(--primary); font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.06em;
  position: relative; padding-bottom: 4px; display: inline-block;
}
.section-eyebrow::after {
  content: ''; position: absolute; left: 0; bottom: 0; height: 2px; width: 28px; border-radius: 999px;
  background: var(--gradient-fartura);
}

.trust-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; padding: 26px 0; border-bottom: 1px solid var(--border); background: var(--card); }
@media (max-width: 720px) { .trust-strip { grid-template-columns: repeat(2, 1fr); } }
.trust-item { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; transition: transform 0.2s ease; }
.trust-item:hover { transform: translateY(-2px); }
.trust-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border-radius: 50%; background: var(--pasture-bg); flex-shrink: 0; font-size: 15px;
}
.trust-icon { width: 38px; height: 38px; border-radius: 50%; background: var(--success-bg); color: var(--success); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* auto-fit/minmax (com teto de 280px por coluna) em vez de breakpoints fixos
   (4 → 2 → 1 colunas): o grid calcula sozinho quantas colunas cabem em
   qualquer largura de tela, sem os saltos bruscos que um número fixo de
   colunas por breakpoint deixa passar. O teto de 280px evita que 1 ou 2
   produtos (o catálogo da fazenda começa pequeno) virem cartões esticados
   ocupando a tela inteira; justify-content centraliza o bloco de cartões
   quando sobra espaço, em vez de deixá-los grudados à esquerda com um vão
   em branco do lado — o mesmo problema do painel admin, só que aqui. */
.product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 280px)); gap: 22px; justify-content: center; }

.product-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; }
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--gold); }
.product-photo { position: relative; height: 190px; background: var(--bg-alt); overflow: hidden; }
.product-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.product-card:hover .product-photo img { transform: scale(1.06); }
.product-tag { position: absolute; top: 10px; left: 10px; padding: 5px 12px; border-radius: 999px; font-size: 11.5px; font-weight: 700; color: #fff; }
.product-tag.esgotado { background: var(--danger); }
.product-tag.baixo { background: var(--warning); }
.product-body { padding: 18px; }
.product-body h3 { font-size: 17px; }
.product-desc { font-size: 13.5px; color: var(--text-muted); margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-footer { display: flex; align-items: flex-end; justify-content: space-between; }
.product-price { font-family: var(--font-serif); font-weight: 700; font-size: 19px; color: var(--primary); }
.product-unit { font-size: 11.5px; color: var(--text-muted); }
.product-stock { font-size: 12px; color: var(--success); font-weight: 600; }

.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } }
.about-photo {
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); height: 380px;
  position: relative; padding: 6px; background: var(--gradient-fartura);
}
.about-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: calc(var(--radius) - 6px); display: block; }
.about-list { list-style: none; padding: 0; margin: 18px 0 0; }
.about-list li { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; font-size: 14.5px; }
.about-list li::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--pasture); margin-top: 7px; flex-shrink: 0; }

/* -------------------------------------------------------------------------
   Rodapé
------------------------------------------------------------------------- */
/* Cor de texto fixa (não usa var(--bg)/var(--text), que se invertem no modo
   escuro) — o fundo do rodapé é sempre escuro, então o texto precisa ficar
   sempre claro, nos dois temas. */
.footer { background: var(--text); color: rgba(255,255,255,0.75); padding: 56px 0 calc(20px + env(safe-area-inset-bottom)); }
[data-theme="dark"] .footer { background: #0F0B07; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 36px; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; } }
.footer h4 { color: #fff; font-size: 15px; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: 10px; font-size: 13.5px; color: rgba(255,255,255,0.75); }
.footer a { color: rgba(255,255,255,0.75); }
.footer-bottom { text-align: center; font-size: 12px; color: rgba(255,255,255,0.5); margin-top: 40px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,0.12); }

/* -------------------------------------------------------------------------
   Painel (admin / conta do cliente)
------------------------------------------------------------------------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex-shrink: 0; background: var(--card); border-right: 1px solid var(--border);
  padding: 22px 14px; display: flex; flex-direction: column;
  transition: width 0.18s ease, padding 0.18s ease;
}
.sidebar-topo { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 4px 18px; flex-shrink: 0; }
/* Grupo principal de navegação: cresce para ocupar todo o espaço vertical
   sobrando entre o topo e o rodapé (Sair), e centraliza os links dentro
   desse espaço — em vez de deixá-los todos amontoados coladinhos no topo. */
.sidebar-nav {
  flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 6px;
  min-height: 0; overflow-y: auto;
}
.sidebar-rodape { flex-shrink: 0; border-top: 1px solid var(--border); padding-top: 10px; margin-top: 10px; }
.sidebar-icon { width: 20px; height: 20px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.sidebar-icon svg { width: 100%; height: 100%; }
.sidebar-label { white-space: nowrap; overflow: hidden; }
.sidebar-link {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--radius-sm);
  color: var(--text); font-size: 14px; font-weight: 500; cursor: pointer; border: none; background: none; width: 100%; text-align: left;
  position: relative; flex-shrink: 0;
  transition: background-color 0.22s ease, color 0.22s ease, transform 0.12s ease;
}
.sidebar-link:hover { background: var(--bg-alt); text-decoration: none; }
.sidebar-link:active { transform: scale(0.97); }
.sidebar-link.ativo { background: var(--primary); color: #fff; }
.sidebar-badge {
  margin-left: auto; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 999px; display: flex; align-items: center; justify-content: center; padding: 0 5px;
}
.sidebar-link.ativo .sidebar-badge { background: rgba(255,255,255,0.28); }
#btn-colapsar-sidebar {
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: 8px; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-muted); flex-shrink: 0; padding: 0;
}
#btn-colapsar-sidebar:hover { background: var(--border); color: var(--text); }
#btn-colapsar-sidebar svg { transition: transform 0.18s ease; display: block; }

/* Modo recolhido (só ícones) — só se aplica em telas largas; no mobile a
   sidebar já é escondida/mostrada inteira via overlay, então ignoramos. */
@media (min-width: 901px) {
  .sidebar.colapsada { width: 76px; padding-left: 10px; padding-right: 10px; }
  .sidebar.colapsada .sidebar-label,
  .sidebar.colapsada .logo-texto,
  .sidebar.colapsada .sidebar-badge { display: none; }
  /* Em telas estreitas o emblema da logo (38px) + o botão (28px) lado a
     lado não cabem nos 76px recolhidos — por isso empilhamos os dois,
     centralizados, em vez de deixá-los espremidos/desalinhados numa linha. */
  .sidebar.colapsada .sidebar-topo { flex-direction: column; justify-content: center; gap: 10px; padding-bottom: 14px; }
  .sidebar.colapsada #btn-colapsar-sidebar svg { transform: rotate(180deg); }
  .sidebar.colapsada .sidebar-link { justify-content: center; padding: 12px; }
  .sidebar.colapsada .sidebar-rodape { display: flex; justify-content: center; }
}
/* min-width:0 é essencial aqui: um item flex (.main-content é filho de
   .app-shell, que é display:flex) tem min-width:auto por padrão, ou seja,
   por padrão ele se recusa a encolher além do conteúdo mais largo lá
   dentro (ex: a tabela de estoque). Isso empurrava a página inteira para
   um scroll horizontal no celular, mesmo com .table-wrap tendo
   overflow-x:auto — o scroll interno nunca chegava a entrar em ação porque
   o próprio .main-content já tinha crescido pra caber a tabela. */
/* margin: 0 auto é o que faltava aqui: sem ele, um flex-item com max-width
   fica ENCOSTADO na sidebar assim que atinge o teto — em monitor largo,
   sobra um vão em branco enorme só do lado direito, em vez de distribuído.
   Também subimos o teto (1160px → 1600px) porque isso é um painel de dados
   (tabelas, gráficos, chat): mais espaço útil visível é melhor que espaço
   ocioso, até um limite que não deixe linha de tabela/gráfico absurdamente
   esticada em monitor muito largo. */
.main-content { flex: 1; min-width: 0; padding: 28px 32px; max-width: 1600px; margin: 0 auto; }
@media (max-width: 900px) {
  .sidebar { position: fixed; left: -260px; top: 0; bottom: 0; z-index: 60; transition: left 0.2s ease; box-shadow: var(--shadow); }
  .sidebar.aberta { left: 0; }
  .main-content { padding: 20px 16px; }
  #btn-colapsar-sidebar { display: none; }
}
.menu-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 55; }
.menu-overlay.ativo { display: block; }
#btn-abrir-menu { display: none; }
@media (max-width: 900px) { #btn-abrir-menu { display: flex; } }

/* -------------------------------------------------------------------------
   Abas da área "Minha conta" — separa pedidos / endereços / segurança em
   painéis distintos, um de cada vez, em vez de empilhar tudo na mesma tela.
------------------------------------------------------------------------- */
.conta-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.conta-tab {
  display: flex; align-items: center; gap: 8px; padding: 10px 16px; border: none; background: none;
  color: var(--text-muted); font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
  border-bottom: 2.5px solid transparent; margin-bottom: -1px; flex-shrink: 0;
}
.conta-tab-icon { width: 17px; height: 17px; flex-shrink: 0; display: flex; }
.conta-tab-icon svg { width: 100%; height: 100%; }
.conta-tab:hover { color: var(--text); }
.conta-tab.ativa { color: var(--primary); border-bottom-color: var(--primary); }
.conta-painel[hidden] { display: none; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }

.alerta-seguranca {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  background: var(--danger); color: #fff; padding: 12px 18px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600; margin-bottom: 20px;
}
/* auto-fit puro (sem teto de largura): diferente do grid de produtos, aqui
   QUEREMOS que os cartões cresçam pra preencher a tela em monitores largos
   — é um painel de números, não fotos, então cartão mais largo só ajuda a
   leitura. Isso também é metade da correção do vão em branco no admin (a
   outra metade é o .main-content, mais abaixo). */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px;
  position: relative; overflow: hidden; transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.stat-card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--gradient-fartura);
  transform: scaleX(0); transform-origin: left; transition: transform 0.3s ease;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--gold); }
.stat-card:hover::before { transform: scaleX(1); }
.stat-icon { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.stat-value { font-family: var(--font-serif); font-size: 26px; font-weight: 700; }
.stat-label { font-size: 13px; color: var(--text-muted); }

.table-wrap { overflow-x: auto; }
/* Em telas estreitas, a tabela de estoque vira uma lista de cartões — uma
   linha de tabela normal (foto + nome + preço + estoque + status + botão)
   não cabe de forma legível numa tela de celular. A ordem das colunas no
   HTML (foto, nome, preço, estoque, status, editar) já é a ordem ideal
   pro cartão, então só remapeamos cada <td> pra uma área de um grid. */
@media (max-width: 640px) {
  .table-wrap table, .table-wrap tbody { display: block; width: 100%; }
  .table-wrap thead { display: none; }
  .table-wrap tr {
    display: grid;
    grid-template-columns: 44px 1fr;
    grid-template-areas:
      "foto nome"
      "preco preco"
      "estoque estoque"
      "status status"
      "editar editar";
    gap: 6px 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    align-items: center;
  }
  .table-wrap tr:last-child { border-bottom: none; }
  /* white-space:nowrap vem do estilo padrão de th/td (bom pra tabela de
     verdade no desktop) — aqui em modo cartão isso impedia até o nome do
     produto de quebrar linha, empurrando o texto por cima do botão. */
  .table-wrap td { display: block; padding: 0; border: none; white-space: normal; }
  .table-wrap td:nth-child(1) { grid-area: foto; }
  .table-wrap td:nth-child(2) { grid-area: nome; font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
  .table-wrap td:nth-child(3) { grid-area: preco; font-size: 13.5px; }
  .table-wrap td:nth-child(4) { grid-area: estoque; font-size: 13.5px; color: var(--text-muted); }
  .table-wrap td:nth-child(4)::before { content: 'Estoque: '; }
  .table-wrap td:nth-child(5) { grid-area: status; }
  .table-wrap td:nth-child(6) { grid-area: editar; margin-top: 4px; }
  .table-wrap td:nth-child(6) button { width: 100%; }
}
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }
tr:last-child td { border-bottom: none; }

/* Lista de pedidos do admin — grid fluido em vez de pilha vertical única:
   numa tela larga, uma coluna só de cartões fica com muito vão em branco dos
   dois lados de cada linha; várias colunas usam esse espaço de verdade.
   align-items:start evita que o grid estique todo cartão da fileira até a
   altura do mais alto (cada pedido tem uma quantidade diferente de itens). */
#lista-pedidos-admin {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start;
}
#lista-pedidos-admin .card { margin-top: 0; }

.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.chip {
  padding: 7px 15px; border-radius: 999px; font-size: 12.5px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--border); background: var(--card); color: var(--text-muted);
}
.chip.ativo { background: var(--primary); border-color: var(--primary); color: #fff; }

.order-item-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.order-item-row:last-child { border-bottom: none; }

.qty-control { display: flex; align-items: center; gap: 10px; }
.qty-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: var(--card);
  cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text);
  font-size: 18px; flex-shrink: 0; touch-action: manipulation;
}
.qty-btn:hover { background: var(--bg-alt); }
.qty-value { min-width: 24px; text-align: center; font-weight: 700; font-size: 15px; }

.pix-box { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.pix-qr { width: 220px; height: 220px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.copy-row { display: flex; gap: 8px; width: 100%; max-width: 420px; }
.copy-row input { flex: 1; }

/* -------------------------------------------------------------------------
   Toasts
------------------------------------------------------------------------- */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 100; background: var(--card); color: var(--text);
  border: 1px solid var(--border); padding: 13px 20px; border-radius: var(--radius-sm); box-shadow: var(--shadow);
  font-size: 14px; max-width: 320px; animation: toast-in 0.2s ease;
}
.toast.sucesso { border-color: var(--success); color: var(--success); }
.toast.erro { border-color: var(--danger); color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* -------------------------------------------------------------------------
   Lightbox (ampliar foto de produto no admin)
------------------------------------------------------------------------- */
.lightbox-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.82); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px; }
.lightbox-backdrop img { max-width: 90vw; max-height: 88vh; border-radius: 10px; }
.lightbox-fechar { position: absolute; top: 20px; right: 24px; background: rgba(255,255,255,0.15); border: none; color: #fff; width: 40px; height: 40px; border-radius: 50%; font-size: 18px; cursor: pointer; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--primary); color: #fff; padding: 10px 16px;
  border-radius: 0 0 8px 0; z-index: 1000;
}
.skip-link:focus { left: 0; }

/* -------------------------------------------------------------------------
   Modal genérico (confirmar entrega com foto, etc.)
------------------------------------------------------------------------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 210; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-box { background: var(--card); border-radius: var(--radius); padding: 24px; max-width: 420px; width: 100%; box-shadow: var(--shadow); max-height: 90vh; overflow-y: auto; }
.modal-box h3 { font-size: 17px; }
.upload-foto-preview {
  /* display:block é essencial aqui: por padrão <label> é inline, e um
     elemento inline que contém um <div> (bloco) dentro tem sua própria
     caixa (borda/fundo) fragmentada pelo navegador — era isso que causava
     aquelas barrinhas soltas no lugar do ícone da câmera. */
  display: block; width: 100%; box-sizing: border-box;
  border: 1.5px dashed var(--border); border-radius: var(--radius-sm); padding: 22px 18px; text-align: center;
  cursor: pointer; color: var(--text-muted); font-size: 13.5px; margin-bottom: 16px; background: var(--bg);
}
.upload-foto-preview img { display: block; max-height: 160px; border-radius: 8px; margin: 0 auto 8px; }
.upload-foto-preview.upload-foto-erro { border-color: var(--danger); background: var(--danger-bg); color: var(--danger); }
.upload-foto-preview:hover { border-color: var(--primary); color: var(--primary); }

/* -------------------------------------------------------------------------
   Câmera ao vivo (captura de foto da entrega direto no navegador)
------------------------------------------------------------------------- */
.camera-box {
  background: #000; border-radius: var(--radius); padding: 14px; max-width: 480px; width: 100%;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; align-items: center;
}
.camera-box video {
  width: 100%; max-height: 60vh; border-radius: var(--radius-sm); background: #000;
  object-fit: cover; transform: scaleX(-1); /* espelha só a câmera frontal para parecer um "espelho" */
}
.camera-box video.camera-traseira { transform: none; }
.camera-erro {
  color: #fff; background: rgba(220, 53, 69, 0.85); border-radius: var(--radius-sm);
  padding: 10px 14px; font-size: 13.5px; text-align: center; width: 100%; box-sizing: border-box;
}
.camera-controles {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%;
}
.camera-controles .btn-sm { flex-shrink: 0; }
.btn-capturar {
  width: 64px; height: 64px; border-radius: 50%; background: #fff; border: 4px solid rgba(255,255,255,0.4);
  box-shadow: 0 0 0 2px #fff inset; cursor: pointer; flex-shrink: 0; margin: 0 auto; touch-action: manipulation;
}
.btn-capturar:hover { border-color: rgba(255,255,255,0.7); }
.btn-capturar:active { background: #eee; }

/* -------------------------------------------------------------------------
   Endereços salvos do cliente
------------------------------------------------------------------------- */
.endereco-card {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 10px; cursor: pointer; background: var(--bg);
}
.endereco-card:hover { border-color: var(--primary); }
.endereco-card.selecionado { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, var(--bg)); }
.endereco-card input[type="radio"] { width: auto; margin-top: 3px; accent-color: var(--primary); }
.endereco-card .endereco-info { flex: 1; font-size: 13.5px; line-height: 1.5; }
.endereco-card .endereco-rotulo { font-weight: 700; display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.endereco-tag-padrao { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; background: var(--success-bg); color: var(--success); padding: 2px 8px; border-radius: 999px; }
.endereco-acoes { display: flex; gap: 6px; flex-shrink: 0; }
.endereco-acoes button { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 6px; border-radius: 6px; display: flex; }
.endereco-acoes button:hover { background: var(--bg-alt); color: var(--text); }

/* -------------------------------------------------------------------------
   Chat cliente ↔ Queijos Fartura
------------------------------------------------------------------------- */
.chat-bolha {
  position: fixed; right: 20px; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 90;
  width: 58px; height: 58px; border-radius: 50%; background: var(--primary); color: #fff; border: none;
  cursor: pointer; box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center;
}
.chat-bolha:hover { background: var(--primary-hover); }
.chat-bolha .chat-bolha-contador {
  position: absolute; top: -4px; right: -4px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700;
  min-width: 20px; height: 20px; border-radius: 999px; display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg);
}
.chat-painel {
  position: fixed; right: 20px; bottom: max(88px, calc(env(safe-area-inset-bottom) + 88px)); z-index: 90;
  width: min(360px, calc(100vw - 40px)); height: min(500px, calc(100vh - 140px)); background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  display: none; flex-direction: column; overflow: hidden;
}
.chat-painel.aberto { display: flex; }
.chat-cabecalho { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); background: var(--bg-alt); }
.chat-cabecalho img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.chat-cabecalho .chat-titulo { font-weight: 700; font-size: 14.5px; }
.chat-cabecalho .chat-subtitulo { font-size: 12px; color: var(--text-muted); }
.chat-fechar { margin-left: auto; background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 4px; }
.chat-mensagens { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.chat-msg { display: flex; gap: 8px; align-items: flex-end; max-width: 88%; }
.chat-msg.propria { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg-avatar { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; object-fit: cover; background: var(--bg-alt); }
.chat-msg-avatar.icone-pessoa { display: flex; align-items: center; justify-content: center; color: var(--text-muted); border: 1px solid var(--border); }
.chat-msg-balao { background: var(--bg-alt); color: var(--text); padding: 9px 13px; border-radius: 14px 14px 14px 4px; font-size: 13.5px; line-height: 1.5; word-break: break-word; white-space: pre-wrap; }
.chat-msg.propria .chat-msg-balao { background: var(--primary); color: #fff; border-radius: 14px 14px 4px 14px; }
.chat-msg-hora { font-size: 10px; color: var(--text-muted); margin-top: 3px; }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.chat-form input { flex: 1; }
.chat-form button { flex-shrink: 0; }
.chat-vazio { text-align: center; color: var(--text-muted); font-size: 13px; padding: 30px 14px; }

/* Lista de conversas no painel admin */
.conversa-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; }
.conversa-item:hover { background: var(--bg-alt); }
.conversa-item.ativa { background: var(--bg-alt); border-left: 3px solid var(--primary); }
.conversa-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--info-bg); color: var(--info); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-weight: 700; }
.conversa-info { flex: 1; min-width: 0; }
.conversa-nome { font-weight: 600; font-size: 13.5px; display: flex; justify-content: space-between; gap: 6px; }
.conversa-preview { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-admin-layout { display: grid; grid-template-columns: 300px 1fr; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; height: min(640px, 76vh); background: var(--card); }
.chat-admin-lista { border-right: 1px solid var(--border); overflow-y: auto; }
.chat-admin-conversa { display: flex; flex-direction: column; min-height: 0; }
@media (max-width: 760px) {
  .chat-admin-layout { grid-template-columns: 1fr; height: auto; }
  .chat-admin-lista { max-height: 260px; }
  .chat-admin-conversa { height: 440px; }
}

/* -------------------------------------------------------------------------
   Estatísticas — gráficos simples em SVG, sem depender de bibliotecas
   externas (mantém a política de segurança de conteúdo restritiva).
------------------------------------------------------------------------- */
.stats-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
@media (max-width: 980px) { .stats-grid { grid-template-columns: 1fr; } }
.grafico-card h3 { font-size: 14.5px; margin-bottom: 4px; }
.grafico-card p.muted { font-size: 12.5px; margin-bottom: 14px; }
.grafico-svg { width: 100%; height: auto; overflow: visible; }
.grafico-barra { fill: var(--primary); }
.grafico-barra:hover { fill: var(--primary-hover); }
.grafico-linha { fill: none; stroke: var(--primary); stroke-width: 2.5; }
.grafico-area { fill: color-mix(in srgb, var(--primary) 16%, transparent); stroke: none; }
.grafico-eixo-texto { fill: var(--text-muted); font-size: 10px; font-family: var(--font-sans); }
.ranking-linha { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.ranking-linha:last-child { border-bottom: none; }
.ranking-pos { width: 22px; height: 22px; border-radius: 50%; background: var(--bg-alt); color: var(--text-muted); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ranking-barra-fundo { flex: 1; height: 8px; border-radius: 999px; background: var(--bg-alt); overflow: hidden; }
.ranking-barra-preenchida { height: 100%; background: var(--primary); border-radius: 999px; }
.ranking-valor { font-weight: 700; font-size: 12.5px; white-space: nowrap; }

/* ===========================================================================
   Microinterações "premium" — camada de polimento visual, injetada em toda
   página pelo api.js (barra de progresso, ripple e brilho dos botões) ou só
   na home (tilt 3D dos cartões de produto, skeleton de carregamento). Tudo
   aqui respeita "prefers-reduced-motion": quem pede menos animação recebe a
   versão estática/instantânea, sem perder função nenhuma.
=========================================================================== */

/* -------------------------------------------------------------------------
   Barra de progresso de leitura — finérrima, no topo da tela, preenchendo
   conforme a rolagem da página. Criada via JS (api.js) para valer em toda
   página sem precisar editar o HTML de cada uma.
------------------------------------------------------------------------- */
.scroll-progress {
  position: fixed; top: env(safe-area-inset-top, 0px); left: 0; height: 3px; width: 0%;
  background: var(--gradient-fartura); z-index: 1000; pointer-events: none;
  box-shadow: 0 0 10px -1px var(--glow);
  transition: width 0.12s ease-out, opacity 0.2s ease;
}
@media (prefers-reduced-motion: reduce) { .scroll-progress { transition: none; } }

/* -------------------------------------------------------------------------
   Ripple ao clicar em qualquer botão (.btn) — usa currentColor, então some
   claro em botão escuro (btn-primary) e escuro em botão claro (btn-secondary)
   automaticamente, sem precisar de uma cor por variante.
------------------------------------------------------------------------- */
.btn { overflow: hidden; }
.btn-ripple {
  position: absolute; border-radius: 50%; background: currentColor; opacity: 0.28;
  transform: translate(-50%, -50%) scale(0); pointer-events: none; will-change: transform, opacity;
  animation: btn-ripple-anim 0.55s ease-out forwards;
}
@keyframes btn-ripple-anim { to { transform: translate(-50%, -50%) scale(1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .btn-ripple { display: none; } }

/* -------------------------------------------------------------------------
   Brilho "spotlight" que segue o cursor dentro do botão principal — o
   api.js atualiza --mx/--my (posição do mouse relativa ao botão) a cada
   movimento; sem JS ou fora do hover, o brilho simplesmente não aparece.
------------------------------------------------------------------------- */
.btn-primary { --mx: 50%; --my: 50%; }
.btn-primary::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(circle 90px at var(--mx) var(--my), rgba(255,255,255,0.55), transparent 70%);
  opacity: 0; transition: opacity 0.35s ease;
}
.btn-primary:hover::after { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .btn-primary::after { display: none; } }

/* -------------------------------------------------------------------------
   Troca de tema com "revelação circular" (View Transitions API) — o círculo
   nasce exatamente no botão de tema e cresce até cobrir a tela. Em
   navegadores sem suporte (ou com "menos movimento" pedido), o api.js nem
   chama startViewTransition, então cai direto na troca instantânea de
   sempre — nada aqui é obrigatório para o tema funcionar.
------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root) { animation: none; }
  ::view-transition-new(root) {
    animation: tema-revelacao 0.6s cubic-bezier(.2, .7, .2, 1) forwards;
  }
  @keyframes tema-revelacao {
    from { clip-path: circle(0% at var(--tema-x, 50%) var(--tema-y, 50%)); }
    to   { clip-path: circle(140% at var(--tema-x, 50%) var(--tema-y, 50%)); }
  }
}

/* -------------------------------------------------------------------------
   Entrada do hero — título/legenda/botões "sobem" em cascata quando a
   página carrega (só CSS, dispara uma vez sozinho, sem depender do
   carrossel). Os slides fora de tela animam junto, mas isso é imperceptível
   já que só o primeiro está visível.
------------------------------------------------------------------------- */
@keyframes hero-entra { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.hero-eyebrow, .hero-title, .hero-subtitle, .hero-actions {
  animation: hero-entra 0.75s cubic-bezier(.2, .7, .2, 1) both;
}
.hero-eyebrow { animation-delay: 0.05s; }
.hero-title { animation-delay: 0.16s; }
.hero-subtitle { animation-delay: 0.32s; }
.hero-actions { animation-delay: 0.46s; }
@media (prefers-reduced-motion: reduce) {
  .hero-eyebrow, .hero-title, .hero-subtitle, .hero-actions { animation: none; }
}

/* -------------------------------------------------------------------------
   Tilt 3D + brilho nos cartões de produto da home — o landing.js aplica o
   ângulo via transform inline (rotateX/rotateY) seguindo o cursor; aqui só
   ficam a transição suave de retorno e o brilho que segue o mouse na foto.
   Em toque/sem mouse preciso, o card mantém só o efeito simples de sempre
   (levantar + zoom na foto), já existente mais acima neste arquivo.
------------------------------------------------------------------------- */
@media (hover: hover) and (pointer: fine) {
  .product-grid { perspective: 1400px; }
  .product-card { transition: transform 0.35s cubic-bezier(.2, .8, .2, 1), box-shadow 0.3s ease, border-color 0.3s ease; will-change: transform; }
}
.product-photo::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle 150px at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,0.5), transparent 60%);
  opacity: 0; transition: opacity 0.3s ease; mix-blend-mode: soft-light;
}
.product-card:hover .product-photo::after { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .product-card { transition: box-shadow 0.3s ease, border-color 0.3s ease; }
  .product-photo::after { display: none; }
}

/* -------------------------------------------------------------------------
   Skeleton de carregamento — substitui o "Carregando..." por blocos com um
   brilho passando por cima, no lugar exato onde os cartões de produto vão
   aparecer (mesma altura/raio), pra transição ficar suave assim que os
   dados chegam.
------------------------------------------------------------------------- */
.skeleton-card { position: relative; height: 300px; border-radius: var(--radius); overflow: hidden; background: var(--bg-alt); border: 1px solid var(--border); }
.skeleton-card::after {
  content: ''; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(110deg, transparent 20%, color-mix(in srgb, var(--gold) 30%, var(--card)) 50%, transparent 80%);
  animation: skeleton-sweep 1.5s ease-in-out infinite;
}
@keyframes skeleton-sweep { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .skeleton-card::after { animation: none; opacity: 0.5; transform: none; } }

/* -------------------------------------------------------------------------
   Selo de pagamento aprovado — círculo e "check" desenhados com traço
   animado (stroke-dashoffset), em vez do emoji estático de sempre.
------------------------------------------------------------------------- */
.check-anim { display: block; margin: 0 auto; }
.check-anim-circulo {
  fill: none; stroke: var(--success); stroke-width: 2.5;
  stroke-dasharray: 150; stroke-dashoffset: 150; animation: check-circulo 0.5s ease-out forwards;
}
.check-anim-marca {
  fill: none; stroke: var(--success); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 36; stroke-dashoffset: 36; animation: check-marca 0.35s ease-out 0.45s forwards;
}
@keyframes check-circulo { to { stroke-dashoffset: 0; } }
@keyframes check-marca { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .check-anim-circulo, .check-anim-marca { animation: none; stroke-dashoffset: 0; }
}

/* -------------------------------------------------------------------------
   Troca de seção no painel admin — como o admin.js já alterna cada <section>
   entre display:none e display:'' (ver mudarSecao em admin.js), basta uma
   animação de entrada na classe: o navegador a dispara sozinho toda vez que
   o elemento sai de display:none, sem precisar de nenhuma linha de JS extra.
------------------------------------------------------------------------- */
.secao-conteudo { animation: secao-entra 0.35s cubic-bezier(.2, .8, .2, 1); }
@keyframes secao-entra { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .secao-conteudo { animation: none; } }

/* Linha de tabela realçada ao passar o mouse — ajuda a acompanhar uma linha
   horizontalmente em tabelas largas (estoque), sem mexer em mais nada. */
@media (min-width: 641px) {
  .table-wrap tbody tr:hover { background: var(--bg-alt); }
}

/* -------------------------------------------------------------------------
   Contador de quantidade (pedido do cliente) — um "pop" rápido a cada
   clique em + / -, pra dar retorno tátil imediato de que o clique registrou,
   e o total do pedido pisca suavemente quando muda. pedido.js liga a classe
   e a remove depois (animationend) para poder tocar de novo no próximo clique.
------------------------------------------------------------------------- */
.qty-value.qty-pop { animation: qty-pop-anim 0.25s ease; }
@keyframes qty-pop-anim { 30% { transform: scale(1.35); color: var(--primary); } to { transform: scale(1); } }
#total-pedido.total-pop { animation: total-pop-anim 0.35s ease; }
@keyframes total-pop-anim { 30% { color: var(--gold); } to { color: inherit; } }
@media (prefers-reduced-motion: reduce) {
  .qty-value.qty-pop, #total-pedido.total-pop { animation: none; }
}
