/* Demo La Copi · estilos compartidos por la portada, la pantalla del cliente
   y la de la tienda. El rojo sale de su web actual (#fe0a0a), oscurecido en
   claro para que el texto blanco encima pase AA. */

@font-face {
  font-family: "Inter";
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #f6f5f3;
  --surface: #ffffff;
  --surface-2: #efede9;
  --border: #e3e0da;
  --field-border: #8a857d;   /* 3.7:1 sobre blanco: borde de control AA */
  --text: #1b1a19;
  --text-dim: #5c5852;       /* 7.1:1 sobre blanco */
  --accent: #c8102e;         /* blanco encima: 5.9:1 */
  --accent-hover: #a50d26;
  --on-accent: #ffffff;
  --accent-soft: #fbe9ec;
  --accent-text: #b00e28;    /* 5.5:1 sobre --accent-soft */
  --good: #116b33;
  --good-soft: #e3f3e8;
  --warn: #8f5200;
  --warn-soft: #fdf1dc;
  --info: #1d5fbf;
  --info-soft: #e7effb;
  --wa-bg: #efeae2;
  --wa-burbuja: #ffffff;
  --wa-texto: #111b21;
  --wa-meta: #5c6b73;
  --wa-cabecera: #0b6b3a;
  --shadow: 0 2px 6px rgba(0, 0, 0, .08), 0 16px 40px -16px rgba(0, 0, 0, .28);
  --radius: 8px;
  --radius-lg: 12px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --dur: .16s;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111113;
    --surface: #1b1b1e;
    --surface-2: #161618;
    --border: #2c2c31;
    --field-border: #6f6d77;
    --text: #eceae6;
    --text-dim: #a6a39e;
    --accent: #ff6b6b;       /* texto #1a0606 encima: 7.6:1 */
    --accent-hover: #ff8585;
    --on-accent: #1a0606;
    --accent-soft: rgba(255, 107, 107, .14);
    --accent-text: #ff8a8a;
    --good: #4ade80;
    --good-soft: rgba(74, 222, 128, .13);
    --warn: #fbbf24;
    --warn-soft: rgba(251, 191, 36, .13);
    --info: #7cb8ff;
    --info-soft: rgba(124, 184, 255, .13);
    --wa-bg: #0b141a;
    --wa-burbuja: #1f2c34;
    --wa-texto: #e9edef;
    --wa-meta: #8696a0;
    --wa-cabecera: #1f2c34;
    --shadow: 0 2px 6px rgba(0, 0, 0, .4), 0 16px 40px -16px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #111113;
  --surface: #1b1b1e;
  --surface-2: #161618;
  --border: #2c2c31;
  --field-border: #6f6d77;
  --text: #eceae6;
  --text-dim: #a6a39e;
  --accent: #ff6b6b;
  --accent-hover: #ff8585;
  --on-accent: #1a0606;
  --accent-soft: rgba(255, 107, 107, .14);
  --accent-text: #ff8a8a;
  --good: #4ade80;
  --good-soft: rgba(74, 222, 128, .13);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, .13);
  --info: #7cb8ff;
  --info-soft: rgba(124, 184, 255, .13);
  --wa-bg: #0b141a;
  --wa-burbuja: #1f2c34;
  --wa-texto: #e9edef;
  --wa-meta: #8696a0;
  --wa-cabecera: #1f2c34;
  --shadow: 0 2px 6px rgba(0, 0, 0, .4), 0 16px 40px -16px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.15; margin: 0; text-wrap: balance; letter-spacing: -.02em; }
p { margin: 0; text-wrap: pretty; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; }

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

.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;
}

.icono { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- marca ---------- */

.marca {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 1.15rem; letter-spacing: -.03em; color: var(--text);
  text-decoration: none;
}
.marca-punto { width: 12px; height: 12px; border-radius: 3px; background: var(--accent); }
.marca small { font-weight: 500; font-size: .875rem; letter-spacing: 0; color: var(--text-dim); }

.etiqueta-demo {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-dim); font-size: .75rem; font-weight: 600; white-space: nowrap;
}

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 8px 16px;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  font-weight: 600; font-size: .9375rem; text-decoration: none; cursor: pointer;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.btn:hover { border-color: var(--field-border); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primario { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primario:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ancho { width: 100%; }
.btn-texto { border-color: transparent; background: transparent; color: var(--text-dim); padding-inline: 8px; }
.btn-texto:hover { color: var(--text); border-color: transparent; }
.btn-icono { width: 44px; padding: 0; }

/* ---------- formularios ---------- */

.campo { display: grid; gap: 4px; }
.campo label, .grupo legend { font-weight: 600; font-size: .875rem; }
.campo .ayuda { font-size: .8125rem; color: var(--text-dim); }

.input {
  width: 100%; min-height: 44px; padding: 8px 12px;
  border: 1px solid var(--field-border); border-radius: var(--radius);
  background: var(--surface);
  transition: border-color var(--dur) var(--ease);
}
.input:focus-visible { outline-offset: 1px; }
textarea.input { min-height: 88px; resize: vertical; }

.grupo { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; min-width: 0; }

/* Opciones tipo píldora: radio real, visualmente un botón segmentado. */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; flex-direction: column; justify-content: center;
  min-height: 44px; padding: 8px 16px;
  border: 1px solid var(--field-border); border-radius: var(--radius);
  background: var(--surface); font-weight: 600; font-size: .9375rem; line-height: 1.3;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.chip span small { font-weight: 500; font-size: .75rem; color: var(--text-dim); }
.chip input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); box-shadow: inset 0 0 0 1px var(--accent); }
.chip input:checked + span small { color: inherit; }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Opciones en lista (método de pago, motivo del turno). */
.opcion-fila { position: relative; display: block; }
.opcion-fila input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.opcion-fila > span {
  display: grid; grid-template-columns: 20px 1fr; gap: 4px 12px; align-items: start;
  padding: 12px 16px; border: 1px solid var(--field-border); border-radius: var(--radius);
  background: var(--surface);
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.opcion-fila .radio {
  width: 20px; height: 20px; margin-top: 2px; border-radius: 999px;
  border: 2px solid var(--field-border); background: var(--surface);
}
.opcion-fila strong { font-size: .9375rem; }
.opcion-fila small { grid-column: 2; color: var(--text-dim); font-size: .8125rem; line-height: 1.45; }
.opcion-fila input:checked + span { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.opcion-fila input:checked + span .radio { border-color: var(--accent); box-shadow: inset 0 0 0 4px var(--surface); background: var(--accent); }
.opcion-fila input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }

.casilla { display: flex; gap: 12px; align-items: flex-start; font-size: .875rem; color: var(--text-dim); }
.casilla input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }

.contador { justify-self: start; width: fit-content; display: inline-flex; align-items: center; border: 1px solid var(--field-border); border-radius: var(--radius); background: var(--surface); }
.contador button { width: 44px; height: 44px; border: 0; background: transparent; font-size: 1.25rem; cursor: pointer; border-radius: var(--radius); }
.contador button:disabled { opacity: .35; cursor: not-allowed; }
.contador input { width: 48px; height: 44px; border: 0; background: transparent; text-align: center; font-weight: 700; -moz-appearance: textfield; }
.contador input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* ---------- estados ---------- */

.estado {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  font-size: .75rem; font-weight: 700; white-space: nowrap;
}
.estado-pagado { background: var(--good-soft); color: var(--good); }
.estado-caja { background: var(--warn-soft); color: var(--warn); }
.estado-info { background: var(--info-soft); color: var(--info); }

/* ---------- chat de WhatsApp (simulado) ---------- */

.wa {
  border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
  background: var(--wa-bg);
}
.wa-cabecera {
  display: flex; align-items: center; gap: 12px; padding: 8px 12px;
  background: var(--wa-cabecera); color: #ffffff;
}
.wa-avatar {
  width: 32px; height: 32px; border-radius: 999px; background: #c8102e; color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: .75rem;
}
.wa-cabecera strong { display: block; font-size: .875rem; line-height: 1.3; }
.wa-cabecera small { display: block; font-size: .75rem; opacity: .85; line-height: 1.3; }
.wa-mensajes { display: grid; gap: 8px; padding: 12px; }
.wa-burbuja {
  max-width: 88%; padding: 8px 12px 4px; border-radius: 8px 8px 8px 2px;
  background: var(--wa-burbuja); color: var(--wa-texto);
  font-size: .875rem; line-height: 1.45;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .08);
}
.wa-burbuja time { display: block; text-align: right; font-size: .6875rem; color: var(--wa-meta); margin-top: 2px; }
.wa-nuevo { animation: aparecer .3s var(--ease); }

@keyframes aparecer { from { opacity: 0; } to { opacity: 1; } }

/* ---------- aviso flotante ---------- */

.toast-zona {
  position: fixed; left: 50%; bottom: 16px; translate: -50% 0; z-index: 50;
  display: grid; gap: 8px; width: min(440px, calc(100% - 32px));
  pointer-events: none;
}
.toast {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 16px; border-radius: var(--radius-lg);
  background: var(--text); color: var(--bg);
  font-size: .875rem; line-height: 1.45; box-shadow: var(--shadow);
  animation: aparecer .2s var(--ease);
}

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