/* Pedido grupal — oscuro por defecto, estética "semi glass". */

:root {
  color-scheme: dark;
  --bg: #05070c;
  --blob-1: rgba(47, 202, 47, 0.26);
  --blob-2: rgba(20, 160, 255, 0.16);
  --blob-3: rgba(124, 77, 255, 0.16);
  --glass: rgba(255, 255, 255, 0.05);
  --glass-2: rgba(255, 255, 255, 0.08);
  --glass-3: rgba(255, 255, 255, 0.12);
  --panel: rgba(14, 18, 27, 0.72);
  --panel-solid: #0e121b;
  --stroke: rgba(255, 255, 255, 0.09);
  --stroke-2: rgba(255, 255, 255, 0.18);
  --text: #eef2f8;
  --text-2: #b7c0cf;
  --muted: #7d889b;
  --accent: #3ee070;
  --accent-strong: #22c55e;
  --accent-ink: #04150a;
  --accent-soft: rgba(62, 224, 112, 0.14);
  --accent-glow: rgba(62, 224, 112, 0.35);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.14);
  --danger: #ff6b6b;
  --danger-soft: rgba(255, 107, 107, 0.14);
  --info: #6cb6ff;
  --info-soft: rgba(108, 182, 255, 0.14);
  --tile-a: #f7f8fa;
  --tile-b: #dde2e9;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.3);
  --highlight: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --radius: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --blur: 20px;
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'Cascadia Code', 'SF Mono', Consolas, monospace;
}

:root[data-theme='light'] {
  color-scheme: light;
  --bg: #eef2f6;
  --blob-1: rgba(47, 202, 47, 0.22);
  --blob-2: rgba(20, 160, 255, 0.16);
  --blob-3: rgba(124, 77, 255, 0.12);
  --glass: rgba(255, 255, 255, 0.55);
  --glass-2: rgba(255, 255, 255, 0.72);
  --glass-3: rgba(255, 255, 255, 0.9);
  --panel: rgba(255, 255, 255, 0.78);
  --panel-solid: #ffffff;
  --stroke: rgba(15, 23, 42, 0.08);
  --stroke-2: rgba(15, 23, 42, 0.16);
  --text: #0d1424;
  --text-2: #334155;
  --muted: #64748b;
  --accent: #16a34a;
  --accent-strong: #15803d;
  --accent-ink: #ffffff;
  --accent-soft: rgba(22, 163, 74, 0.12);
  --accent-glow: rgba(22, 163, 74, 0.25);
  --warn: #b45309;
  --warn-soft: rgba(217, 119, 6, 0.12);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.1);
  --info: #2563eb;
  --info-soft: rgba(37, 99, 235, 0.1);
  --tile-a: #ffffff;
  --tile-b: #eef1f5;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
  --shadow-sm: 0 6px 18px rgba(15, 23, 42, 0.08);
  --highlight: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: -15%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(38% 32% at 12% 8%, var(--blob-1), transparent 70%),
    radial-gradient(34% 30% at 92% 18%, var(--blob-2), transparent 70%),
    radial-gradient(40% 36% at 55% 105%, var(--blob-3), transparent 70%);
  filter: blur(30px);
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--accent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.i {
  flex: none;
  vertical-align: -0.15em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.num {
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--muted);
}

.wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------------------------------------------------------------- superficies glass */

.glass {
  background: var(--glass);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm), var(--highlight);
  backdrop-filter: blur(var(--blur)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(150%);
}

.eyebrow {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------------------------------------------------------------- botones */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--stroke-2);
  background: var(--glass-2);
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.15s;
}

.btn:hover {
  background: var(--glass-3);
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  border-color: transparent;
  color: var(--accent-ink);
  box-shadow: 0 8px 24px -8px var(--accent-glow);
}

.btn-primary:hover {
  background: linear-gradient(180deg, var(--accent), var(--accent));
}

.btn-danger {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 35%, transparent);
  background: var(--danger-soft);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--glass-2);
}

.btn-sm {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: 10px;
}

.btn-block {
  width: 100%;
}

.btn-lg {
  min-height: 52px;
  font-size: 15.5px;
  border-radius: 14px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: var(--glass);
  color: var(--text);
  transition: background 0.15s;
}

.icon-btn:hover {
  background: var(--glass-3);
}

.link-btn {
  border: 0;
  background: none;
  padding: 4px 2px;
  color: var(--text-2);
  font-weight: 600;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--stroke-2);
}

.link-btn:hover {
  color: var(--text);
}

.link-btn.danger {
  color: var(--danger);
}

/* ---------------------------------------------------------------- inputs */

.input,
.select {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--stroke-2);
  background: var(--glass);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input::placeholder {
  color: var(--muted);
}

.input:focus,
.select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea.input {
  padding: 12px 14px;
  min-height: 84px;
  resize: vertical;
}

.select {
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237d889b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.select option {
  background: var(--panel-solid);
  color: var(--text);
}

.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
}

.form-error {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13.5px;
  font-weight: 600;
}

.hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* ---------------------------------------------------------------- pills */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  background: var(--glass-2);
  color: var(--text-2);
}

.pill-ok {
  background: var(--accent-soft);
  color: var(--accent);
}

.pill-warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.pill-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.pill-info {
  background: var(--info-soft);
  color: var(--info);
}

/* ---------------------------------------------------------------- barra superior */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  backdrop-filter: blur(var(--blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(160%);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  min-width: 0;
  margin-right: auto;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--accent), #0f9f45);
  color: #04150a;
  box-shadow: 0 6px 20px -6px var(--accent-glow);
  flex: none;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}

.brand-text strong {
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.brand-text small {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.deadline-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--glass);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
}

.deadline-chip.is-closed {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 30%, transparent);
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px 0 6px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: var(--glass);
  font-weight: 700;
  font-size: 13.5px;
  max-width: 200px;
}

.user-chip .avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  flex: none;
}

.user-chip span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cart-btn {
  position: relative;
}

.cart-btn .count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11.5px;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.cart-btn-wide {
  gap: 10px;
}

.cart-btn-wide .num {
  font-weight: 800;
}

/* ---------------------------------------------------------------- hero (totales del grupo) */

main {
  padding: 20px 0 120px;
}

.hero {
  margin-bottom: 18px;
  overflow: hidden;
}

/* Grupo a la izquierda, "tu parte" a la derecha. */
.hero-main {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: stretch;
}

.hero-group {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px;
}

.hero-you {
  display: flex;
  padding: 12px 12px 12px 0;
}

.hero-you > * {
  flex: 1;
  margin: 0;
}

.hero-amount {
  margin: 6px 0 10px;
  font-size: clamp(34px, 7vw, 52px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 600;
}

.hero-stats span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.deadline-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  margin-top: 16px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--glass);
  font-size: 13.5px;
  color: var(--text-2);
}

.deadline-row b {
  color: var(--text);
  font-weight: 800;
}

.deadline-row.is-soon {
  border-color: color-mix(in srgb, var(--warn) 40%, transparent);
  background: var(--warn-soft);
}

.deadline-row.is-soon b,
.deadline-row.is-soon .i {
  color: var(--warn);
}

.deadline-row.is-closed {
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
  background: var(--danger-soft);
}

.deadline-row.is-closed b,
.deadline-row.is-closed .i {
  color: var(--danger);
}

.deadline-rule {
  margin: 8px 0 0 4px;
  font-size: 12.5px;
  color: var(--muted);
}

.minimum {
  margin-top: 22px;
}

.minimum-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

.minimum-head span:last-child {
  white-space: nowrap;
}

.bar {
  height: 10px;
  margin: 8px 0;
  border-radius: 999px;
  background: var(--glass-2);
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-strong), var(--accent));
  box-shadow: 0 0 18px var(--accent-glow);
  transition: width 0.6s ease;
}

.minimum-note {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* "Faltan $X": el dato que más importa del grupo, bien visible. */
.minimum-missing {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 6px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-2);
}

.minimum-missing b {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.minimum-missing.ok,
.minimum-missing.ok b {
  color: var(--accent);
}

.minimum-missing.ok b {
  font-size: 18px;
}

/* Barra en dos tramos: lo ya pagado (lleno) y lo pedido que falta pagar (suave). */
.bar-split {
  display: flex;
}

.bar-split span {
  border-radius: 0;
}

.bar-split .seg-unpaid {
  background: color-mix(in srgb, var(--accent) 32%, transparent);
  box-shadow: none;
}

.minimum-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 13px;
  color: var(--text-2);
}

.minimum-legend b {
  color: var(--text);
  font-weight: 800;
}

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 7px;
  border-radius: 50%;
  vertical-align: 0;
}

.dot-paid {
  background: var(--accent);
}

.dot-unpaid {
  background: color-mix(in srgb, var(--accent) 32%, transparent);
}

.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  margin-bottom: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--stroke);
  background: var(--glass);
  font-size: 14px;
}

.notice strong {
  display: block;
}

.notice.danger {
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 30%, transparent);
}

.notice.danger .i {
  color: var(--danger);
}

.notice.warn {
  background: var(--warn-soft);
  border-color: color-mix(in srgb, var(--warn) 30%, transparent);
}

.notice.warn .i {
  color: var(--warn);
}

/* ---------------------------------------------------------------- catálogo */

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 28px 0 14px;
}

.section-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13.5px;
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr 200px 190px auto;
  gap: 10px;
  margin-bottom: 12px;
}

.search {
  position: relative;
}

.search .i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

.search .input {
  padding-left: 42px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--stroke-2);
  background: var(--glass);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

.toggle input {
  appearance: none;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: var(--glass-3);
  position: relative;
  margin: 0;
  cursor: pointer;
  transition: background 0.15s;
  flex: none;
}

.toggle input::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text);
  transition: transform 0.15s;
}

.toggle input:checked {
  background: var(--accent);
}

.toggle input:checked::after {
  transform: translateX(14px);
  background: var(--accent-ink);
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 10px;
  margin-bottom: 8px;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--glass);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 700;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.chip:hover {
  background: var(--glass-2);
}

.chip[aria-pressed='true'] {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  color: var(--accent);
}

.chip small {
  font-size: 11.5px;
  opacity: 0.7;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  border: 1px solid var(--stroke);
  background: var(--glass);
  box-shadow: var(--highlight);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
  outline-offset: 3px;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--stroke-2);
  background: var(--glass-2);
}

.card.in-cart {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

.thumb {
  position: relative;
  aspect-ratio: 1;
  margin: 8px 8px 0;
  border-radius: 13px;
  background: radial-gradient(circle at 50% 38%, var(--tile-a), var(--tile-b));
  display: grid;
  place-items: center;
  overflow: hidden;
}

/* Las fotos de la tienda traen fondo blanco: "multiply" lo funde con el fondo de la tarjeta. */
.thumb img,
.pd-media img,
.line-thumb img {
  mix-blend-mode: multiply;
}

.thumb img {
  width: 86%;
  height: 86%;
  object-fit: contain;
  transition: transform 0.25s;
}

.card:hover .thumb img {
  transform: scale(1.04);
}

.thumb.noimg::after {
  content: 'Sin imagen';
  color: #8a94a6;
  font-size: 12px;
  font-weight: 600;
}

.thumb.noimg img {
  display: none;
}

.card.is-out .thumb img {
  filter: grayscale(1);
  opacity: 0.55;
}

.card.is-out .card-body {
  opacity: 0.6;
}

.badge {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.badge-accent {
  background: var(--accent);
  color: var(--accent-ink);
}

.badge-muted {
  background: rgba(15, 18, 26, 0.82);
  color: #e2e8f0;
}

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 12px 14px 14px;
}

.card-meta {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.card-title {
  margin: 4px 0 10px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-foot {
  margin-top: auto;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 8px;
}

.price {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

/* Precio de lista tachado cuando la tienda tiene un descuento. */
.was {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: line-through;
}

.pd-price .was {
  font-size: 15px;
}

.price small {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}

.card-sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.add-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--accent);
  color: var(--accent-ink);
  flex: none;
  box-shadow: 0 6px 16px -6px var(--accent-glow);
}

.card.is-out .add-btn {
  background: var(--glass-3);
  color: var(--muted);
  box-shadow: none;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 44px 20px;
  text-align: center;
  color: var(--muted);
}

.empty-state .i {
  color: var(--text-2);
  opacity: 0.6;
}

.empty-state strong {
  color: var(--text);
  font-size: 16px;
}

.skeleton {
  border-radius: 18px;
  background: linear-gradient(100deg, var(--glass) 30%, var(--glass-2) 50%, var(--glass) 70%);
  background-size: 300% 100%;
  animation: shimmer 1.4s infinite linear;
}

@keyframes shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: 0 0;
  }
}

.footer {
  margin-top: 40px;
  padding: 24px 0 8px;
  border-top: 1px solid var(--stroke);
  color: var(--muted);
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  justify-content: space-between;
}

.footer a {
  color: var(--text-2);
}

/* ---------------------------------------------------------------- stepper */

.stepper {
  display: inline-flex;
  align-items: center;
  border-radius: 12px;
  border: 1px solid var(--stroke-2);
  background: var(--glass);
  overflow: hidden;
}

.stepper button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  background: transparent;
  color: var(--text);
}

.stepper button:hover {
  background: var(--glass-3);
}

.stepper button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.stepper output {
  min-width: 34px;
  text-align: center;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.stepper.lg button {
  width: 46px;
  height: 46px;
}

.stepper.lg output {
  min-width: 44px;
  font-size: 17px;
}

/* ---------------------------------------------------------------- dialogs */

dialog {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  overflow: visible;
}

dialog::backdrop {
  background: rgba(2, 4, 9, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

dialog[open] {
  animation: pop 0.18s ease-out;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

.sheet {
  position: relative;
  border-radius: 24px;
  border: 1px solid var(--stroke-2);
  background: var(--panel);
  box-shadow: var(--shadow), var(--highlight);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  max-height: calc(100dvh - 32px);
  overflow: auto;
}

.modal-card {
  width: 440px;
  max-width: 100%;
  padding: 26px;
}

.modal-card h2 {
  margin: 14px 0 6px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.modal-card > p {
  margin: 0 0 18px;
  color: var(--text-2);
}

.modal-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
}

.modal-actions .btn {
  flex: 1;
}

.modal-alt {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px 8px;
  margin-top: 14px;
  text-align: center;
}

.field-gap {
  margin-top: 14px;
}

.field-hint {
  margin-top: 6px;
  font-size: 12.5px;
}

.close-x {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  background: color-mix(in srgb, var(--panel-solid) 88%, transparent);
  border-color: var(--stroke-2);
}

.code-display {
  margin: 4px 0 14px;
  padding: 18px;
  border-radius: 16px;
  border: 1px dashed color-mix(in srgb, var(--accent) 60%, transparent);
  background: var(--accent-soft);
  text-align: center;
  font-family: var(--mono);
  font-size: clamp(30px, 9vw, 40px);
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--accent);
}

.code-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 4px;
}

.input-code {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-align: center;
  text-transform: uppercase;
  min-height: 56px;
}

/* detalle de producto */

.pd {
  width: 820px;
  max-width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.pd-media {
  margin: 14px;
  border-radius: 18px;
  background: radial-gradient(circle at 50% 38%, var(--tile-a), var(--tile-b));
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  overflow: hidden;
}

.pd-media img {
  width: 88%;
  height: 88%;
  object-fit: contain;
}

.pd-info {
  display: flex;
  flex-direction: column;
  padding: 26px 26px 22px 12px;
  min-width: 0;
}

.pd-title {
  margin: 6px 40px 8px 0;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.pd-price {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}

.pd-price small {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.pd-section {
  margin-bottom: 18px;
}

.flavors {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.flavor {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 42px;
  padding: 7px 14px;
  border-radius: 12px;
  border: 1px solid var(--stroke-2);
  background: var(--glass);
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}

.flavor:hover {
  background: var(--glass-3);
}

.flavor small {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}

.flavor[aria-pressed='true'] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
}

.flavor:disabled {
  opacity: 0.45;
  text-decoration: line-through;
  cursor: not-allowed;
}

.pd-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.pd-row .field-label {
  margin: 0;
}

.pd-incart {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -6px 0 16px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13.5px;
  font-weight: 700;
}

.pd-actions {
  margin-top: auto;
}

/* ---------------------------------------------------------------- carrito (drawer) */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(2, 4, 9, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.scrim.show {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 45;
  width: min(460px, 100vw);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--stroke-2);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  transform: translateX(105%);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  visibility: hidden;
}

.drawer.open {
  transform: none;
  visibility: visible;
}

.drawer-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--stroke);
}

.drawer-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.drawer-head p {
  margin: 2px 0 0;
  font-size: 13.5px;
}

.drawer-head > div {
  flex: 1;
  min-width: 0;
}

.drawer-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px 18px;
  overscroll-behavior: contain;
}

.drawer-foot {
  padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--panel-solid) 55%, transparent);
}

.code-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: 14px;
  border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--accent-soft);
}

.code-card code {
  display: block;
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--accent);
}

.code-card .row {
  display: flex;
  gap: 6px;
}

.status-box {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: 14px;
  background: var(--glass);
  border: 1px solid var(--stroke);
  font-size: 13.5px;
  color: var(--text-2);
}

.status-box strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  margin-bottom: 2px;
}

.status-box.ok {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}

.status-box.ok .i {
  color: var(--accent);
}

.status-box.warn {
  background: var(--warn-soft);
  border-color: color-mix(in srgb, var(--warn) 35%, transparent);
}

.status-box.warn .i {
  color: var(--warn);
}

.status-box.danger {
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 35%, transparent);
}

.status-box.danger .i {
  color: var(--danger);
}

.lines {
  display: grid;
  gap: 10px;
}

.line {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 12px;
  padding: 10px;
  border-radius: 16px;
  background: var(--glass);
  border: 1px solid var(--stroke);
}

.line.is-off {
  border-color: color-mix(in srgb, var(--warn) 40%, transparent);
}

.line.is-off .line-thumb img {
  filter: grayscale(1);
  opacity: 0.6;
}

.line-thumb {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background: radial-gradient(circle at 50% 38%, var(--tile-a), var(--tile-b));
  display: grid;
  place-items: center;
  overflow: hidden;
}

.line-thumb img {
  width: 88%;
  height: 88%;
  object-fit: contain;
}

.line-info {
  min-width: 0;
}

.line-name {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-variant {
  margin-top: 3px;
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--glass-2);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
}

.line-price {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--muted);
}

.line-issue {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--warn);
}

.line-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.line-sub {
  font-weight: 800;
  font-size: 14.5px;
}

.line-side .stepper button {
  width: 32px;
  height: 32px;
}

.line-side .stepper output {
  min-width: 26px;
  font-size: 14px;
}

.qty-static {
  font-weight: 700;
  color: var(--text-2);
}

.sum-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 3px 0;
  font-size: 14px;
  color: var(--text-2);
}

.sum-row strong {
  color: var(--text);
}

.sum-row.big {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.sum-row.big strong {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent);
}

/* ---------------------------------------------------------------- tarjeta de transferencia */

.pay-card {
  position: relative;
  margin: 0 0 18px;
  padding: 18px;
  border-radius: 22px;
  border: 1.5px solid transparent;
  background:
    linear-gradient(150deg, color-mix(in srgb, var(--accent) 17%, var(--panel-solid)), var(--panel-solid) 70%) padding-box,
    linear-gradient(130deg, var(--accent), #14b8a6 45%, #3b82f6) border-box;
  box-shadow: 0 18px 50px -18px var(--accent-glow), var(--highlight);
  overflow: hidden;
}

.pay-card::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -40px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow), transparent 70%);
  opacity: 0.55;
  pointer-events: none;
}

.lines + .pay-card {
  margin: 14px 0 0;
}

.pay-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.pay-eyebrow {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.pay-amount {
  margin-top: 4px;
  font-size: clamp(32px, 8vw, 40px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.pay-deadline {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

.pay-rows {
  position: relative;
  display: grid;
  gap: 8px;
}

.pay-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 10px 10px 14px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg) 45%, transparent);
  border: 1px solid var(--stroke);
}

.pay-row-text {
  min-width: 0;
}

.pay-row-text span {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.pay-row-text b {
  display: block;
  font-size: 16px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.pay-row-text b.mono {
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 0.02em;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  min-height: 38px;
  padding: 0 13px;
  border-radius: 11px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}

.copy-btn:hover {
  background: color-mix(in srgb, var(--accent) 24%, transparent);
}

.copy-btn:active {
  transform: scale(0.97);
}

.copy-btn.copied {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.pay-note {
  position: relative;
  margin: 12px 0 0;
  font-size: 13.5px;
  color: var(--text-2);
  white-space: pre-line;
}

.pay-foot {
  position: relative;
  display: flex;
  gap: 7px;
  align-items: flex-start;
  margin: 12px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

.pay-foot .i {
  margin-top: 2px;
}

/* Estado de "tu parte" cuando no hay nada que transferir (sin pedido, pagado, fuera). */
.you-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px;
  border-radius: 20px;
  border: 1px solid var(--stroke);
  background: var(--glass);
}

.you-card .pay-eyebrow {
  color: var(--muted);
}

.you-card h3 {
  margin: 8px 0 6px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.you-card p {
  margin: 0;
  font-size: 14px;
  color: var(--text-2);
}

.you-card .btn-row {
  margin-top: 16px;
}

.you-card .btn-row .btn {
  flex: 1 1 200px;
}

.you-card.is-ok {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: linear-gradient(150deg, var(--accent-soft), transparent 75%);
}

.you-card.is-ok .pay-eyebrow,
.you-card.is-ok h3 {
  color: var(--accent);
}

.you-card.is-danger {
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
  background: linear-gradient(150deg, var(--danger-soft), transparent 75%);
}

.you-card.is-danger .pay-eyebrow,
.you-card.is-danger h3 {
  color: var(--danger);
}

.drawer-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
  font-size: 12.5px;
}

.save-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-right: auto;
  color: var(--muted);
  font-weight: 600;
}

.save-state.ok {
  color: var(--accent);
}

.save-state.error {
  color: var(--danger);
}

/* barra inferior del carrito en celular */

.cartbar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 35;
  display: none;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 8px 8px 8px 16px;
  border-radius: 18px;
  border: 1px solid var(--stroke-2);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  color: var(--text);
  text-align: left;
}

.cartbar .meta {
  flex: 1;
  min-width: 0;
}

.cartbar .meta span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.cartbar .meta b {
  font-size: 18px;
  font-weight: 800;
}

.cartbar .go {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 16px;
  border-radius: 13px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
}

/* ---------------------------------------------------------------- toasts */

.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(86px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 100;
  display: grid;
  gap: 8px;
  width: min(440px, calc(100vw - 24px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--stroke-2);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  font-size: 14px;
  font-weight: 600;
  pointer-events: auto;
  animation: toast-in 0.2s ease-out;
}

.toast.ok .i {
  color: var(--accent);
}

.toast.error {
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
}

.toast.error .i {
  color: var(--danger);
}

.toast .msg {
  flex: 1;
}

.toast button {
  border: 0;
  background: var(--glass-3);
  border-radius: 9px;
  padding: 6px 10px;
  font-weight: 800;
  font-size: 13px;
  color: var(--accent);
}

.toast.leaving {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s, transform 0.2s;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ---------------------------------------------------------------- admin */

.admin-login {
  min-height: calc(100dvh - 64px);
  display: grid;
  /* Columna del ancho disponible: si no, toma los 440px de la tarjeta y en el celular se sale. */
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 24px 0;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat {
  padding: 16px 18px;
}

.stat .value {
  margin-top: 6px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.stat .sub {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--muted);
}

.panel {
  padding: 20px;
  margin-bottom: 16px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.panel-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.panel-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.sub-panel {
  padding: 16px;
  border-radius: 16px;
  background: var(--glass);
  border: 1px solid var(--stroke);
}

.sub-panel h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 800;
}

.sub-panel > p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.state-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 700;
}

.segmented {
  display: inline-flex;
  padding: 4px;
  border-radius: 12px;
  background: var(--glass);
  border: 1px solid var(--stroke);
}

.segmented button {
  border: 0;
  background: transparent;
  padding: 7px 12px;
  border-radius: 9px;
  font-weight: 700;
  font-size: 13px;
  color: var(--text-2);
}

.segmented button[aria-pressed='true'] {
  background: var(--glass-3);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.person {
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: var(--glass);
  margin-bottom: 8px;
  overflow: hidden;
}

.person.is-empty {
  opacity: 0.6;
}

/* Datos arriba y botones en un segundo renglón, así nunca le quitan lugar al nombre. */
.person-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 130px 130px;
  align-items: center;
  gap: 10px 12px;
  padding: 12px 14px;
}

.person-row .who b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-row .who span {
  display: block;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.person-row .cell span {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
}

.person-row .cell b {
  font-size: 14.5px;
}

.person-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.person-detail {
  padding: 0 14px 14px;
}

.mini-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 13.5px;
}

.mini-table th,
.mini-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--stroke);
}

.mini-table th {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mini-table td.r,
.mini-table th.r {
  text-align: right;
}

.mini-table tfoot td {
  border-bottom: 0;
  font-weight: 800;
  font-size: 15px;
}

.mini-table .who-list {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: var(--glass);
}

.mini-table tr.flag td:first-child {
  box-shadow: inset 3px 0 0 var(--warn);
}

.mini-table .stock-warn {
  color: var(--warn);
  font-weight: 700;
}

/* ---------------------------------------------------------------- responsive */

@media (max-width: 900px) {
  .hero-main {
    grid-template-columns: 1fr;
  }

  .hero-you {
    padding: 0 12px 12px;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .person-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .person-row .cell {
    display: none;
  }

  .person-row .cell.keep {
    display: block;
    text-align: right;
  }

  .person-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .deadline-chip,
  .cart-btn-wide,
  .user-chip .label {
    display: none;
  }

  .user-chip {
    padding: 0 6px;
  }

  .cartbar.show {
    display: flex;
  }

  .toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .toolbar .toggle {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .toolbar .search {
    grid-column: 1 / -1;
  }

  .pd {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .pd-media {
    aspect-ratio: auto;
    height: 240px;
  }

  .pd-info {
    padding: 4px 20px 20px;
  }

  .pd-title {
    margin-right: 0;
  }

  dialog.sheet-dialog {
    margin: auto 0 0;
    width: 100%;
    max-width: 100%;
    max-height: 92dvh;
  }

  dialog.sheet-dialog .sheet {
    border-radius: 24px 24px 0 0;
    max-height: 92dvh;
    padding-bottom: env(safe-area-inset-bottom);
  }

  dialog.sheet-dialog[open] {
    animation: slide-up 0.22s ease-out;
  }
}

@keyframes slide-up {
  from {
    transform: translateY(40px);
    opacity: 0.4;
  }
}

@media (max-width: 520px) {
  body {
    font-size: 14.5px;
  }

  .wrap {
    padding: 0 12px;
  }

  .topbar-inner {
    gap: 8px;
    height: 60px;
  }

  .brand-text small,
  .hide-sm {
    display: none;
  }

  .brand-text strong {
    white-space: nowrap;
  }

  .hero-group {
    padding: 18px 18px 20px;
  }

  .hero-you {
    padding: 0 8px 8px;
  }

  .deadline-row {
    align-self: stretch;
    border-radius: 14px;
  }

  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .card-body {
    padding: 10px 11px 12px;
  }

  .card-title {
    font-size: 13px;
  }

  .price {
    font-size: 15.5px;
  }

  .add-btn {
    width: 32px;
    height: 32px;
  }

  .badge {
    top: 13px;
    left: 13px;
    font-size: 10.5px;
  }

  .modal-card {
    padding: 22px 18px;
  }

  .stats {
    gap: 8px;
  }

  .stat {
    padding: 14px;
  }

  .stat .value {
    font-size: 21px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }


  /* En pantallas angostas el botón de cada dato queda solo con el ícono para que el CVU entre entero. */
  .pay-card {
    padding: 16px;
  }

  .pay-row .copy-btn {
    width: 44px;
    height: 44px;
    padding: 0;
    justify-content: center;
  }

  .pay-row .copy-btn span {
    display: none;
  }

  .pay-row-text b.mono {
    font-size: 14.5px;
    letter-spacing: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------------------------------------------------------------- pagos: aviso, comprobantes, WhatsApp */

.pay-actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.pay-actions .btn {
  flex: 1 1 160px;
}

.pay-progress {
  position: relative;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.pay-progress .i {
  margin-top: 1px;
}

.receipts {
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: var(--glass);
}

.receipts h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 800;
}

.receipt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--stroke);
  font-size: 13.5px;
  color: var(--text-2);
}

.receipt-row .row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.phone-card {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--info) 40%, transparent);
  background: var(--info-soft);
  font-size: 13px;
  color: var(--text-2);
}

.phone-card strong {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 14px;
}

.phone-row {
  display: flex;
  gap: 8px;
}

.phone-row .input {
  min-height: 42px;
}

/* ---------------------------------------------------------------- admin: compras, actividad, reparto */

.round-bar {
  padding: 16px 20px;
}

.round-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.round-main h2 {
  margin: 2px 0 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.round-bar .hint {
  margin-top: 10px;
}

.select-sm {
  min-height: 34px;
  width: auto;
  max-width: 100%;
  font-size: 13px;
  border-radius: 10px;
}

.activity-list {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: grid;
  gap: 4px;
}

.activity-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 13.5px;
}

.activity-list li.is-new {
  background: var(--accent-soft);
}

.activity-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--glass-2);
  color: var(--text-2);
}

.activity-list li.is-new .activity-icon {
  color: var(--accent);
}

.activity-time {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.who a {
  color: var(--text-2);
}

.reparto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

.reparto-card {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: var(--glass);
}

.reparto-card.is-done {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--accent-soft);
}

.reparto-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.reparto-head b {
  display: block;
}

.reparto-head span {
  font-size: 12.5px;
  color: var(--muted);
}

.reparto-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
  font-size: 13.5px;
}

.print-box {
  display: none;
}

/* ---------------------------------------------------------------- impresión del reparto */

@media print {
  [data-print='reparto'] {
    background: #fff !important;
    color: #000 !important;
  }

  [data-print='reparto']::before,
  [data-print='reparto'] .topbar,
  [data-print='reparto'] .toasts,
  [data-print='reparto'] .no-print,
  [data-print='reparto'] #dashboard > :not(#reparto) {
    display: none !important;
  }

  [data-print='reparto'] main {
    padding: 0;
  }

  [data-print='reparto'] #reparto,
  [data-print='reparto'] .reparto-card {
    background: #fff !important;
    border: 1px solid #999 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    color: #000 !important;
  }

  [data-print='reparto'] .reparto-card {
    break-inside: avoid;
  }

  [data-print='reparto'] .reparto-grid {
    grid-template-columns: 1fr 1fr;
  }

  [data-print='reparto'] .pill,
  [data-print='reparto'] .muted,
  [data-print='reparto'] .reparto-head span,
  [data-print='reparto'] .panel-head p {
    color: #333 !important;
    background: none !important;
  }

  [data-print='reparto'] .print-box {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 6px;
    border: 1.5px solid #000;
    vertical-align: -1px;
  }
}

/* ---------------------------------------------------------------- seguimiento del pedido */

.tracker {
  margin: 0 24px;
  padding: 14px 0 16px;
  border-top: 1px solid var(--stroke);
}

.tracker ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 6px;
}

.tracker li {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

/* Línea que une los pasos. */
.tracker li:not(:first-child)::before {
  content: '';
  position: absolute;
  top: 10px;
  right: calc(50% + 14px);
  left: calc(-50% + 14px);
  height: 2px;
  border-radius: 2px;
  background: var(--glass-3);
}

.tracker li.done::before,
.tracker li.current::before {
  background: var(--accent);
}

.tracker-dot {
  position: relative;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--glass-3);
  background: var(--panel-solid);
  color: var(--accent-ink);
}

.tracker li.done .tracker-dot {
  border-color: var(--accent);
  background: var(--accent);
}

.tracker li.current .tracker-dot {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.tracker li.current .tracker-dot::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.tracker li.done,
.tracker li.current {
  color: var(--text);
}

.tracker li.current .tracker-label {
  color: var(--accent);
  font-weight: 800;
}

.tracker-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 12px 0 0;
  font-size: 13.5px;
  color: var(--text-2);
}

.notice.ok {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}

.notice.ok .i {
  color: var(--accent);
}

/* ---------------------------------------------------------------- reemplazos, precios e historial */

.flavor-sm {
  min-height: 34px;
  padding: 5px 12px;
  font-size: 13px;
}

.line-swap,
.line-delta,
.line-alt {
  margin-top: 5px;
  font-size: 12px;
  font-weight: 700;
}

.line-swap {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
}

.line-delta.up {
  color: var(--warn);
}

.line-delta.down {
  color: var(--accent);
}

.line-alt {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-weight: 600;
}

.line-alt select {
  max-width: 150px;
  padding: 3px 6px;
  border-radius: 8px;
  border: 1px solid var(--stroke-2);
  background: var(--glass);
  color: var(--text);
  font-size: 12px;
}

.line-alt select option {
  background: var(--panel-solid);
}

.price-box ul {
  margin: 6px 0 10px;
  padding-left: 18px;
}

.price-box li {
  margin: 2px 0;
}

.history-btn {
  margin-top: 14px;
}

.history h2 {
  margin: 0 0 14px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.history-card {
  margin-bottom: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: var(--glass);
}

.history-card header,
.history-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.history-card header span:not(.pill) {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
}

.history-card ul {
  list-style: none;
  margin: 10px 0;
  padding: 10px 0;
  border-block: 1px solid var(--stroke);
  display: grid;
  gap: 6px;
  font-size: 13.5px;
}

.history-card li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.history-card footer {
  font-weight: 800;
}

@media (max-width: 900px) {
  .tracker {
    margin: 0 20px;
  }
}

@media (max-width: 520px) {
  .tracker {
    margin: 0 18px;
  }

  .tracker li {
    font-size: 10.5px;
  }

  .tracker-dot {
    width: 18px;
    height: 18px;
  }

  .tracker li:not(:first-child)::before {
    top: 8px;
    right: calc(50% + 11px);
    left: calc(-50% + 11px);
  }
}

/* ---------------------------------------------------------------- admin: seguimiento, editor, estadísticas */

.stage-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pickup-form {
  margin-top: 16px;
  max-width: 640px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 18px;
}

.stats-grid h3 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 800;
}

.stats-grid .mini-table {
  min-width: 0;
}

.editor {
  width: 640px;
}

.editor h2 {
  margin: 0 40px 4px 0;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.editor-lines {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.editor-line,
.editor-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: var(--glass);
}

.editor-line > div:first-child,
.editor-result > div:first-child {
  min-width: 0;
}

.editor-line b,
.editor-result b {
  display: block;
  font-size: 13.5px;
}

.editor-line span,
.editor-result span {
  font-size: 12.5px;
  color: var(--muted);
}

.editor-results {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  max-height: 300px;
  overflow-y: auto;
}

.editor-result {
  flex-wrap: wrap;
}

.editor-result .flavors {
  gap: 6px;
}

.editor-result .chip {
  min-height: 32px;
  font-size: 12.5px;
}

.editor-foot {
  position: sticky;
  bottom: -26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px -26px -26px;
  padding: 14px 26px;
  border-top: 1px solid var(--stroke);
  background: var(--panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 0 0 24px 24px;
}

.editor-foot b {
  font-size: 18px;
  font-weight: 800;
  margin-left: 6px;
}

@media (max-width: 520px) {
  .editor-foot {
    margin: 16px -18px -22px;
    padding: 12px 18px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
}
