/* ============================================================
   EMBUTIDOS DEL CORRAL — visual design pass (2026)
   Direction: butcher's ledger meets smokehouse at dusk.
   Brand red/gold come from --brand-primary/--brand-accent,
   injected per-deployment from Settings.Theme in partial_head —
   never hardcoded here, so this stays white-label.
   Every price/weight/stat is set in tabular mono type — the
   "ledger" idea: on a wholesale supplier site, the numbers ARE
   the trust signal, not decoration.
   ============================================================ */

:root {
  --ember: var(--brand-primary, #8b1a1a);
  --ember-bright: #a31f1f;
  --gold: var(--brand-accent, #d4a017);
  --gold-line: #b9862a;

  --ink: #241a13;
  --ink-soft: #4a3a2c;
  --bg: #ede6d3;
  --surface: #f6f1e4;
  --surface-2: #e4dcc5;
  --border: #d8cda9;
  --muted: #6b5c48;
  --wa: #1f8a4c;

  --radius: 10px;
  --radius-lg: 20px;
  --shadow: 0 6px 20px rgba(36, 26, 19, 0.1);
  --shadow-lg: 0 20px 50px rgba(36, 26, 19, 0.22);

  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-head: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  --font-ledger: ui-monospace, "SF Mono", Menlo, "Cascadia Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ember-bright: #e15b4c;
    --gold-line: #e0b23a;
    --ink: #efe7d6;
    --ink-soft: #c7b8a2;
    --bg: #17110d;
    --surface: #221a13;
    --surface-2: #2b2119;
    --border: #3a2d20;
    --muted: #a99c8e;
    --shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.1; font-weight: 700; letter-spacing: -0.01em; text-wrap: balance; }
.num { font-family: var(--font-ledger); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.eyebrow {
  font-family: var(--font-ledger); font-size: 11px; font-weight: 600; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--gold); display: block; margin-bottom: 8px;
}

.container { max-width: 1140px; margin: 0 auto; padding: 0 18px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: 9px; text-decoration: none; cursor: pointer;
  border: 1.5px solid transparent; font: 600 14.5px/1 var(--font-body);
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ember); color: #fff; }
.btn-primary:hover { background: var(--ember-bright); }
.btn-accent { background: var(--gold); color: #241a13; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18); }
.btn-accent:hover { background: var(--gold-line); }
.btn-ghost { background: transparent; color: #efe7d6; border-color: rgba(239, 231, 214, 0.4); }
.btn-ghost:hover { border-color: rgba(239, 231, 214, 0.8); }
.btn-whatsapp { background: #25d366; color: #fff; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(23, 17, 13, 0.94); color: #efe7d6;
  backdrop-filter: blur(10px); border-bottom: 1px solid rgba(239, 231, 214, 0.08);
}
.site-header .container { display: flex; align-items: center; gap: 14px; padding: 12px 18px; }
.site-header .logo { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 1.5px solid var(--gold); flex-shrink: 0; }
.site-header .brand { font-family: var(--font-head); font-weight: 700; font-size: 16.5px; flex: 1; min-width: 0; color: #efe7d6; }
.site-header nav { display: flex; gap: 22px; font-size: 13.5px; font-weight: 500; color: #d8cdb7; }
.site-header nav a { position: relative; padding: 4px 0; }
.site-header nav a::after { content: ""; position: absolute; left: 0; bottom: -3px; width: 0; height: 1.5px; background: var(--gold); transition: width 0.2s; }
.site-header nav a:hover::after { width: 100%; }
.cart-button {
  position: relative; background: transparent; color: #efe7d6; border: 1.5px solid rgba(239, 231, 214, 0.3);
  border-radius: 9px; width: 42px; height: 42px; font-size: 17px; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.cart-badge {
  position: absolute; top: -7px; right: -7px; background: var(--gold); color: #241a13;
  border-radius: 999px; min-width: 19px; height: 19px; font: 700 10.5px/19px var(--font-ledger);
  text-align: center; padding: 0 3px;
}
@media (max-width: 760px) { .site-header nav { display: none; } }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; color: #efe7d6; text-align: left; padding: 56px 0 60px;
  background: radial-gradient(130% 100% at 75% 0%, #3a1414 0%, #231410 55%, #17110d 100%);
}
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0.55; }
.hero .container { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 44px; align-items: center; }
.hero-copy { max-width: 46ch; }
.stamp {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  width: 92px; height: 92px; border-radius: 50%; border: 2px solid var(--gold); position: relative;
  transform: rotate(-7deg); margin-bottom: 20px; flex-shrink: 0;
}
.stamp::before { content: ""; position: absolute; inset: 6px; border: 1px dashed rgba(212, 160, 23, 0.55); border-radius: 50%; }
.stamp b { font-family: var(--font-ledger); font-size: 18px; color: var(--gold); line-height: 1; }
.stamp span { font-family: var(--font-ledger); font-size: 7.5px; letter-spacing: 0.08em; text-transform: uppercase; color: #d8cdb7; margin-top: 2px; text-align: center; }
.hero h1 { font-size: clamp(32px, 6.4vw, 56px); margin-bottom: 16px; max-width: 12ch; }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero p { color: #d8cdb7; font-size: clamp(15px, 2.1vw, 17px); margin: 0 0 24px; max-width: 46ch; }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 26px; }
.trust-row {
  display: flex; flex-wrap: wrap; font-family: var(--font-ledger); font-size: 12px; color: #b9ac97;
  border-top: 1px solid rgba(239, 231, 214, 0.15); padding-top: 16px;
}
.trust-row .t { padding: 2px 16px 2px 0; margin-right: 16px; border-right: 1px solid rgba(239, 231, 214, 0.15); }
.trust-row .t:last-child { border: none; margin: 0; }
.hero-media { position: relative; z-index: 1; }
.hero-media img { width: 100%; height: 420px; object-fit: cover; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); border: 1px solid rgba(212, 160, 23, 0.3); }
.hero-media .float {
  position: absolute; left: -16px; bottom: 24px; background: var(--surface); color: var(--ink);
  border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px;
}
.hero-media .float b { font-family: var(--font-ledger); font-size: 24px; color: var(--ember); line-height: 1; }
.hero-media .float small { font-size: 10.5px; color: var(--muted); line-height: 1.3; }
@media (max-width: 820px) {
  .hero .container { grid-template-columns: 1fr; gap: 26px; }
  .hero-media { order: -1; }
  .hero-media img { height: 220px; }
  .hero { padding: 36px 0 44px; }
  .stamp { width: 78px; height: 78px; }
}

/* ---------- Stats strip ---------- */
.stats { background: #1f1712; color: #efe7d6; }
@media (prefers-color-scheme: dark) { .stats { background: var(--surface); } }
.stats .container { display: grid; grid-template-columns: repeat(4, 1fr); border-left: 1px solid rgba(239, 231, 214, 0.12); padding: 0; }
.stat { text-align: center; padding: 22px 10px; border-right: 1px solid rgba(239, 231, 214, 0.12); }
.stat b { display: block; font-family: var(--font-ledger); font-size: clamp(20px, 4.4vw, 28px); color: var(--gold); font-weight: 700; }
.stat span { font-family: var(--font-ledger); font-size: 10px; letter-spacing: 0.07em; text-transform: uppercase; color: #b9ac97; }
@media (max-width: 560px) { .stats .container { grid-template-columns: repeat(2, 1fr); } .stat:nth-child(2) { border-right: none; } }

/* ---------- Section shell ---------- */
.block { padding: 60px 0; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.sec-head h2 { font-size: clamp(24px, 4vw, 34px); margin: 0 0 8px; max-width: 18ch; }
.sec-head p { color: var(--muted); font-size: 14.5px; max-width: 46ch; margin: 0; }
.link-more {
  font-family: var(--font-ledger); font-size: 12.5px; color: var(--ember); white-space: nowrap;
  border-bottom: 1px solid currentColor; padding-bottom: 2px;
}

/* ---------- Category filters ---------- */
.chips { display: flex; gap: 9px; overflow-x: auto; padding: 2px 0 12px; margin: 0 0 22px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  white-space: nowrap; border: 1.5px solid var(--border); background: var(--surface); color: var(--ink);
  padding: 9px 16px; border-radius: 7px; font: 600 13px/1 var(--font-ledger); letter-spacing: 0.02em;
  cursor: pointer; flex-shrink: 0; transition: border-color 0.15s;
}
.chip:hover { border-color: var(--gold); }
.chip.active { background: var(--ember); color: #fff; border-color: var(--ember); }

/* ---------- Product / recipe grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; padding: 0; }
.card {
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; background: var(--surface);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card-media {
  height: 148px; position: relative; overflow: hidden;
  background: linear-gradient(150deg, #2b1b12, #4a1414 55%, #7a3010);
  display: flex; align-items: center; justify-content: center;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media .no-image { color: rgba(239, 231, 214, 0.55); font-size: 34px; }
.card-media .cat-tag {
  position: absolute; top: 10px; left: 10px; background: rgba(23, 17, 13, 0.72); color: var(--gold);
  font: 600 9.5px/1 var(--font-ledger); letter-spacing: 0.1em; text-transform: uppercase; padding: 5px 8px; border-radius: 4px;
}
.card-body { padding: 14px 15px 16px; flex: 1; display: flex; flex-direction: column; gap: 7px; }
.card-body h3 { font-family: var(--font-body); font-weight: 700; font-size: 15px; margin: 0; line-height: 1.3; }
.card-body h3 a { color: var(--ink); }
.card-body p { font-size: 12.5px; color: var(--muted); line-height: 1.45; margin: 0; flex: 1; }
.card-body .price {
  font-family: var(--font-ledger); font-weight: 700; font-size: 19px; color: var(--ember);
  border-top: 1px dashed var(--border); padding-top: 8px; margin-top: 2px; display: block;
}
.card-body .unit { font-family: var(--font-ledger); font-size: 11px; color: var(--muted); }
.card-body .add-btn {
  margin-top: 6px; background: transparent; color: var(--ember); border: 1.5px solid var(--ember);
  border-radius: 7px; padding: 9px; font: 600 12.5px/1 var(--font-ledger); letter-spacing: 0.04em;
  text-transform: uppercase; cursor: pointer; transition: background 0.15s, color 0.15s; width: 100%;
}
.card-body .add-btn:hover { background: var(--ember); color: #fff; }
.card-body .add-btn.added { background: var(--wa); border-color: var(--wa); color: #fff; }

/* ---------- How-to-order (genuine 3-step sequence) ---------- */
.howto { background: var(--surface-2); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.step { background: var(--surface); padding: 26px 22px; }
.step .n { font-family: var(--font-ledger); font-size: 12px; color: var(--gold); letter-spacing: 0.1em; margin-bottom: 12px; }
.step h3 { font-family: var(--font-body); font-weight: 700; font-size: 16.5px; margin: 0 0 6px; }
.step p { font-size: 13.5px; color: var(--muted); margin: 0; }
@media (max-width: 720px) { .steps { grid-template-columns: 1fr; } }

/* ---------- About / authenticity band ---------- */
.about { background: #1f1712; color: #efe7d6; }
@media (prefers-color-scheme: dark) { .about { background: var(--surface); } }
.about-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 44px; align-items: center; }
.about-media img { width: 100%; height: 340px; object-fit: cover; border-radius: var(--radius-lg); border: 1px solid rgba(212, 160, 23, 0.2); }
.about h2 { color: #efe7d6; font-size: clamp(24px, 4vw, 34px); margin: 0 0 16px; max-width: 18ch; }
.about h2 em { color: var(--gold); font-style: normal; }
.about p { color: #c7b8a2; font-size: 15px; margin: 0 0 14px; max-width: 46ch; }
.about .marks { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.about .marks .stamp { width: 62px; height: 62px; margin: 0; transform: none; }
.about .marks .stamp b { font-size: 11.5px; }
.about .marks .stamp span { font-size: 6.5px; }
@media (max-width: 820px) { .about-grid { grid-template-columns: 1fr; gap: 26px; } .about-media img { height: 220px; } }

/* ---------- Contact teaser + map ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.info-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; }
.info-card h3 { font-family: var(--font-body); font-weight: 700; font-size: 17.5px; margin: 0 0 18px; }
.info-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.info-row:last-of-type { border: none; }
.info-row b { display: block; font-size: 13px; }
.info-row span { color: var(--muted); font-size: 13px; }
.social { display: flex; gap: 9px; margin-top: 20px; }
.social a {
  width: 40px; height: 40px; border-radius: 8px; background: var(--surface-2); color: var(--ember);
  display: flex; align-items: center; justify-content: center; font-size: 17px; transition: background 0.15s, color 0.15s;
}
.social a:hover { background: var(--ember); color: #fff; }
.map-embed { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; min-height: 260px; box-shadow: var(--shadow); }
.map-embed iframe { width: 100%; height: 100%; min-height: 260px; border: 0; display: block; }
@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer { background: #1f1712; color: #b9ac97; padding: 40px 0 32px; font-size: 13.5px; margin-top: 0; }
@media (prefers-color-scheme: dark) { .site-footer { background: var(--surface); } }
.site-footer .container { padding: 0 18px; }
.site-footer p { margin: 0 0 8px; }
.site-footer .social a { background: rgba(239, 231, 214, 0.08); color: #efe7d6; }
.site-footer .social a:hover { background: var(--ember); color: #fff; }

/* ---------- Cart drawer ---------- */
.cart-backdrop { position: fixed; inset: 0; background: rgba(23, 17, 13, 0.6); z-index: 100; }
.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw);
  background: var(--bg); z-index: 101; display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.cart-drawer-header { padding: 18px; background: #1f1712; color: #efe7d6; display: flex; justify-content: space-between; align-items: center; }
@media (prefers-color-scheme: dark) { .cart-drawer-header { background: var(--surface-2); } }
.cart-drawer-header strong { font-family: var(--font-head); font-size: 19px; }
.cart-drawer-body { flex: 1; overflow-y: auto; padding: 14px 18px; }
.cart-item { display: flex; gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.cart-item .name { flex: 1; font-size: 13.5px; font-weight: 600; }
.cart-drawer-footer { padding: 16px 18px; border-top: 1px solid var(--border); background: var(--surface); }
.cart-drawer-footer strong { font-family: var(--font-ledger); color: var(--ember); }
.qty-btn {
  width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface);
  color: var(--ink); cursor: pointer; font-family: var(--font-ledger); font-size: 14px;
}

/* ---------- Chat widget ---------- */
.chat-fab {
  position: fixed; bottom: 22px; right: 20px; width: 58px; height: 58px; border-radius: 50%;
  background: var(--ember); color: #fff; border: none; font-size: 24px; cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35); z-index: 90; transition: transform 0.15s;
}
.chat-fab:hover { transform: scale(1.06); }
.chat-window {
  position: fixed; bottom: 92px; right: 20px; width: min(360px, 92vw); height: min(500px, 72vh);
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg);
  z-index: 91; display: flex; flex-direction: column; overflow: hidden;
}
.chat-header { background: #1f1712; color: #efe7d6; padding: 14px 16px; font-weight: 700; font-size: 14.5px; }
@media (prefers-color-scheme: dark) { .chat-header { background: var(--surface-2); } }
.chat-body { flex: 1; overflow-y: auto; padding: 14px; font-size: 13.5px; background: var(--bg); }
.chat-msg { margin-bottom: 10px; max-width: 85%; }
.chat-msg.user { margin-left: auto; text-align: right; }
.chat-msg .bubble { display: inline-block; padding: 10px 13px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); line-height: 1.45; }
.chat-msg.user .bubble { background: var(--ember); color: #fff; border-color: var(--ember); }
.chat-input { display: flex; gap: 8px; border-top: 1px solid var(--border); padding: 10px; background: var(--surface); }
.chat-input input {
  flex: 1; border: 1px solid var(--border); border-radius: 8px; padding: 10px 13px; font-size: 13.5px;
  font-family: var(--font-body); background: var(--bg); color: var(--ink); outline: none;
}
.chat-input input:focus { border-color: var(--gold); }
.chat-input button { border: none; background: var(--ember); color: #fff; border-radius: 8px; width: 38px; cursor: pointer; }

/* ---------- Sticky mobile CTA bar ---------- */
.mobile-cta-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; display: none; gap: 10px; align-items: center;
  background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.15);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
}
.mobile-cta-bar .cat-btn { flex: 1; background: var(--surface-2); color: var(--ink); border: none; border-radius: 8px; padding: 12px; font: 600 13.5px/1 var(--font-ledger); cursor: pointer; }
.mobile-cta-bar .cart-btn-wide {
  flex: 1.3; background: var(--ember); color: #fff; border: none; border-radius: 8px; padding: 12px;
  font: 600 13.5px/1 var(--font-ledger); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
}
@media (max-width: 760px) { .mobile-cta-bar { display: flex; } .chat-fab { bottom: 82px; } }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- Admin ---------- */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar { width: 200px; background: var(--ink); color: #fff; padding: 16px; flex-shrink: 0; }
.admin-sidebar a { display: block; color: #d8cdb7; text-decoration: none; padding: 8px 0; font-size: 14px; }
.admin-main { flex: 1; padding: 24px; background: var(--bg); min-height: 100vh; }
.admin-card { background: var(--surface); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
table th, table td { text-align: left; padding: 9px; border-bottom: 1px solid var(--border); }
.form-field { margin-bottom: 12px; display: flex; flex-direction: column; gap: 4px; }
.form-field label { font-family: var(--font-ledger); font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.form-field input, .form-field textarea, .form-field select {
  padding: 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 15px;
  font-family: inherit; background: var(--surface); color: var(--ink);
}

@media (max-width: 640px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; display: flex; overflow-x: auto; gap: 12px; }
  .admin-sidebar a { padding: 8px 4px; white-space: nowrap; }
}
