/* ==========================================================================
   Comestibles Lozano · Base compartida (tienda y panel)
   Paleta tomada de la propuesta (crema, café, ámbar) + rojo y verde del logo.
   ========================================================================== */

/* Fuentes alojadas en la tienda (subconjunto latin: incluye tildes, ñ, ¿ y ¡). Licencia SIL Open Font License. */
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 600 800; font-display: swap; src: url("../fonts/bricolage-grotesque-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/dm-sans-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500 600; font-display: swap; src: url("../fonts/jetbrains-mono-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --cream: #faf6f0;
  --cream-2: #f3ece1;
  --paper: #fffdf9;
  --line: #e9dfd0;
  --line-strong: #d8c9b4;

  --ink: #2b1d14;
  --ink-2: #5c4a3d;
  --ink-3: #78634f; /* contraste ≥ 4,5:1 sobre todos los fondos claros (WCAG AA) */

  --amber: #8a4f12;
  --amber-soft: #f5e6cf;
  --gold: #e8b26a;

  --red: #c8202b;
  --red-dark: #a3161f;
  --red-soft: #fbe5e3;
  --green: #1f7a3a;
  --green-soft: #e4f1e6;
  --blue: #285d8f;
  --blue-soft: #e3edf6;
  --warn: #845300;
  --warn-soft: #fbefd4;

  --font-display: "Bricolage Grotesque", "DM Sans", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(43, 29, 20, .06);
  --shadow: 0 6px 24px -10px rgba(43, 29, 20, .22);
  --shadow-lg: 0 18px 50px -20px rgba(43, 29, 20, .35);

  --gutter: 16px;
  --container: 1200px;

  /* Color de acento y superficies. En la tienda siguen siendo el rojo y el blanco de siempre;
     el panel los cambia desde admin-ui.css (colores y modo oscuro) sin tocar el resto de las reglas. */
  --accent: var(--red);
  --accent-dark: var(--red-dark);
  --accent-line: var(--red);
  --accent-soft: var(--red-soft);
  --accent-tint: #fffaf9;
  --accent-ring: rgba(200, 32, 43, .28);
  --card: #fff;
  --inv-bg: var(--ink);
  --inv-fg: #fff;
  --side-bg: var(--ink);
  --hover-row: #fffaf3;
  --focus: 0 0 0 3px var(--accent-ring);
}

@media (min-width: 768px) {
  :root { --gutter: 28px; }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, picture { display: block; max-width: 100%; }
/* "hidden" siempre oculta, aunque la clase del elemento le dé otro display. */
[hidden] { display: none !important; }
img { height: auto; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.12;
  letter-spacing: -.02em;
  margin: 0 0 .5em;
  font-weight: 700;
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.55rem, 3.2vw, 2.25rem); }
h3 { font-size: 1.2rem; letter-spacing: -.01em; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: .75rem;
}

.muted { color: var(--ink-2); }
.subtle { color: var(--ink-3); font-size: .9rem; }
.mono { font-family: var(--font-mono); }
.nowrap { white-space: nowrap; }
.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; }
.icon { width: 20px; height: 20px; flex: none; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 28px; height: 28px; }

/* Botones ----------------------------------------------------------------- */
.btn {
  --btn-bg: var(--inv-bg);
  --btn-fg: var(--inv-fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 46px;
  padding: .65rem 1.25rem;
  border: 1.5px solid var(--btn-bg);
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 600;
  font-size: .98rem;
  line-height: 1.2;
  text-decoration: none;
  transition: transform .12s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }
.btn-primary { --btn-bg: var(--accent); --btn-fg: #fff; }
.btn-primary:hover { --btn-bg: var(--accent-dark); }
.btn-green { --btn-bg: var(--green); --btn-fg: #fff; }
.btn-outline { --btn-fg: var(--ink); background: transparent; border-color: var(--line-strong); }
.btn-outline:hover { border-color: var(--ink); background: var(--paper); }
.btn-ghost { --btn-fg: var(--ink); background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--cream-2); box-shadow: none; }
.btn-danger { --btn-fg: var(--red); background: transparent; border-color: #efc2bf; }
.btn-danger:hover { background: var(--red-soft); box-shadow: none; }
.btn-whatsapp { --btn-bg: #1f9d55; --btn-fg: #fff; }
.btn-sm { min-height: 36px; padding: .4rem .9rem; font-size: .88rem; }
.btn-lg { min-height: 54px; padding: .8rem 1.7rem; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* Formularios ------------------------------------------------------------- */
.field { display: grid; gap: .35rem; margin-bottom: 1rem; align-content: start; }
.field > label, .label { font-weight: 600; font-size: .92rem; }
.field .hint { font-size: .84rem; color: var(--ink-3); }
.input, .select, .textarea {
  width: 100%;
  min-height: 46px;
  padding: .6rem .85rem;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.textarea { min-height: 96px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent-line); box-shadow: var(--focus); }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--red); }
.error { color: var(--red); font-size: .86rem; font-weight: 500; }
.check { display: flex; gap: .65rem; align-items: flex-start; font-size: .94rem; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent-line); flex: none; }
.grid-2 { display: grid; gap: 0 1rem; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* Avisos y etiquetas ------------------------------------------------------ */
.alert {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  padding: .9rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: .95rem;
}
.alert .icon { margin-top: 2px; }
.alert-success { background: var(--green-soft); border-color: #c4dfc9; color: #14532a; }
.alert-error { background: var(--red-soft); border-color: #f1c3bf; color: #8a141c; }
.alert-info { background: var(--blue-soft); border-color: #c6d9ea; color: #1d4569; }
.alert-warning { background: var(--warn-soft); border-color: #f0d9a6; color: #6d4500; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  background: var(--cream-2);
  color: var(--ink-2);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge-plain::before { display: none; }
.badge-info { background: var(--blue-soft); color: var(--blue); }
.badge-warning { background: var(--warn-soft); color: var(--warn); }
.badge-accent { background: var(--amber-soft); color: var(--amber); }
.badge-success { background: var(--green-soft); color: var(--green); }
.badge-danger { background: var(--red-soft); color: var(--red); }

.chip {
  display: inline-flex; align-items: center; gap: .4rem; flex: none;
  padding: .4rem .85rem; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); font-size: .88rem; font-weight: 500; text-decoration: none; white-space: nowrap;
}
.chip:hover { border-color: var(--ink-2); }
.chip.is-active { background: var(--inv-bg); border-color: var(--inv-bg); color: var(--inv-fg); }
.chip .icon { width: 16px; height: 16px; color: var(--amber); }
.chip.is-active .icon { color: var(--gold); }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

/* Paginación -------------------------------------------------------------- */
.pagination { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; align-items: center; margin: 2rem 0 0; padding: 0; list-style: none; }
.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 42px; height: 42px; padding: 0 .75rem;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--paper); text-decoration: none; font-weight: 600; font-size: .92rem;
}
.pagination a:hover { border-color: var(--ink); }
.pagination .is-current { background: var(--inv-bg); border-color: var(--inv-bg); color: var(--inv-fg); }
.pagination .is-disabled { opacity: .45; }
