/* Letras alojadas en el propio sitio (sin conexión a Google). Licencia SIL OFL: ver /fonts/LICENSES.txt */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 200 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+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('/fonts/figtree-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Influensfa: sistema de diseño.
   Colores tomados del logo: tinta azul petróleo, coral de la estrella y un amarillo de cartel de mercado. */
:root {
  --ink: #0b2c39;
  --teal: #0e3b4d;
  --teal-2: #17566f;
  --coral: #e8573e;
  --coral-ink: #b83a24;
  --marigold: #ffc531;
  --marigold-2: #ffe08a;
  --mar: #d6ebee;
  --mar-2: #eaf5f6;
  --paper: #f5f9fa;
  --white: #ffffff;
  --muted: #4a6670;
  --line: #d3e2e5;
  --ok: #1d7a4d;
  --ok-bg: #dff3e8;
  --warn-bg: #fff1c4;
  --bad-bg: #fde3dd;

  --font-display: 'Bricolage Grotesque', 'Inter', system-ui, sans-serif;
  --font-body: 'Figtree', 'Inter', system-ui, sans-serif;

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --wrap: 1160px;
  --gutter: clamp(16px, 4vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.08; margin: 0; letter-spacing: -0.02em; font-weight: 800; }
h1 { font-size: clamp(2.4rem, 5.6vw, 4.6rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.9rem, 3.6vw, 3rem); letter-spacing: -0.03em; }
h3 { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.015em; }
h4 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 1em; max-width: 68ch; }
a { color: var(--teal-2); text-underline-offset: 3px; }
a:hover { color: var(--coral-ink); }
:focus-visible { outline: 3px solid var(--teal-2); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--marigold); color: var(--ink); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 8px; top: -60px; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r-sm); z-index: 100; }
.skip-link:focus { top: 8px; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.stack > * + * { margin-top: var(--gap, 1rem); }
.row { display: flex; flex-wrap: wrap; gap: var(--gap, 12px); align-items: center; }
.spacer { flex: 1; }

/* ---------- Botones ---------- */
.btn {
  --shadow: 3px 3px 0 var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px;
  font: 700 1rem/1 var(--font-body);
  color: var(--ink); background: var(--white);
  border: 2px solid var(--ink); border-radius: var(--r-md);
  text-decoration: none; cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
}
.btn:hover { color: var(--ink); transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn-primary { background: var(--marigold); }
.btn-primary:hover { background: #ffd14f; }
.btn-dark { background: var(--teal); color: #fff; }
.btn-dark:hover { color: #fff; background: var(--teal-2); }
.btn-danger { color: var(--coral-ink); border-color: var(--coral-ink); --shadow: 3px 3px 0 var(--coral-ink); }
.btn-danger:hover { color: var(--coral-ink); box-shadow: 4px 4px 0 var(--coral-ink); }
.btn-ghost { border-color: transparent; box-shadow: none; background: transparent; padding: 0 12px; }
.btn-ghost:hover { box-shadow: none; transform: none; background: var(--mar-2); }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 0.92rem; border-radius: 10px; --shadow: 2px 2px 0 var(--ink); }
.btn-sm:hover { box-shadow: 3px 3px 0 var(--ink); }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-busy='true'] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: var(--shadow); pointer-events: none; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--teal-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:hover { color: var(--coral-ink); }

/* ---------- Formularios ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field > label, .field > .label { font-weight: 700; font-size: 0.97rem; }
.field .hint { font-size: 0.88rem; color: var(--muted); }
input[type='text'], input[type='email'], input[type='password'], input[type='number'], input[type='url'], input[type='search'], input[type='tel'], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px;
  font: 500 1rem/1.4 var(--font-body); color: var(--ink);
  background: var(--white); border: 2px solid var(--ink); border-radius: var(--r-sm);
}
textarea { min-height: 112px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #7d949c; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--marigold); outline-offset: 0; border-color: var(--ink); }
input[type='checkbox'], input[type='radio'] { width: 22px; height: 22px; accent-color: var(--teal); flex: none; margin: 0; }
.check { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.check label { font-weight: 500; }
input[type='range'] { width: 100%; accent-color: var(--coral); height: 32px; }
.form-error { background: var(--bad-bg); border: 2px solid var(--coral-ink); color: #7c2112; border-radius: var(--r-sm); padding: 10px 14px; margin-bottom: 16px; font-weight: 600; }
.form-ok { background: var(--ok-bg); border: 2px solid var(--ok); color: #0f4a2e; border-radius: var(--r-sm); padding: 10px 14px; margin-bottom: 16px; font-weight: 600; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ---------- Insignias y etiquetas ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 0.82rem; font-weight: 700; background: var(--mar); color: var(--teal); white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: #0f4a2e; }
.badge-warn { background: var(--warn-bg); color: #6b4a00; }
.badge-bad { background: var(--bad-bg); color: #7c2112; }
.badge-ink { background: var(--teal); color: #fff; }
.pill { display: inline-block; padding: 2px 10px; border: 1.5px solid var(--line); border-radius: 999px; font-size: 0.85rem; font-weight: 600; color: var(--muted); background: var(--white); }

/* ---------- Etiqueta de precio (el elemento recurrente de la marca) ---------- */
.tag { position: relative; display: inline-grid; min-width: 78px; color: var(--ink); isolation: isolate; filter: drop-shadow(2px 3px 0 rgba(11, 44, 57, .18)); }
.tag-bg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; overflow: visible; }
.tag-bg path { fill: var(--marigold); stroke: var(--ink); stroke-width: 2px; vector-effect: non-scaling-stroke; }
.tag-bg circle { fill: var(--paper); stroke: var(--ink); stroke-width: 2px; vector-effect: non-scaling-stroke; }
.tag-txt { padding: 20px 14px 10px; display: flex; flex-direction: column; align-items: flex-start; line-height: 1.05; }
.tag-price { font: 800 1.7rem/1 var(--font-display); letter-spacing: -0.03em; }
.tag-cap { font-size: 0.74rem; font-weight: 700; margin-top: 3px; }
.tag-sm .tag-price { font-size: 1.25rem; }
.tag-sm .tag-txt { padding: 17px 11px 8px; }
.tag-lg .tag-price { font-size: 2.4rem; }
.tag-lg .tag-txt { padding: 26px 20px 14px; }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; border: 2px solid var(--ink); border-radius: var(--r-md); background: var(--white); }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.85rem; font-weight: 700; color: var(--muted); background: var(--mar-2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Ventana modal y avisos ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(11, 44, 57, .55); display: grid; place-items: center; padding: 16px; z-index: 60; }
.modal { background: var(--white); border: 2px solid var(--ink); border-radius: var(--r-lg); box-shadow: 6px 6px 0 var(--ink); width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 26px; }
.modal h2 { font-size: 1.7rem; margin-bottom: 14px; }
.modal .actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 8px; }
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 10px; z-index: 80; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--r-md); font-weight: 600; box-shadow: 3px 3px 0 rgba(0, 0, 0, .25); animation: toast-in .2s ease; }
.toast-bad { background: var(--coral-ink); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.empty { border: 2px dashed var(--line); border-radius: var(--r-lg); padding: 36px 24px; text-align: center; background: var(--white); }
.empty h3 { margin-bottom: 6px; }
.empty p { margin-inline: auto; color: var(--muted); }
.loading { padding: 48px 0; text-align: center; color: var(--muted); font-weight: 600; }

.divider { height: 2px; background: var(--ink); opacity: .08; border: 0; margin: 28px 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
