/* HUB Pickup · portal. HUB Design System: fondo #F1F1F1, texto negro, líneas de 1 px, acento único #00FFA7. */

@font-face {
  font-family: "MDThermochrome";
  src: url("/assets/fonts/MDThermochrome-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Halyard Display";
  src: url("/assets/fonts/HalyardDisplay-Regular.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --bg: #f1f1f1;
  --fg: #000;
  --muted: #6e6e6e;
  --soft: #cacaca;
  --green: #00ffa7;
  --white: #fff;
  --danger: #c00;
  --display: "MDThermochrome", "Arial Narrow", system-ui, sans-serif;
  --text: "Halyard Display", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --gutter: 16px;
  --max: 560px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.45 var(--text);
  min-height: 100vh;
  padding-bottom: calc(96px + var(--safe-bottom));
}
body.ready-bg { background: var(--green); }
img { max-width: 100%; display: block; }
button, input { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

.top {
  max-width: var(--max);
  margin: 0 auto;
  padding: 16px var(--gutter) 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.logo img { width: 160px; height: auto; }

.seal {
  font: 600 12px/1 var(--mono);
  letter-spacing: 0.02em;
  border: 1px solid var(--fg);
  padding: 6px 8px;
  white-space: nowrap;
}
.seal.open { background: var(--green); }

main { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.pad { padding: 24px 0; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }

h1, h2, .display {
  font-family: var(--display);
  text-transform: uppercase;
  font-weight: 700;
  line-height: 0.95;
  margin: 0;
  letter-spacing: 0.01em;
}
h1 { font-size: clamp(44px, 13vw, 64px); margin: 16px 0 8px; }
h2 { font-size: 28px; margin: 24px 0 8px; }
.lead { margin: 0 0 16px; }

.notice {
  border: 1px solid var(--fg);
  background: var(--white);
  padding: 12px 14px;
  margin: 12px 0;
}
.notice.closed { border-color: var(--fg); }
.notice strong { display: block; }
.notice a { font-weight: 600; }

.tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 10px 0;
  margin: 0 calc(-1 * var(--gutter));
  padding-left: var(--gutter);
  padding-right: var(--gutter);
  border-bottom: 1px solid var(--fg);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--fg);
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
}
.tab[aria-selected="true"] { background: var(--fg); color: var(--white); }

.cat { scroll-margin-top: 72px; }
.items { list-style: none; margin: 0; padding: 0; }
.item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 14px 0;
  border: 0;
  border-bottom: 1px solid var(--soft);
  background: none;
  text-align: left;
  cursor: pointer;
}
.item:disabled { cursor: default; }
.item .name { font-weight: 600; }
.item .desc { color: var(--muted); font-size: 14px; margin-top: 2px; }
.item .price { font-family: var(--mono); white-space: nowrap; }
.tag {
  display: inline-block;
  font: 600 11px/1 var(--mono);
  text-transform: uppercase;
  background: var(--green);
  padding: 4px 6px;
  margin-left: 6px;
  vertical-align: 2px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 0 18px;
  border: 1px solid var(--fg);
  background: var(--fg);
  color: var(--white);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn.secondary { background: transparent; color: var(--fg); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn .sp { margin-left: auto; font-family: var(--mono); }
.link-btn { background: none; border: 0; padding: 10px 0; min-height: 44px; text-decoration: underline; cursor: pointer; }

.bottom {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  background: var(--bg);
  border-top: 1px solid var(--fg);
  padding: 12px var(--gutter) calc(12px + var(--safe-bottom));
}
.bottom > * { max-width: calc(var(--max) - 2 * var(--gutter)); margin: 0 auto; }

/* Detalle del artículo */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: var(--bg);
  overflow-y: auto;
  padding: 0 var(--gutter) calc(110px + var(--safe-bottom));
}
.sheet-inner { max-width: var(--max); margin: 0 auto; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 0 0; }
.close { min-width: 44px; min-height: 44px; border: 1px solid var(--fg); background: none; cursor: pointer; display: grid; place-items: center; }
.kicker { font: 600 12px/1 var(--mono); text-transform: uppercase; color: var(--muted); margin-top: 16px; }

fieldset { border: 0; margin: 20px 0 0; padding: 0; }
legend { font-weight: 600; padding: 0; margin-bottom: 8px; display: flex; gap: 8px; align-items: baseline; }
legend small { color: var(--muted); font-weight: 400; }
.opt {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 12px;
  border: 1px solid var(--soft);
  margin-top: -1px;
  background: var(--white);
  cursor: pointer;
}
.opt:has(input:checked) { border-color: var(--fg); position: relative; z-index: 1; }
.opt input { width: 20px; height: 20px; accent-color: var(--fg); margin: 0; }
.opt .op { margin-left: auto; font-family: var(--mono); color: var(--muted); }

.qty { display: inline-flex; align-items: center; border: 1px solid var(--fg); }
.qty button { width: 44px; height: 44px; border: 0; background: none; font-size: 22px; cursor: pointer; }
.qty button:disabled { opacity: 0.3; }
.qty output { min-width: 36px; text-align: center; font-family: var(--mono); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* Pedido */
.line { padding: 14px 0; border-bottom: 1px solid var(--soft); }
.line .mods { color: var(--muted); font-size: 14px; }
.totals { display: flex; justify-content: space-between; padding: 16px 0 4px; font-weight: 600; }
.totals .mono { font-size: 18px; }
.iva { color: var(--muted); font-size: 13px; text-align: right; }

/* Pago */
label.field { display: block; font-weight: 600; margin: 20px 0 6px; }
input.text {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--fg);
  background: var(--white);
  font-size: 18px;
  border-radius: 0;
}
.err { color: var(--danger); font: 600 13px/1.3 var(--mono); margin-top: 6px; }
.card-field { height: 52px; margin-bottom: 10px; }
.card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card-grid .card-field { margin: 0; }
.pay-block { border: 1px solid var(--fg); background: var(--white); padding: 14px; margin-top: 12px; }
.pay-block h3 { margin: 0 0 10px; font-size: 15px; }
.or { text-align: center; color: var(--muted); margin: 14px 0; font-size: 14px; }
paypal-button, paypal-basic-card-button { display: block; width: 100%; min-height: 48px; }

/* Estado */
.status-code { font: 600 13px/1.3 var(--mono); margin: 12px 0 0; }
.big-num { font-family: var(--display); font-size: clamp(88px, 30vw, 140px); line-height: 0.85; margin: 8px 0 0; }
.cust { font-size: 24px; font-weight: 600; margin: 4px 0 16px; }
.steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); padding: 0; margin: 16px 0; border: 1px solid var(--fg); }
.steps li { padding: 12px 8px; font-size: 13px; text-align: center; border-left: 1px solid var(--fg); color: var(--muted); }
.steps li:first-child { border-left: 0; }
.steps li.done { color: var(--fg); }
.steps li.current { background: var(--fg); color: var(--white); font-weight: 600; }
body.ready-bg .steps li.current { background: var(--fg); }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 30;
  background: var(--fg);
  color: var(--white);
  padding: 10px 14px;
  font: 600 13px/1.3 var(--mono);
  max-width: calc(100% - 32px);
}

.spinner { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
