/* ═══════════════════════════════════════════════
   TALI · BUTTONS, TOAST, SUCCESS, PWA
═══════════════════════════════════════════════ */

/* ── Buttons ── */
.btn {
  width: 100%; padding: 16px; border: none; border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: transform .12s, opacity .2s, box-shadow .2s;
  -webkit-appearance: none; display: flex; align-items: center;
  justify-content: center; gap: 8px; letter-spacing: .3px;
}
.btn:active   { transform: scale(.975); }
.btn:disabled { opacity: .3; cursor: not-allowed; transform: none; }

.btn-primary { background: #111118; color: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.15); }
.btn-primary:hover { box-shadow: 0 4px 20px rgba(0,0,0,.25); }
body.dark .btn-primary { background: #f0f0ff; color: #111118; }

.btn-whatsapp { background: linear-gradient(135deg, #25d366, #128c7e); color: #fff; box-shadow: 0 4px 16px rgba(37,211,102,.25); font-size: 16px; }
.btn-whatsapp:hover { box-shadow: 0 6px 24px rgba(37,211,102,.35); }
.btn-whatsapp i { font-size: 18px; }

.btn-outline { background: transparent; color: var(--white); border: 1px solid var(--border2); }
.btn-outline:hover { border-color: var(--gray); }

/* ── Spinner ── */
.sp {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid rgba(0,0,0,.2); border-top-color: #111118;
  border-radius: 50%; animation: rot .7s linear infinite;
}
body.dark .sp { border-color: rgba(255,255,255,.3); border-top-color: #fff; }

/* ── Toast ── */
#toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 30px; padding: 10px 20px; font-size: 13px; color: var(--white);
  z-index: 99999; opacity: 0; transition: opacity .3s, transform .3s;
  pointer-events: none; white-space: nowrap; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 8px;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Success screen ── */
#success {
  display: none; flex-direction: column;
  align-items: center; justify-content: flex-start;
  text-align: center; padding: 28px 18px 24px;
  overflow-y: auto; animation: slideUp .4s ease; gap: 0;
}
.success-icon  { font-size: 52px; margin-bottom: 12px; animation: popIn .5s cubic-bezier(.34,1.56,.64,1); }
.success-title { font-family: 'Bebas Neue', sans-serif; font-size: 36px; letter-spacing: 5px; margin-bottom: 8px; }
.success-sub   { color: var(--gray2); font-size: 13px; line-height: 1.7; max-width: 300px; margin-bottom: 20px; }
.success-card  { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 15px; width: 100%; max-width: 340px; text-align: left; margin-bottom: 14px; }
.sr             { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; font-size: 13px; border-bottom: 1px solid var(--border); }
.sr:last-child  { border-bottom: none; }
.sr .sk         { color: var(--gray2); display: flex; align-items: center; gap: 6px; font-size: 12px; }
.sr .sk i       { font-size: 11px; }
.sr .sv         { font-weight: 500; font-size: 13px; text-align: right; max-width: 60%; }
.order-badge {
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); padding: 8px 14px;
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--cyan); letter-spacing: 1px; margin-bottom: 16px;
  width: 100%; max-width: 340px; display: flex; align-items: center; gap: 8px;
}
.order-badge i { font-size: 12px; }

/* ── PWA Install Banner ── */
#pwa-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 9999;
  background: linear-gradient(135deg, #f0f2f5 0%, #e4e8f0 100%);
  border-top: 1px solid rgba(0,150,200,.25);
  padding: 16px 18px calc(20px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 -8px 32px rgba(0,0,0,.10);
  transform: translateY(100%); transition: transform .45s cubic-bezier(.34,1.56,.64,1);
}
#pwa-banner.show { transform: translateY(0); }
#pwa-banner .pwa-top    { display: flex; align-items: center; gap: 14px; }
#pwa-banner .pwa-icon   { width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0; background: #e0e8f5; border: 1.5px solid rgba(0,150,200,.3); display: flex; align-items: center; justify-content: center; font-family: 'Bebas Neue', sans-serif; font-size: 28px; color: #0088bb; box-shadow: 0 0 16px rgba(0,150,200,.15); }
#pwa-banner .pwa-text   { flex: 1; }
#pwa-banner .pwa-title  { font-family: 'Bebas Neue', sans-serif; font-size: 20px; letter-spacing: 2px; color: #111118; line-height: 1; }
#pwa-banner .pwa-sub    { font-size: 12px; color: #666680; margin-top: 3px; line-height: 1.3; }
#pwa-banner .pwa-chips  { display: flex; gap: 6px; flex-wrap: wrap; }
#pwa-banner .pwa-chip   { font-size: 11px; color: #666680; background: rgba(0,0,0,.05); border: 1px solid rgba(0,0,0,.10); border-radius: 20px; padding: 3px 9px; display: flex; align-items: center; gap: 4px; }
#pwa-banner .pwa-btns   { display: flex; gap: 8px; }
#pwa-banner .pwa-btn-install  { flex: 1; padding: 13px; border-radius: 12px; background: #00d4ff; color: #000; border: none; font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 7px; box-shadow: 0 4px 16px rgba(0,212,255,.35); transition: transform .15s, box-shadow .15s; }
#pwa-banner .pwa-btn-install:active { transform: scale(.97); box-shadow: 0 2px 8px rgba(0,212,255,.2); }
#pwa-banner .pwa-btn-dismiss { padding: 13px 16px; border-radius: 12px; background: rgba(0,0,0,.05); color: #888899; border: 1px solid rgba(0,0,0,.10); font-family: 'DM Sans', sans-serif; font-size: 13px; cursor: pointer; transition: background .15s; }
#pwa-banner .pwa-btn-dismiss:hover { background: rgba(0,0,0,.08); }

/* ── iOS instructions sheet ── */
#pwa-ios {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 9999;
  background: #f0f2f5; border-top: 1px solid rgba(0,150,200,.2);
  border-radius: 18px 18px 0 0;
  padding: 20px 20px calc(24px + env(safe-area-inset-bottom));
  display: none; flex-direction: column; gap: 14px;
  box-shadow: 0 -8px 40px rgba(0,0,0,.10);
  animation: slideUp .35s cubic-bezier(.34,1.2,.64,1);
}
#pwa-ios.show       { display: flex; }
#pwa-ios .ios-title { font-family: 'Bebas Neue', sans-serif; font-size: 18px; letter-spacing: 2px; color: #111118; text-align: center; }
#pwa-ios .ios-steps { display: flex; flex-direction: column; gap: 10px; }
#pwa-ios .ios-step  { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #555566; }
#pwa-ios .ios-step-num { width: 26px; height: 26px; border-radius: 50%; background: rgba(0,150,200,.12); border: 1px solid rgba(0,150,200,.3); color: #0088bb; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
#pwa-ios .ios-icon  { font-size: 20px; }
#pwa-ios .ios-close { align-self: center; background: rgba(0,0,0,.05); border: 1px solid rgba(0,0,0,.10); border-radius: 10px; padding: 10px 32px; color: #888899; font-size: 13px; cursor: pointer; font-family: 'DM Sans', sans-serif; }

/* ── Botón Detalle (admin) ── */
#btn-detail { display: none; }
#btn-detail.active {
  background: rgba(99,179,237,.18);
  border-color: rgba(99,179,237,.5);
  color: #63b3ed;
}

/* ── Leyenda modo detalle ── */
#detail-legend {
  display: none;
  position: absolute;
  bottom: 120px;
  right: 12px;
  z-index: 700;
  background: rgba(10,12,20,.88);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: #c8d8e8;
  backdrop-filter: blur(8px);
  min-width: 148px;
  pointer-events: none;
}
#detail-legend.show { display: block; }
#detail-legend .dl-title {
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #6a8095;
  margin-bottom: 7px;
  font-weight: 700;
}
#detail-legend .dl-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
}
#detail-legend .dl-dot {
  width: 20px;
  height: 4px;
  border-radius: 2px;
  flex-shrink: 0;
}
