/* ══════════════════════════════════════════════════════════════
   Página de pedido (checkout) y seguimiento del menú público.
   carta/delivery/checkout.html · carta/delivery/seguimiento.html
   Colores del local: --dc-brand / --dc-brand-text (vienen del template).
   ══════════════════════════════════════════════════════════════ */

:root {
  --dc-bg: #f5f5f7;
  --dc-card: #ffffff;
  --dc-text: #18181b;
  --dc-text-2: #52525b;
  --dc-muted: #8a8a93;
  --dc-line: #ececf0;
  --dc-border: #e2e2e8;
  --dc-ok: #16a34a;
  --dc-danger: #dc2626;
  --dc-radius: 16px;
  --dc-brand-soft: color-mix(in srgb, var(--dc-brand) 10%, transparent);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.dc {
  margin: 0;
  min-height: 100vh;
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 15px;
  color: var(--dc-text);
  background: var(--dc-bg);
  -webkit-font-smoothing: antialiased;
}
.dc [hidden] { display: none !important; }
.dc a { color: inherit; }
.mb-0 { margin-bottom: 0 !important; }

/* ── Encabezado ─────────────────────────────────────────────── */
.dc-top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top));
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--dc-line);
}
.dc-top-back {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  font-size: 1.15rem;
  text-decoration: none;
  background: var(--dc-bg);
  border-radius: 50%;
}
.dc-top-text { flex: 1 1 auto; min-width: 0; }
.dc-top h1 { margin: 0; font-size: 1.1rem; font-weight: 700; line-height: 1.2; }
.dc-top p {
  margin: 0;
  font-size: .78rem;
  color: var(--dc-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dc-top-logo {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  object-fit: cover;
  border-radius: 10px;
}

/* ── Contenido ──────────────────────────────────────────────── */
.dc-main {
  max-width: 620px;
  margin: 0 auto;
  padding: 14px 16px 120px;
}
.dc-card {
  margin-bottom: 12px;
  padding: 16px;
  background: var(--dc-card);
  border-radius: var(--dc-radius);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}
.dc-card h2 { margin: 0 0 12px; font-size: 1rem; font-weight: 600; }
.dc-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.dc-card-head h2 { margin: 0; }
.dc-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--dc-brand) !important;
  text-decoration: none;
}

/* Productos */
.dc-items { list-style: none; margin: 0; padding: 0; }
.dc-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--dc-line);
}
.dc-item:first-child { border-top: 0; }
.dc-item-info { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.dc-item-nombre { font-size: .92rem; font-weight: 500; line-height: 1.3; }
.dc-item-extra { font-size: .76rem; color: var(--dc-muted); line-height: 1.35; }
.dc-item-extra--nota { font-style: italic; }
.dc-item-precio { margin-top: 2px; font-size: .86rem; font-weight: 600; }

.dc-qty {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--dc-bg);
  border-radius: 999px;
}
.dc-qty-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 1rem;
  color: var(--dc-text);
  background: #fff;
  border: 0;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
  cursor: pointer;
}
.dc-qty-btn:active { transform: scale(.92); }
.dc-qty-num { min-width: 24px; text-align: center; font-size: .9rem; font-weight: 700; }

.dc-empty { padding: 26px 0 10px; text-align: center; color: var(--dc-muted); }
.dc-empty i { font-size: 2rem; }
.dc-empty p { margin: 6px 0 14px; }

/* Opciones grandes (envío / retiro) */
.dc-opciones { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dc-opciones--1 { grid-template-columns: minmax(0, 1fr); }
.dc-opcion { position: relative; margin: 0; cursor: pointer; }
.dc-opcion input { position: absolute; opacity: 0; pointer-events: none; }
.dc-opcion-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
  height: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--dc-border);
  border-radius: 14px;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.dc-opcion-box i { font-size: 1.3rem; color: var(--dc-muted); margin-bottom: 2px; }
.dc-opcion-tit { font-size: .9rem; font-weight: 600; line-height: 1.25; }
.dc-opcion-sub { font-size: .74rem; color: var(--dc-muted); line-height: 1.35; }
.dc-opcion input:checked + .dc-opcion-box {
  border-color: var(--dc-brand);
  background: var(--dc-brand-soft);
  box-shadow: 0 0 0 1px var(--dc-brand);
}
.dc-opcion input:checked + .dc-opcion-box i { color: var(--dc-brand); }
.dc-opcion input:focus-visible + .dc-opcion-box { outline: 2px solid var(--dc-brand); outline-offset: 2px; }

/* Chips (cuándo / pago) */
.dc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.dc-chip { position: relative; margin: 0; cursor: pointer; }
.dc-chip input { position: absolute; opacity: 0; pointer-events: none; }
.dc-chip span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  font-size: .86rem;
  font-weight: 500;
  border: 1.5px solid var(--dc-border);
  border-radius: 999px;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.dc-chip small { color: var(--dc-muted); font-weight: 400; }
.dc-chip input:checked + span {
  color: var(--dc-text);
  border-color: var(--dc-brand);
  background: var(--dc-brand-soft);
}
.dc-chip input:checked + span i { color: var(--dc-brand); }
.dc-chip input:focus-visible + span { outline: 2px solid var(--dc-brand); outline-offset: 2px; }

/* Campos */
.dc-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.dc-field { margin-bottom: 12px; min-width: 0; }
.dc-field label {
  display: block;
  margin-bottom: 5px;
  font-size: .78rem;
  font-weight: 500;
  color: var(--dc-text-2);
}
.dc-field label small { font-weight: 400; color: var(--dc-muted); }
.dc input:not([type=radio]):not([type=checkbox]),
.dc textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  font-family: inherit;
  font-size: 16px; /* evita el zoom automático en iOS */
  color: var(--dc-text);
  background: #fff;
  border: 1.5px solid var(--dc-border);
  border-radius: 12px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  -webkit-appearance: none;
  appearance: none;
}
.dc textarea { resize: vertical; line-height: 1.45; }
.dc input::placeholder,
.dc textarea::placeholder { color: #b4b4bd; }
.dc input:focus,
.dc textarea:focus { border-color: var(--dc-brand); box-shadow: 0 0 0 3px var(--dc-brand-soft); }
.dc input.is-invalid { border-color: var(--dc-danger); }
.dc-error { font-size: .76rem; color: var(--dc-danger); margin-top: 5px; }
.dc-error:empty { display: none; }
.dc-hint { font-size: .78rem; color: var(--dc-muted); margin: 6px 0 0; }
.dc-hora { max-width: 180px; margin: 12px 0 0; }

.dc-extra { margin-top: 14px; }
.dc-money { position: relative; }
.dc-money span {
  position: absolute;
  top: 50%;
  left: 13px;
  transform: translateY(-50%);
  color: var(--dc-muted);
  font-weight: 500;
}
.dc .dc-money input { padding-left: 28px; }

.dc-alias {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: var(--dc-bg);
  border-radius: 12px;
}
.dc-alias-label { display: block; font-size: .72rem; color: var(--dc-muted); }
.dc-alias strong { font-size: .95rem; word-break: break-all; }

/* Resumen */
.dc-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0;
  font-size: .9rem;
  color: var(--dc-text-2);
}
.dc-row--total {
  margin-top: 6px;
  padding-top: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--dc-text);
  border-top: 1px dashed var(--dc-border);
}
.dc-minimo {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 12px;
  font-size: .82rem;
  color: #92400e;
  background: #fffbeb;
  border-radius: 10px;
}

.dc-recordar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 4px 0;
  font-size: .84rem;
  color: var(--dc-text-2);
  cursor: pointer;
}
.dc-recordar input { width: 18px; height: 18px; accent-color: var(--dc-brand); }

/* Botones */
.dc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 16px;
  font-family: inherit;
  font-size: .86rem;
  font-weight: 600;
  text-decoration: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}
.dc-btn--brand { color: var(--dc-brand-text) !important; background: var(--dc-brand); }
.dc-btn--ghost { color: var(--dc-text); background: #fff; border: 1.5px solid var(--dc-border); }
.dc-btn--block { width: 100%; }

/* Barra inferior */
.dc-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 -6px 20px rgba(0, 0, 0, .06);
}
.dc-bar > * { max-width: 588px; margin-left: auto; margin-right: auto; }
.dc-bar-error {
  margin-bottom: 8px;
  padding: 8px 12px;
  font-size: .82rem;
  color: #991b1b;
  background: #fef2f2;
  border-radius: 10px;
}
.dc-enviar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 0 20px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: #25d366;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 8px 20px -8px rgba(37, 211, 102, .8);
  cursor: pointer;
  transition: transform .1s ease, opacity .15s ease;
}
.dc-enviar i { font-size: 1.25rem; }
.dc-enviar:active { transform: scale(.98); }
.dc-enviar:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.dc-enviar-total {
  margin-left: auto;
  padding: 3px 10px;
  font-size: .9rem;
  background: rgba(0, 0, 0, .12);
  border-radius: 999px;
}
.dc-enviar.is-loading { pointer-events: none; }
.dc-enviar.is-loading i { animation: dc-spin 1s linear infinite; }
@keyframes dc-spin { to { transform: rotate(360deg); } }

@media (max-width: 420px) {
  .dc-grid-2 { grid-template-columns: minmax(0, 1fr); }
}

/* ══════════════ Seguimiento ══════════════ */
.ds-estado {
  padding: 22px 18px 18px;
  text-align: center;
}
.ds-icono {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 10px;
  font-size: 1.8rem;
  color: var(--dc-brand-text);
  background: var(--dc-brand);
  border-radius: 50%;
}
.ds-icono--ok { color: #fff; background: var(--dc-ok); }
.ds-icono--cancelado { color: #fff; background: #9ca3af; }
.ds-icono--pulso { animation: ds-pulso 2s ease-out infinite; }
@keyframes ds-pulso {
  0% { box-shadow: 0 0 0 0 var(--dc-brand-soft), 0 0 0 0 color-mix(in srgb, var(--dc-brand) 30%, transparent); }
  100% { box-shadow: 0 0 0 18px transparent, 0 0 0 0 transparent; }
}
.ds-numero { font-size: .8rem; font-weight: 600; color: var(--dc-muted); letter-spacing: .04em; text-transform: uppercase; }
.ds-titulo { margin: 4px 0 4px; font-size: 1.35rem; font-weight: 700; }
.ds-sub { margin: 0; font-size: .88rem; color: var(--dc-text-2); }

.ds-pasos {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 22px 0 4px;
  padding: 0;
  list-style: none;
}
.ds-paso { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.ds-paso::before {
  content: "";
  position: absolute;
  top: 8px;
  right: 50%;
  width: 100%;
  height: 2px;
  background: var(--dc-border);
}
.ds-paso:first-child::before { display: none; }
.ds-paso-punto {
  position: relative;
  z-index: 1;
  width: 18px;
  height: 18px;
  background: #fff;
  border: 2px solid var(--dc-border);
  border-radius: 50%;
}
.ds-paso span { font-size: .7rem; color: var(--dc-muted); line-height: 1.25; }
.ds-paso.is-hecho::before,
.ds-paso.is-actual::before { background: var(--dc-brand); }
.ds-paso.is-hecho .ds-paso-punto { background: var(--dc-brand); border-color: var(--dc-brand); }
.ds-paso.is-actual .ds-paso-punto { border-color: var(--dc-brand); box-shadow: 0 0 0 4px var(--dc-brand-soft); }
.ds-paso.is-actual span { color: var(--dc-text); font-weight: 600; }

.ds-aviso {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  background: #ecfdf5;
  border-radius: var(--dc-radius);
}
.ds-aviso p { margin: 0; font-size: .86rem; color: #065f46; }
.ds-aviso .dc-btn { flex: 0 0 auto; color: #fff; background: #25d366; }

.ds-dato { display: flex; gap: 12px; padding: 8px 0; font-size: .88rem; }
.ds-dato i { flex: 0 0 auto; width: 20px; color: var(--dc-muted); font-size: 1rem; }
.ds-dato div { min-width: 0; }
.ds-dato small { display: block; color: var(--dc-muted); font-size: .76rem; }

.ds-linea { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: .88rem; }
.ds-linea small { display: block; color: var(--dc-muted); font-size: .75rem; }
.ds-acciones { display: grid; gap: 10px; margin-top: 4px; }
