/* =========================================================================
   BASE — tokens de design, reset e componentes compartilhados
   Abordagem MOBILE FIRST: o padrão é o celular; media queries só ampliam.
   ========================================================================= */

:root {
  /* Cores da marca — sobrescritas em runtime por FC.u.applyTheme()
     a partir de Configurações > Aparência no painel ADM. */
  --brand:        #A8123E;
  --brand-rgb:    168, 18, 62;
  --brand-dark:   #79082A;
  --brand-soft:   #F7DCE4;
  --brand-softer: #FDF0F3;
  --sage:         #4C6B57;
  --sage-soft:    #E1EBE3;
  --gold:         #D4A32E;
  --gold-soft:    #FBF1D8;

  --wa:      #25D366;
  --wa-dark: #1DA851;

  /* Gradientes de destaque */
  --grad-brand: linear-gradient(135deg, #C4224F 0%, var(--brand) 55%, var(--brand-dark) 100%);
  --grad-gold:  linear-gradient(135deg, #EFCE79 0%, var(--gold) 55%, #A87C14 100%);
  --grad-ink:   linear-gradient(150deg, #2B141C 0%, #40151F 55%, var(--brand-dark) 130%);

  /* Neutros quentes com fundo levemente plum */
  --ink:      #201017;
  --ink-2:    #4A3740;
  --ink-3:    #705F68;
  --ink-4:    #9C8B93;
  --line:     #EDE2E4;
  --line-2:   #F6EEF0;
  --surface:  #FFFFFF;
  --bg:       #FFFBFB;
  --bg-2:     #F9EFEF;

  --ok:    #1F7A4D;
  --warn:  #B77800;
  --danger:#C0392B;

  /* Tipografia */
  --font-display: 'Playfair Display', 'Georgia', 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;

  /* Escala (mobile) */
  --fs-xs:  .75rem;
  --fs-sm:  .8125rem;
  --fs-md:  .9375rem;
  --fs-lg:  1.0625rem;
  --fs-xl:  1.25rem;
  --fs-2xl: 1.5rem;
  --fs-3xl: 1.875rem;

  /* Espaçamento */
  --sp-1: .25rem; --sp-2: .5rem;  --sp-3: .75rem; --sp-4: 1rem;
  --sp-5: 1.25rem; --sp-6: 1.5rem; --sp-8: 2rem;  --sp-10: 2.75rem;
  --sp-12: 3.5rem;

  /* Raios e sombras */
  --r-sm: 8px; --r-md: 12px; --r-lg: 18px; --r-xl: 24px; --r-pill: 999px;
  --sh-1: 0 1px 2px rgba(32,16,23,.05), 0 1px 3px rgba(32,16,23,.06);
  --sh-2: 0 2px 6px rgba(32,16,23,.07), 0 8px 22px rgba(32,16,23,.08);
  --sh-3: 0 4px 12px rgba(32,16,23,.09), 0 22px 48px rgba(32,16,23,.13);
  --sh-brand: 0 8px 24px rgba(var(--brand-rgb), .32);

  --header-h: 60px;
  --tabbar-h: 62px;
  --wrap: 1200px;

  --ease: cubic-bezier(.22,.61,.36,1);
}

@media (min-width: 768px) {
  :root {
    --fs-md: 1rem; --fs-lg: 1.125rem; --fs-xl: 1.5rem;
    --fs-2xl: 2rem; --fs-3xl: 2.75rem;
    --header-h: 76px;
  }
}

/* ------------------------------- reset --------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 600; line-height: 1.2; letter-spacing: -.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 3px solid rgba(var(--brand-rgb), .45); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--brand-soft); }

/* scrollbar discreta (desktop) */
@media (min-width: 1024px) {
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-thumb { background: #DFD6D2; border-radius: 8px; border: 3px solid var(--bg); }
  ::-webkit-scrollbar-track { background: transparent; }
}

/* ------------------------------ utilitários ---------------------------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--sp-4); }
@media (min-width: 768px) { .wrap { padding-inline: var(--sp-6); } }
@media (min-width: 1280px) { .wrap { padding-inline: var(--sp-8); } }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.is-hidden { display: none !important; }
.stack > * + * { margin-top: var(--sp-3); }
.muted { color: var(--ink-3); }
.nowrap { white-space: nowrap; }

/* ------------------------------- botões -------------------------------- */
.btn {
  --btn-bg: var(--brand); --btn-fg: #fff; --btn-bd: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: .7rem 1.15rem;
  background: var(--btn-bg); color: var(--btn-fg);
  border: 1.5px solid var(--btn-bd);
  border-radius: var(--r-pill);
  font-size: var(--fs-md); font-weight: 600; letter-spacing: .01em; line-height: 1.25;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease), opacity .18s;
  -webkit-tap-highlight-color: transparent;
  text-align: center;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; pointer-events: none; }
@media (hover: hover) { .btn:hover { box-shadow: var(--sh-2); filter: brightness(1.04); } }

.btn--primary   { background: var(--grad-brand); box-shadow: var(--sh-brand); }
.btn--gold      { background: var(--grad-gold); --btn-fg: #3D2C05; box-shadow: 0 8px 24px rgba(212,163,46,.35); }
.btn--light     { --btn-bg: #fff; --btn-fg: var(--brand-dark); box-shadow: 0 8px 24px rgba(32,16,23,.18); }
.btn--dark      { --btn-bg: var(--ink); }
.btn--wa        { --btn-bg: var(--wa); --btn-fg: #06301A; box-shadow: 0 8px 22px rgba(37,211,102,.32); }
.btn--wa svg    { fill: #06301A; }
.btn--outline   { --btn-bg: transparent; --btn-fg: var(--brand); --btn-bd: rgba(var(--brand-rgb), .35); }
.btn--ghost     { --btn-bg: var(--bg-2); --btn-fg: var(--ink-2); }
.btn--soft      { --btn-bg: var(--brand-soft); --btn-fg: var(--brand-dark); }
.btn--danger    { --btn-bg: transparent; --btn-fg: var(--danger); --btn-bd: rgba(192,57,43,.3); }
.btn--sm        { min-height: 40px; padding: .45rem .9rem; font-size: var(--fs-sm); }
.btn--xs        { min-height: 34px; padding: .3rem .7rem; font-size: var(--fs-xs); border-radius: var(--r-sm); }
.btn--block     { display: flex; width: 100%; }
.btn--square    { min-width: 48px; padding: .5rem; border-radius: var(--r-md); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 44px; height: 44px; border-radius: var(--r-pill);
  color: var(--ink-2); transition: background .18s, color .18s, transform .18s;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:active { transform: scale(.92); }
@media (hover: hover) { .icon-btn:hover { background: var(--bg-2); color: var(--brand); } }

/* --------------------------------- tags -------------------------------- */
.tag {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .55rem; border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: .03em;
  background: var(--bg-2); color: var(--ink-3); text-transform: uppercase;
  white-space: nowrap;
}
.tag--offer   { background: var(--grad-brand); color: #fff; box-shadow: 0 3px 10px rgba(var(--brand-rgb), .35); }
.tag--gold    { background: var(--grad-gold); color: #3D2C05; }
.tag--sage    { background: var(--sage-soft); color: #2F4A3C; }
.tag--ok      { background: #E4F3EA; color: var(--ok); }
.tag--off     { background: #F0EDEB; color: var(--ink-4); }
.tag--danger  { background: #FBE9E7; color: var(--danger); }

/* -------------------------------- toast -------------------------------- */
.toast-host {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + 14px + env(safe-area-inset-bottom, 0px));
  z-index: 2000; display: flex; flex-direction: column; gap: .5rem;
  width: min(420px, calc(100vw - 24px)); pointer-events: none;
}
@media (min-width: 768px) { .toast-host { bottom: 24px; } }
.toast {
  display: flex; align-items: center; gap: .6rem;
  padding: .75rem 1rem; border-radius: var(--r-md);
  background: var(--ink); color: #fff; font-size: var(--fs-sm); font-weight: 500;
  box-shadow: var(--sh-3);
  opacity: 0; transform: translateY(12px); transition: all .28s var(--ease);
}
.toast.is-in { opacity: 1; transform: translateY(0); }
.toast__i {
  display: grid; place-items: center; width: 20px; height: 20px; flex: 0 0 20px;
  border-radius: 50%; background: var(--wa); color: #06301A; font-size: 12px; font-weight: 900;
}
.toast--error .toast__i { background: #FF6B5B; color: #4A0F08; }
.toast--info  .toast__i { background: var(--gold); color: #4A3A05; }

/* ------------------------------- formulário ---------------------------- */
.field { display: block; }
.field + .field { margin-top: var(--sp-4); }
.field__label {
  display: block; margin-bottom: .35rem;
  font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2);
}
.field__hint { margin-top: .3rem; font-size: var(--fs-xs); color: var(--ink-4); line-height: 1.45; }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: .65rem .85rem;
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--r-md); font-size: var(--fs-md); color: var(--ink);
  transition: border-color .18s, box-shadow .18s;
  appearance: none;
}
.textarea { min-height: 104px; resize: vertical; line-height: 1.55; }
.select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236E6266' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .7rem center; background-size: 18px;
  padding-right: 2.3rem;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(var(--brand-rgb), .13);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-4); }

.check {
  display: flex; align-items: flex-start; gap: .65rem;
  padding: .7rem .8rem; border: 1.5px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); cursor: pointer; transition: all .18s;
  min-height: 48px;
}
.check input { margin: 0; width: 20px; height: 20px; flex: 0 0 20px; accent-color: var(--brand); margin-top: 1px; }
.check__t { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); line-height: 1.35; }
.check__d { display: block; font-size: var(--fs-xs); color: var(--ink-4); font-weight: 400; margin-top: .1rem; }
.check:has(input:checked) { border-color: var(--brand); background: var(--brand-softer); }
@media (hover: hover) { .check:hover { border-color: rgba(var(--brand-rgb), .4); } }

.switch { display: inline-flex; align-items: center; gap: .55rem; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
  width: 46px; height: 27px; border-radius: var(--r-pill); background: #D9D2CE;
  position: relative; transition: background .22s var(--ease); flex: 0 0 46px;
}
.switch__track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px;
  border-radius: 50%; background: #fff; box-shadow: var(--sh-1);
  transition: transform .22s var(--ease);
}
.switch input:checked + .switch__track { background: var(--ok); }
.switch input:checked + .switch__track::after { transform: translateX(19px); }
.switch input:focus-visible + .switch__track { box-shadow: 0 0 0 4px rgba(var(--brand-rgb), .2); }
.switch__label { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }

/* --------------------------- stepper de quantidade --------------------- */
.qty {
  display: inline-flex; align-items: center; gap: 0;
  border: 1.5px solid var(--line); border-radius: var(--r-pill);
  background: var(--surface); overflow: hidden;
}
.qty button {
  width: 42px; height: 42px; display: grid; place-items: center;
  font-size: 1.2rem; font-weight: 600; color: var(--ink-2); line-height: 1;
  transition: background .15s;
}
.qty button:active { background: var(--bg-2); }
.qty button:disabled { color: var(--ink-4); opacity: .5; }
.qty span {
  min-width: 34px; text-align: center; font-weight: 700;
  font-size: var(--fs-md); font-variant-numeric: tabular-nums;
}

/* --------------------------- overlay / modal base ---------------------- */
.overlay {
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(28, 22, 24, .55);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity .25s var(--ease);
}
.overlay.is-open { opacity: 1; pointer-events: auto; }

/* --------------------------- barra de progresso ------------------------ */
.bar { height: 8px; border-radius: var(--r-pill); background: var(--bg-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: var(--r-pill); background: var(--brand); }

/* ------------------------------ skeleton ------------------------------- */
@keyframes fc-shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
.skeleton {
  background: linear-gradient(90deg, #F1EBE8 25%, #F8F4F2 50%, #F1EBE8 75%);
  background-size: 800px 100%; animation: fc-shimmer 1.4s infinite linear;
  border-radius: var(--r-md);
}

/* ------------------------------ animações ------------------------------ */
@keyframes fc-fade-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fc-pop { 0% { transform: scale(.85); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
/* Os títulos de seção começam invisíveis e surgem quando entram na tela.
   A classe .reveal é posta pelo JavaScript, então quando o script não roda nada
   fica escondido — esse caminho é seguro. O risco é o outro: o script rodar,
   esconder os blocos, e o observador não disparar para algum deles (aba aberta
   em segundo plano, âncora que pula direto para o meio da página, falha no
   meio do caminho). Aí o título ficaria invisível para sempre.
   Daí a rede de segurança: passados 3 segundos o bloco aparece sozinho, tenha
   o observador disparado ou não. Quem rolar até ele depois ainda vê a animação,
   porque .is-in tem precedência. */
/* Fica em zero quase até o fim e só então acende. Usar duração 0s com atraso
   de 3s não funciona: o navegador não considera que a animação chegou a rodar
   e o "forwards" nunca é aplicado. */
@keyframes fc-reveal-safety { 0%, 97% { opacity: 0; } 100% { opacity: 1; } }
.reveal { opacity: 0; animation: fc-reveal-safety 3s linear forwards; }
.reveal.is-in { animation: fc-fade-up .55s var(--ease) forwards; }
/* Quem pediu menos animação não deveria depender de animação para enxergar. */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; animation: none; }
}
