/* ══════════════════════════════════════════════════════════════
   BarOrder — Web companion styles
   Tema oscuro / dorado, optimizado para Safari móvil
   ══════════════════════════════════════════════════════════════ */

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

:root {
  --bg:         #0D0D0D;
  --surface:    #1A1A1A;
  --card:       #222222;
  --border:     #333333;
  --gold:       #D4A843;
  --gold-light: #F0C060;
  --text:       #F5F5F5;
  --text-muted: #999999;
  --danger:     #E05555;
  --success:    #4CAF50;
  --green-bg:   #1DA462;
  --bg-amigo:   #0D0D0D;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  height: 100dvh;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
}

/* ── Layout ─────────────────────────────────────────────────── */
.app {
  max-width: 480px;
  margin: 0 auto;
  height: 100dvh;
  overflow: hidden;
}

/* ── Pantallas ──────────────────────────────────────────────── */
.screen { display: none; flex-direction: column; height: 100dvh; overflow: hidden; }
.screen.active { display: flex; }

#screen-order { height: 100dvh; overflow: hidden; }
.order-sticky-header { flex-shrink: 0; background: var(--bg); }

/* ── Header ─────────────────────────────────────────────────── */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 4px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
  border-bottom: 1px solid var(--border);
}
.logo-title { display: flex; align-items: center; gap: 8px; }
.logo-title span { font-size: 22px; }
.logo-title h1 { color: var(--gold); font-size: 22px; font-weight: 900; letter-spacing: 1px; }
.search-bar { padding: 4px 12px; background: var(--bg); }
.search-bar input { width: 100%; background: #1A1A1A; border: 1px solid #333; border-radius: 22px; padding: 5px 14px; color: #fff; font-size: 14px; outline: none; box-sizing: border-box; }
.search-bar input::placeholder { color: #666; }
.mesa-badge {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}
#order-mesa-code {
  font-size: 18px;
  font-weight: 900;
  color: #E03030;
  background: transparent;
  border: none;
  padding: 0;
}

/* ── Modo amigo (fondo marrón) ──────────────────────────────── */
body.amigo-mode { background: var(--bg-amigo); }
body.amigo-mode .app { background: var(--bg-amigo); }
body.amigo-mode #screen-home,
body.amigo-mode #screen-order,
body.amigo-mode #screen-confirmed,
body.amigo-mode #screen-reparto { background: var(--bg-amigo); }
body.amigo-mode .order-sticky-header { background: var(--bg-amigo); }
body.amigo-mode .top-bar { background: var(--bg-amigo); border-bottom-color: #7a2a3e; }
body.amigo-mode .search-bar { background: var(--bg-amigo); }
body.amigo-mode .search-bar input,
body.amigo-mode #search-input { background: #1A1A1A !important; border-color: #333 !important; }
body.amigo-mode .category-scroll { background: var(--bg-amigo); }
body.amigo-mode .drinks-grid { background: var(--bg-amigo); }
body.amigo-mode .section-header-wrap { background: var(--bg-amigo); }
body.amigo-mode .fab-area { background: var(--bg-amigo); }
body.amigo-mode .screen-reparto,
body.amigo-mode .reparto-scroll { background: var(--bg-amigo); }
body.amigo-mode .home-scroll,
body.amigo-mode .home-container { background: var(--bg-amigo); }
body.amigo-mode #catalogo-modal .modal-sheet,
body.amigo-mode #historial-modal .modal-sheet { background: var(--bg-amigo); }
body.amigo-mode #catalogo-modal .modal-drink-title,
body.amigo-mode #historial-modal .modal-drink-title { color: var(--gold); }
body.amigo-mode .catalogo-item { border-bottom-color: #4a3020; }
body.amigo-mode .historial-member { background: #4a3020; }

/* ── Home screen (amigo) ────────────────────────────────────── */
#screen-home { overflow: hidden; }
.home-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.home-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 22px 16px;
  gap: 0;
}
.home-logo { font-size: 36px; margin-bottom: 2px; }
.home-title { color: var(--gold); font-size: 24px; font-weight: 900; letter-spacing: 1.5px; margin-bottom: 2px; }
.home-fecha { color: var(--text-muted); font-size: 12px; text-transform: capitalize; margin-bottom: 6px; }
.home-code-box {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 4px 8px;
  width: 100%;
  text-align: center;
  margin-bottom: 6px;
}
.home-code-label { color: var(--gold); font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 4px; }
.home-group-name { color: var(--text); font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.home-code { color: var(--text-muted); font-size: 20px; font-weight: 700; letter-spacing: 1px; margin-bottom: 5px; }
.home-amigo-name { color: var(--gold); font-size: 15px; font-weight: 700; }
.home-ronda-box {
  background: transparent;
  padding: 6px 10px 2px;
  width: 100%;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
  margin-bottom: 8px;
  text-align: center;
}
.home-ronda-text { color: var(--gold); font-size: 15px; font-weight: 700; letter-spacing: 0.5px; }
.home-ronda-num  { color: var(--gold); font-size: 22px; font-weight: 900; }
/* Modo "Precios ocultos": el admin decide que los amigos no vean ningún precio.
   Ocultamos todas las zonas de precio (badges, totales, subtotales). */
body.precios-ocultos .price-badge,
body.precios-ocultos .catalogo-item-price,
body.precios-ocultos .precio-subtotal,
body.precios-ocultos .precio-linea,
body.precios-ocultos .precio-total {
  display: none !important;
}

/* Parpadeo solo cuando la ronda está activa ("Se está pidiendo en la RONDA N") */
@keyframes rondaBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.home-ronda-box.abierta .home-ronda-text,
.home-ronda-box.abierta .home-ronda-num {
  animation: rondaBlink 2.8s ease-in-out infinite;
}

/* Todos los estados usan estética "bar" — verde y tipografía serif italic (como "Bar Paco" del historial) */
.home-ronda-box .home-ronda-text,
.home-ronda-box.abierta .home-ronda-text,
.home-ronda-box.estado-lanzada .home-ronda-text,
.home-ronda-box.estado-esperando .home-ronda-text {
  color: #27AE60;
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-weight: 700;
}
.home-ronda-box .home-ronda-num,
.home-ronda-box.abierta .home-ronda-num,
.home-ronda-box.estado-lanzada .home-ronda-num,
.home-ronda-box.estado-esperando .home-ronda-num {
  color: #27AE60;
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
}
.home-orden-entregada {
  color: #27AE60;
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 10px;
  letter-spacing: 0.3px;
}
.home-pagador-lines { width: 100%; display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.home-pagador-row { display: flex; align-items: baseline; flex-wrap: wrap; }
.home-pagador-label { color: #999; font-size: 14px; font-weight: 700; }
.home-pagador-ronda-num { color: #999; font-size: 18px; font-weight: 900; margin: 0 1px; }
.home-pagador-nombre { color: #999; font-size: 18px; font-weight: 900; margin-left: 1px; }
.home-divider { height: 1px; background: var(--border); width: 100%; margin: 4px 0; }
.home-btn {
  width: 100%;
  border-radius: 14px;
  padding: 16px;
  font-size: 16px;
  font-weight: 800;
  border: 2px solid transparent;
  margin-bottom: 8px;
  cursor: pointer;
  background: transparent;
}
.home-btn-pedidos { border-color: var(--gold); color: #fff; background: #000; white-space: nowrap; }
.home-btn-pedidos:not(:disabled) {
  animation: borderPulse 2.8s ease-in-out infinite;
}
@keyframes borderPulse {
  0%, 100% { border-color: #D4A843; color: #fff; }
  50%      { border-color: rgba(212, 168, 67, 0.25); color: rgba(255, 255, 255, 0.35); }
}
.home-btn-pedidos:disabled {
  border-color: transparent;
  background: transparent;
  cursor: not-allowed;
  opacity: 1;
  color: #27AE60;
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
}
.home-btn-gold { border-color: var(--gold); color: var(--gold); background: #000; }
.home-btn-salir { border: none; color: var(--danger); background: transparent; padding: 8px; font-size: 13px; width: auto; display: inline-block; margin: 0 auto; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--danger); font-weight: 700; }

/* Modales info (catálogo e historial) */
.info-modal-sheet {
  display: flex;
  flex-direction: column;
  max-height: 80dvh;
}
.info-modal-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 12px;
  padding-bottom: 4px;
}
.info-modal-footer {
  flex-shrink: 0;
  padding-top: 12px;
}

/* Catálogo modal items */
.catalogo-item {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #1E1E1E;
  gap: 10px;
}
.catalogo-item-emoji { font-size: 20px; width: 30px; text-align: center; }
.catalogo-item-name { flex: 1; color: var(--text); font-size: 14px; }
.catalogo-item-price {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  background: #1A1A1A;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 3px 8px;
}

/* Historial modal items */
.historial-member {
  background: #1A1A1A;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
}
.historial-member-name { color: var(--gold); font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.historial-drink-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.historial-drink-row span:first-child { font-size: 16px; }
.historial-drink-row span:nth-child(2) { flex: 1; color: var(--text); font-size: 13px; }
.historial-drink-row span:last-child { color: var(--text-muted); font-size: 13px; }

/* ── Welcome / Name input ───────────────────────────────────── */
.welcome-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  gap: 16px;
  text-align: center;
}
.welcome-logo { font-size: 72px; }
.welcome-title { color: var(--gold); font-size: 32px; font-weight: 900; letter-spacing: 2px; }
.welcome-sub { color: var(--text-muted); font-size: 15px; margin-bottom: 16px; }

/* ── Forms ───────────────────────────────────────────────────── */
.field-group { width: 100%; display: flex; flex-direction: column; gap: 8px; }
label.field-label {
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}
input[type="text"] {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  color: var(--text);
  font-size: 16px;
  outline: none;
  -webkit-appearance: none;
}
input[type="text"]:focus { border-color: var(--gold); }
input[type="text"]::placeholder { color: var(--text-muted); }

/* ── Buttons ─────────────────────────────────────────────────── */
button {
  cursor: pointer;
  border: none;
  outline: none;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  width: 100%;
  background: var(--gold);
  color: #000;
  font-size: 15px;
  font-weight: 800;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 4px 16px rgba(212,168,67,.35);
  transition: opacity .15s;
}
.btn-primary:active { opacity: 0.85; }
.btn-primary:disabled { background: var(--border); box-shadow: none; color: var(--text-muted); }

.btn-secondary {
  width: 100%;
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  border-radius: 14px;
  padding: 14px;
  border: 1px solid var(--border);
}

.btn-danger {
  width: 100%;
  background: transparent;
  color: var(--danger);
  font-size: 15px;
  font-weight: 600;
  border-radius: 12px;
  padding: 12px;
  border: 1px solid var(--danger);
}

.btn-danger-outline {
  width: 100%;
  background: transparent;
  color: #CC3333;
  font-size: 13px;
  font-weight: 600;
  border-radius: 10px;
  padding: 8px;
  border: 1px solid #CC3333;
  cursor: pointer;
}
.ronda-badge {
  background: #00BCD4;
  color: #000;
  font-size: 13px;
  font-weight: 800;
  border-radius: 10px;
  padding: 4px 10px;
  white-space: nowrap;
}
.ronda-tag-brown {
  background: #8B5E3C;
  color: #FFD600;
  font-size: 13px;
  font-weight: 800;
  border-radius: 10px;
  padding: 4px 10px;
  white-space: nowrap;
}

.btn-orange-outline {
  width: 100%;
  background: transparent;
  color: #E87B00;
  font-size: 15px;
  font-weight: 700;
  border-radius: 12px;
  padding: 12px;
  border: 1px solid #E87B00;
  cursor: pointer;
}
.btn-orange-outline:disabled {
  opacity: 0.35;
  cursor: default;
}

.btn-icon {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}

/* ── Category filter ─────────────────────────────────────────── */
.category-scroll {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 12px;
}
.cat-pill {
  flex-shrink: 0;
  padding: 5px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.cat-pill.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #000;
  font-weight: 800;
}
.price-disclaimer {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--gold);
  text-align: center;
  opacity: 0.8;
}

/* ── Drinks grid ─────────────────────────────────────────────── */
.drinks-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: start;
  gap: 8px;
  padding: 2px 10px 110px;
  flex: 1;
  overflow-y: auto;
}
.section-header-wrap {
  grid-column: 1 / -1;
  margin-top: 8px;
}
.section-header-wrap:first-child {
  margin-top: 0;
}
.section-header {
  color: var(--gold);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 0 2px;
}
.section-line {
  height: 2px;
  background: #E87B00;
  border-radius: 1px;
  margin: 4px 0 8px;
}
.price-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  color: #FFB347;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}
.drink-card {
  background: var(--card);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
  transition: border-color .15s;
  box-sizing: border-box;
}
.drink-card.active {
  border-color: var(--gold);
  background: #2A2010;
}
.drink-card .qty-badge {
  position: absolute;
  top: 7px; right: 7px;
  background: var(--gold);
  border-radius: 10px;
  min-width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  font-size: 11px;
  font-weight: 800;
  color: #000;
}
.drink-emoji { font-size: 42px; margin-top: 4px; }
.drink-name {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  line-height: 1.3;
  word-break: break-word;
}
.drink-controls { display: flex; gap: 6px; margin-top: 4px; padding-top: 0; }
.btn-minus, .btn-plus {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}
.btn-minus { background: var(--border); color: var(--text); }
.btn-plus  { background: var(--gold);   color: #000; }
.btn-minus:active, .btn-plus:active { opacity: 0.75; }

.selection-tags {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  margin-top: 4px;
}
.sel-tag {
  background: var(--surface);
  border: 1px solid var(--gold);
  border-radius: 6px;
  padding: 3px 6px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  line-height: 1.3;
}

.mixer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 4px;
  width: 100%;
}
.mixer-pill {
  padding: 3px 6px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mixer-pill.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #000;
  font-weight: 800;
}

/* ── Sticky FAB ──────────────────────────────────────────────── */
.fab-area {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  padding: 8px 16px env(safe-area-inset-bottom, 10px);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fab-btns-row {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 10px;
}
.fab-btn-confirm {
  width: 80px;
  background: var(--gold);
  color: #000;
  font-size: 11px;
  font-weight: 800;
  border-radius: 10px;
  padding: 8px 4px;
  border: none;
  line-height: 1.4;
  cursor: pointer;
  text-align: center;
  text-transform: uppercase;
}
.fab-btn-delete {
  width: 80px;
  background: transparent;
  color: #CC3333;
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  padding: 8px 4px;
  border: 1px solid #CC3333;
  line-height: 1.4;
  cursor: pointer;
  text-align: center;
  text-transform: uppercase;
}

/* ── Confirmed state ─────────────────────────────────────────── */
.confirmed-banner {
  margin: 24px 16px 0;
  background: #0d2e1a;
  border: 1px solid var(--success);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
}
.confirmed-banner .check-icon { font-size: 48px; margin-bottom: 8px; }
.confirmed-banner h2 { color: var(--success); font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.confirmed-banner p { color: var(--text-muted); font-size: 14px; }

.confirmed-drinks { padding: 16px; padding-bottom: 140px; display: flex; flex-direction: column; gap: 0; flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.confirmed-drinks-card {
  background: #C8A97E;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.confirmed-drinks-title {
  color: #3B2A1A;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.confirmed-ronda {
  color: #3B2A1A;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.confirmed-total {
  color: #3B2A1A;
  font-size: 18px;
  font-weight: 700;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #A07840;
  text-align: right;
}
.confirmed-drink-row {
  background: transparent;
  border-radius: 0;
  padding: 12px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #A07850;
}
.confirmed-drink-row:last-child { border-bottom: none; }
.confirmed-drink-emoji { font-size: 32px; }
.confirmed-drink-name { flex: 1; color: #1A1008; font-size: 19px; font-weight: 700; }
.confirmed-drink-qty {
  background: #7A5230;
  border-radius: 10px;
  padding: 4px 14px;
  font-size: 17px;
  font-weight: 900;
  color: #fff;
}

/* ── Reparto view ────────────────────────────────────────────── */
.screen-reparto { background: #C8A97E; }
.top-bar-reparto { background: #C8A97E; border-bottom-color: #B8864A; }
.top-bar-reparto h1 { color: #3B1F00; }
.top-bar-reparto span { color: #3B1F00; }
.reparto-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}
.reparto-card {
  background: #C8A97E;
  border-radius: 20px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.reparto-header { text-align: center; padding: 8px 0; }
.reparto-emoji { font-size: 56px; }
.reparto-title { color: #3B1F00; font-size: 24px; font-weight: 900; margin: 8px 0 4px; }
.reparto-sub { color: #5C3010; font-size: 15px; }
.reparto-total { color: #3B1F00; font-size: 16px; font-weight: 800; background: #B8864A; border-radius: 14px; padding: 14px; text-align: right; margin-top: 4px; }

.order-line {
  background: #B8864A;
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.order-line-top { display: flex; align-items: center; gap: 10px; }
.order-line-emoji { font-size: 26px; }
.order-line-name { flex: 1; color: #1A0A00; font-size: 17px; font-weight: 800; }
.order-line-qty {
  font-size: 15px;
  font-weight: 900;
  color: #000;
}
.order-line-personas { color: #3B1F00; font-size: 13px; line-height: 1.5; }

.reparto-aviso {
  background: #B8864A;
  border-radius: 14px;
  padding: 14px;
  color: #1A0A00;
  font-size: 15px;
  line-height: 1.5;
  text-align: center;
}
.reparto-conducir {
  color: #3B1F00;
  font-size: 18px;
  font-weight: 700;
}

/* ── Spinner ─────────────────────────────────────────────────── */
.spinner {
  display: flex; align-items: center; justify-content: center;
  padding: 60px 0;
}
.spinner::after {
  content: '';
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Cerrado ─────────────────────────────────────────────────── */
.closed-screen {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px 24px; text-align: center; gap: 12px;
}
.closed-emoji { font-size: 64px; }
.closed-title { color: var(--text); font-size: 22px; font-weight: 800; }
.closed-sub { color: var(--text-muted); font-size: 15px; }

/* ── Voice & Chat en pantalla pedido ─────────────────────────── */
.fab-tools-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 2px 0 0;
}
.voice-fab {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #000;
  border: 1px solid #444;
  color: #3399FF;
  font-size: 22px;
  display: none; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}
.voice-fab.listening {
  background: #3D0000;
  border-color: #FF3333;
  animation: voice-pulse 1s ease-in-out infinite;
}
@keyframes voice-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}
.order-chat-fab {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}
.voice-bubble {
  position: fixed;
  bottom: 100px; left: 50%;
  transform: translateX(-50%);
  background: #1A1A1A;
  border: 1px solid #D4A843;
  border-radius: 12px;
  padding: 10px 16px;
  max-width: 320px;
  width: 90%;
  color: #fff;
  font-size: 14px;
  text-align: center;
  font-style: italic;
  z-index: 201;
  text-align: center;
}

/* ── Chat FAB flotante ───────────────────────────────────────── */
.chat-fab {
  position: fixed;
  bottom: 12px; right: 14px;
  width: auto; height: auto;
  padding: 6px 10px;
  border-radius: 0;
  background: transparent;
  border: none;
  font-size: 28px;
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  cursor: pointer;
  z-index: 50;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
  transition: opacity .2s;
}
.chat-fab-label {
  color: var(--gold);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.chat-fab.unread {
  background: #3D1A00;
  border-color: var(--gold);
}
.chat-fab.unread::after {
  content: '';
  position: absolute;
  top: 8px; right: 8px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--bg);
}

/* ── Chat modal (mismos colores que el admin nativo: oscuro + dorado) ─── */
.chat-sheet {
  width: 100%; max-width: 480px;
  height: 78dvh;
  max-height: 78dvh;
  background: #1A1A1A;
  border-radius: 20px 20px 0 0;
  border-top: 1px solid #333;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 40px 14px 20px;
  border-bottom: 1px solid #333;
  flex-shrink: 0;
  background: #1A1A1A;
}
.chat-title { color: #F5F5F5; font-size: 17px; font-weight: 800; flex: 1; }
.chat-close-btn {
  padding: 6px 12px;
  border-radius: 10px;
  background: #D4A843;
  border: 1px solid #D4A843;
  color: #000;
  font-size: 14px; font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
}
.chat-close-full-btn {
  width: calc(100% - 20px);
  margin: 4px 10px 10px;
  padding: 12px;
  border-radius: 12px;
  background: #D4A843;
  color: #000;
  font-size: 16px; font-weight: 800;
  border: none;
  cursor: pointer;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 40px 12px 16px;
  display: flex;
  flex-direction: column;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  width: 100%;
  background: #1A1A1A;
}
.chat-empty {
  color: #999;
  font-size: 14px;
  text-align: center;
  margin: auto;
  padding: 40px 0;
}

.chat-msg-row {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 6px;
  padding: 7px 0;
  border-bottom: 1px solid #333;
}
.chat-msg-name {
  font-size: 14px;
  font-weight: 900;
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
}
.chat-msg-text {
  flex: 1;
  color: #F5F5F5;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.35;
  word-break: break-word;
  white-space: pre-wrap;
  min-width: 0;
  overflow-wrap: anywhere;
}
.chat-msg-time {
  color: #999;
  font-size: 15px;
  width: 42px;
  min-width: 42px;
  text-align: right;
  flex-shrink: 0;
}

.chat-quick-emojis {
  display: flex;
  flex-direction: row;
  gap: 6px;
  padding: 8px 12px;
  border-top: 1px solid #333;
  flex-shrink: 0;
}
.chat-quick-emoji {
  background: #0D0D0D;
  border: 1px solid #333;
  border-radius: 20px;
  width: 38px;
  height: 38px;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 40px 20px 16px;
  border-top: 1px solid #333;
  flex-shrink: 0;
  box-sizing: border-box;
  width: 100%;
}
#chat-input {
  flex: 1;
  background: #0D0D0D;
  border: 1px solid #333;
  border-radius: 20px;
  padding: 10px 16px;
  color: #F5F5F5;
  font-size: 15px;
  font-family: inherit;
  resize: none;
  outline: none;
  height: 42px;
  max-height: 42px;
  overflow-y: auto;
  -webkit-appearance: none;
}
#chat-input:focus { border-color: #D4A843; }
#chat-input::placeholder { color: #999; }

.chat-send-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--gold);
  color: #000;
  font-size: 20px;
  font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: opacity .15s;
}
.chat-send-btn:disabled { background: var(--border); color: var(--text-muted); }

/* ── Brand/region picker modal ───────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.6);
  display: flex; align-items: flex-end; justify-content: center;
}
.modal-sheet {
  width: 100%; max-width: 480px;
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  padding: 0 20px 36px;
  max-height: 75dvh;
  display: flex; flex-direction: column;
}
.modal-handle {
  width: 40px; height: 4px;
  background: var(--border); border-radius: 2px;
  align-self: center; margin: 12px 0;
  flex-shrink: 0;
}
.modal-drink-title {
  color: var(--gold); font-size: 19px; font-weight: 800;
  text-align: center; margin-bottom: 6px; flex-shrink: 0;
}
.modal-back {
  display: flex; align-items: center; gap: 6px;
  background: none; color: var(--text-muted);
  font-size: 15px; font-weight: 600;
  padding: 6px 0; margin-bottom: 4px; flex-shrink: 0;
}
.modal-back-arrow { color: var(--gold); font-size: 24px; font-weight: 700; line-height: 1; }
.modal-step-label {
  color: var(--text-muted); font-size: 11px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase;
  margin-bottom: 8px; flex-shrink: 0;
}
.modal-options {
  overflow-y: auto; flex: 1;
  -webkit-overflow-scrolling: touch;
}
.modal-option {
  width: 100%; display: flex; align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  background: none; color: var(--text);
  font-size: 16px; font-weight: 600;
  text-align: left;
}
.modal-option span:first-child { flex: 1; }
.modal-option-arrow { color: var(--text-muted); font-size: 20px; }
.modal-option:active { opacity: 0.7; }
