/* ==========================================================================
   Empório de Minas — Design System (styles.css)
   Compartilhado entre index.html e checkout.php
   ========================================================================== */

/* ------------------------- Fontes (self-host / Google Fonts) ------------ */
/* Arquivos em /fonts (Bricolage Grotesque + Work Sans, licença OFL). */
@font-face { font-family:"Bricolage Grotesque"; src:url("fonts/BricolageGrotesque-Regular.ttf") format("truetype"); font-weight:400; font-style:normal; font-display:swap; }
@font-face { font-family:"Bricolage Grotesque"; src:url("fonts/BricolageGrotesque-Bold.ttf") format("truetype"); font-weight:600 800; font-style:normal; font-display:swap; }
@font-face { font-family:"Work Sans"; src:url("fonts/WorkSans-Regular.ttf") format("truetype"); font-weight:400 500; font-style:normal; font-display:swap; }
@font-face { font-family:"Work Sans"; src:url("fonts/WorkSans-Bold.ttf") format("truetype"); font-weight:600 800; font-style:normal; font-display:swap; }
@font-face { font-family:"Work Sans"; src:url("fonts/WorkSans-Italic.ttf") format("truetype"); font-weight:400; font-style:italic; font-display:swap; }

/* ----------------------------- Tokens ----------------------------------- */
:root {
  --c-cream:      #FBF7EF;
  --c-cream-2:    #F3EADA;
  --c-ink:        #2B2521;
  --c-ink-soft:   #6B5F54;
  --c-primary:    #B23A2E;   /* terracota / queijo curado */
  --c-primary-d:  #8E2C22;
  --c-gold:       #D4A24E;
  --c-gold-d:     #B8862F;
  --c-green:      #2E5339;   /* verde Minas */
  --c-line:       #E7DDCD;
  --c-white:      #FFFFFF;
  --c-success:    #2E8B57;

  --shadow-sm: 0 1px 3px rgba(43, 37, 33, .08);
  --shadow:    0 8px 24px rgba(43, 37, 33, .10);
  --shadow-lg: 0 18px 50px rgba(43, 37, 33, .18);

  --radius:   14px;
  --radius-sm: 9px;
  --radius-lg: 24px;

  --maxw: 1200px;
  --font-head: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Work Sans", "Segoe UI", system-ui, sans-serif;

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

/* ----------------------------- Reset ------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  color: var(--c-ink);
  background: var(--c-cream);
  line-height: 1.6;
  font-size: 16px;
  overflow-x: hidden;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, a, [role="button"] { touch-action: manipulation; } /* remove 300ms tap delay */
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul { list-style: none; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }

h1, h2, h3 { font-family: var(--font-head); line-height: 1.12; font-weight: 700; letter-spacing: -0.015em; font-optical-sizing: auto; }

/* Foco visível para navegação por teclado (acessibilidade) */
:focus-visible { outline: 3px solid var(--c-gold); outline-offset: 2px; border-radius: 4px; }
.btn:focus-visible, .cart-btn:focus-visible { outline-offset: 3px; }

/* Tabular figures: preços/valores/timers não "dançam" ao mudar */
.tnum, .pcard-price, .cl-total, .drawer-foot .val { font-variant-numeric: tabular-nums; }

/* Respeita usuários que pedem menos movimento */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* ----------------------------- Layout ----------------------------------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }
.section { padding: 72px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.section-head .eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--c-gold-d); margin-bottom: 10px;
}
.section-head h2 { font-size: clamp(1.8rem, 4vw, 2.7rem); color: var(--c-ink); }
.section-head p { color: var(--c-ink-soft); margin-top: 12px; font-size: 1.05rem; }

/* ----------------------------- Botões ----------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 14px 26px; border-radius: 50px; font-weight: 600; font-size: .98rem;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s;
  white-space: nowrap; text-align: center;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: var(--c-primary); color: #fff; box-shadow: 0 6px 18px rgba(178,58,46,.32); }
.btn-primary:hover { background: var(--c-primary-d); transform: translateY(-2px); box-shadow: 0 10px 26px rgba(178,58,46,.40); }
.btn-gold { background: var(--c-gold); color: #3a2c10; box-shadow: 0 6px 18px rgba(212,162,78,.4); }
.btn-gold:hover { background: var(--c-gold-d); color:#fff; transform: translateY(-2px); }
.btn-ghost { background: var(--c-white); color: var(--c-ink); border: 1.5px solid var(--c-line); }
.btn-ghost:hover { border-color: var(--c-primary); color: var(--c-primary); }
.btn-block { width: 100%; }
.btn-lg { padding: 17px 34px; font-size: 1.05rem; }

/* ----------------------------- Header ----------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(251,247,239,.88); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--c-line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 74px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; box-shadow: var(--shadow-sm); background:#fff; }
.brand .brand-fallback {
  width:46px;height:46px;border-radius:50%;display:none;place-items:center;
  background:var(--c-green);color:var(--c-gold);font-family:var(--font-head);font-weight:700;font-size:1.3rem;
}
.brand .brand-name { font-family: var(--font-head); font-weight: 700; font-size: 1.25rem; color: var(--c-ink); line-height: 1; }
.brand .brand-sub { font-size: .66rem; letter-spacing: .22em; text-transform: uppercase; color: var(--c-gold-d); }
.main-nav { display: flex; gap: 28px; }
.main-nav a { font-weight: 500; font-size: .95rem; color: var(--c-ink-soft); transition: color .15s; }
.main-nav a:hover { color: var(--c-primary); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.cart-btn { position: relative; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--c-white); box-shadow: var(--shadow-sm); transition: transform .15s; }
.cart-btn:hover { transform: scale(1.06); }
.cart-btn svg { width: 22px; height: 22px; }
.cart-count {
  position: absolute; top: -4px; right: -4px; min-width: 21px; height: 21px; padding: 0 5px;
  background: var(--c-primary); color: #fff; border-radius: 50px; font-size: .72rem; font-weight: 700;
  display: grid; place-items: center; border: 2px solid var(--c-cream);
}
.nav-toggle { display: none; }

/* ----------------------------- Cart Drawer ------------------------------ */
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(43,37,33,.5); z-index: 90;
  opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s;
}
.drawer-overlay.open { opacity: 1; visibility: visible; }
.cart-drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: 420px; max-width: 92vw; z-index: 100;
  background: var(--c-cream); box-shadow: var(--shadow-lg); transform: translateX(100%);
  transition: transform .35s var(--ease); display: flex; flex-direction: column;
}
.cart-drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 22px 16px; border-bottom: 1px solid var(--c-line); }
.drawer-head h3 { font-size: 1.3rem; }
.drawer-close { font-size: 1.6rem; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--c-ink-soft); }
.drawer-close:hover { background: var(--c-cream-2); }
.drawer-body { flex: 1; overflow-y: auto; padding: 14px 22px; }
.drawer-empty { text-align: center; padding: 60px 10px; color: var(--c-ink-soft); }
.drawer-empty svg { width: 64px; height: 64px; opacity: .35; margin-bottom: 14px; }
.cart-line { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--c-line); }
.cart-line img { width: 64px; height: 64px; border-radius: var(--radius-sm); object-fit: cover; }
.cart-line .cl-name { font-weight: 600; font-size: .92rem; }
.cart-line .cl-var { display: inline-block; font-size: .7rem; font-weight: 700; color: var(--c-green); background: #eaf1eb; padding: 1px 8px; border-radius: 50px; vertical-align: middle; }
.cart-line .cl-price { color: var(--c-ink-soft); font-size: .85rem; }
.cl-qty { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; background: var(--c-white); border: 1px solid var(--c-line); border-radius: 50px; padding: 2px; }
.cl-qty button { width: 26px; height: 26px; border-radius: 50%; font-weight: 700; color: var(--c-primary); }
.cl-qty button:hover { background: var(--c-cream-2); }
.cl-qty span { min-width: 20px; text-align: center; font-weight: 600; font-size: .9rem; }
.cl-right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; }
.cl-total { font-weight: 700; }
.cl-remove { font-size: .78rem; color: var(--c-ink-soft); text-decoration: underline; }
.cl-remove:hover { color: var(--c-primary); }
.drawer-foot { padding: 18px 22px 24px; border-top: 1px solid var(--c-line); background: var(--c-cream-2); }
.drawer-foot .row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.drawer-foot .row .label { color: var(--c-ink-soft); }
.drawer-foot .row .val { font-family: var(--font-head); font-size: 1.5rem; font-weight: 700; color: var(--c-primary); }

/* ----------------------------- Star rating ------------------------------ */
.stars { display: inline-flex; gap: 2px; color: var(--c-gold); }
.stars svg { width: 16px; height: 16px; }

/* ----------------------------- Footer ----------------------------------- */
.site-footer { background: var(--c-ink); color: #E9E1D6; padding: 64px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 1.8fr 1fr 1.2fr; gap: 40px; }
.site-footer h4 { font-family: var(--font-body); font-weight: 700; font-size: 1rem; margin-bottom: 18px; color: #fff; letter-spacing: .02em; }
.site-footer a, .site-footer p, .site-footer li { color: #C9BFB2; font-size: .92rem; }
.site-footer ul li { margin-bottom: 10px; }
.site-footer a:hover { color: var(--c-gold); }
.footer-brand .brand-name { color: #fff; font-family: var(--font-head); font-size: 1.4rem; }
.footer-brand p { margin-top: 14px; max-width: 320px; }
.pay-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: #9C9286; margin: 0 0 12px; }
.pay-methods { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.pay-badge {
  display: inline-flex; align-items: center; gap: 7px; background: #fff; color: #2B2521;
  border-radius: 8px; padding: 8px 12px; font-weight: 700; font-size: .85rem; box-shadow: var(--shadow-sm);
}
.pay-badge svg { height: 20px; width: auto; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 44px; padding-top: 22px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: .82rem; color: #9C9286; }

/* ----------------------------- Utilidades ------------------------------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.no-scroll { overflow: hidden; }

/* ----------------------------- Responsivo ------------------------------- */
@media (max-width: 860px) {
  .main-nav { display: none; }
  .nav-toggle { display: grid; place-items: center; width: 46px; height: 46px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-brand { grid-column: 1 / -1; }
  .section { padding: 56px 0; }
}
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
  .section { padding: 46px 0; }
  /* Alvos de toque >= 44px no mobile (skill: touch-target-size) */
  .cl-qty button { width: 40px; height: 40px; font-size: 1.15rem; }
  .cl-remove { padding: 8px 4px; display: inline-block; }
  .main-nav a, #mobileNav a { min-height: 44px; display: flex; align-items: center; }
  .footer-bottom { justify-content: flex-start; }
}
