/* =========================================
   LO DE FLOR — Estilos principales
   Paleta: Naranja tostado, crema, café oscuro
   ========================================= */

:root {
  --bg: #1a0a00;
  --bg2: #2a1200;
  --bg3: #3a1c05;
  --surface: #2e1508;
  --surface2: #3f1f0a;
  --orange: #c8621a;
  --orange-light: #e07830;
  --orange-dim: rgba(200,98,26,0.15);
  --cream: #f5e6c8;
  --cream-dim: #c9b48a;
  --gold: #d4a843;
  --text: #f0ddb8;
  --text-dim: #9e856a;
  --text-muted: #6b5540;
  --border: rgba(200,98,26,0.25);
  --border-strong: rgba(200,98,26,0.5);
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-card: 0 2px 12px rgba(0,0,0,0.3);
}

* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color: transparent; }

html { font-size: 16px; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---- SPLASH SCREEN ---- */
#splash {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 9999;
  gap: 1rem;
  transition: opacity 0.6s ease;
}
#splash.hidden { opacity: 0; pointer-events: none; }
#splash .logo-big {
  width: 120px; height: 120px;
  background: var(--orange);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 52px;
  box-shadow: 0 0 40px rgba(200,98,26,0.4);
  animation: pulse 2s ease-in-out infinite;
}
#splash h1 {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--cream);
  letter-spacing: -0.5px;
}
#splash p { color: var(--text-dim); font-size: 0.95rem; }
@keyframes pulse {
  0%,100% { box-shadow: 0 0 40px rgba(200,98,26,0.4); }
  50% { box-shadow: 0 0 60px rgba(200,98,26,0.7); }
}

/* ---- HEADER ---- */
#app-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 1rem;
  display: flex; align-items: center; gap: 0.75rem;
  height: 62px;
  backdrop-filter: blur(8px);
}
.header-logo {
  width: 38px; height: 38px;
  background: var(--orange);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.header-info { flex: 1; }
.header-info h2 {
  font-size: 1rem; font-weight: 700;
  color: var(--cream); line-height: 1.1;
}
.header-info p { font-size: 0.75rem; color: var(--text-dim); }
.mesa-badge {
  background: var(--orange);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.cart-btn {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--cream);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex; align-items: center; gap: 4px;
  transition: background 0.2s;
}
.cart-btn:active { background: var(--surface2); }
.cart-count {
  position: absolute; top: -6px; right: -6px;
  background: var(--orange);
  color: #fff;
  font-size: 0.65rem; font-weight: 700;
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  display: none;
}
.cart-count.visible { display: flex; }

/* ---- CATEGORY TABS ---- */
#cat-tabs {
  display: flex;
  overflow-x: auto;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}
#cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.cat-tab.active {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}

/* ---- MENU SECTIONS ---- */
#menu-content { padding: 1rem; padding-bottom: 8rem; }

.section-header {
  display: flex; align-items: center; gap: 0.5rem;
  margin: 1.5rem 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.section-header:first-child { margin-top: 0; }
.section-emoji { font-size: 1.3rem; }
.section-title {
  font-size: 1rem; font-weight: 700;
  color: var(--orange-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.menu-grid {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.menu-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  display: flex; align-items: center; gap: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.menu-item::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: transparent;
  transition: background 0.2s;
}
.menu-item.in-cart::before { background: var(--orange); }
.menu-item:active { transform: scale(0.98); }

.item-emoji { font-size: 1.8rem; flex-shrink: 0; width: 42px; text-align: center; }
.item-info { flex: 1; min-width: 0; }
.item-name {
  font-size: 0.95rem; font-weight: 600;
  color: var(--cream);
  line-height: 1.2;
}
.item-desc {
  font-size: 0.78rem; color: var(--text-dim);
  margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.item-price {
  font-size: 1rem; font-weight: 700;
  color: var(--gold);
  flex-shrink: 0;
}
.item-actions {
  display: flex; align-items: center; gap: 4px;
  flex-shrink: 0;
}
.qty-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface2);
  color: var(--cream);
  font-size: 1rem; font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.qty-btn.add { background: var(--orange); border-color: var(--orange); color:#fff; }
.qty-btn:active { transform: scale(0.9); }
.qty-num {
  font-size: 0.9rem; font-weight: 700;
  color: var(--cream);
  min-width: 20px; text-align: center;
}

/* ---- FLOATING ACTIONS BAR ---- */
#float-bar {
  position: fixed;
  bottom: 1rem; left: 1rem; right: 1rem;
  display: flex; gap: 0.5rem;
  z-index: 200;
}
.float-btn {
  flex: 1;
  padding: 0.85rem 0.5rem;
  border: none; border-radius: var(--radius);
  font-size: 0.8rem; font-weight: 700;
  cursor: pointer;
  display: flex; flex-direction: column;
  align-items: center; gap: 2px;
  transition: transform 0.15s, opacity 0.15s;
  letter-spacing: 0.2px;
}
.float-btn:active { transform: scale(0.96); }
.float-btn .ficon { font-size: 1.3rem; }

.btn-mesero {
  background: var(--surface2);
  border: 1px solid var(--border-strong);
  color: var(--cream);
}
.btn-cuenta {
  background: var(--surface2);
  border: 1px solid var(--border-strong);
  color: var(--cream);
}
.btn-pedido {
  flex: 2;
  background: var(--orange);
  color: #fff;
  box-shadow: 0 4px 16px rgba(200,98,26,0.5);
}
.btn-pedido:disabled {
  background: var(--surface2);
  color: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
}

/* ---- MODAL OVERLAY ---- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex; align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-sheet {
  width: 100%;
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
  border-top: 2px solid var(--orange);
  padding: 1rem 1.25rem 2rem;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 90dvh;
  overflow-y: auto;
}
.modal-overlay.open .modal-sheet { transform: translateY(0); }

.modal-handle {
  width: 40px; height: 4px;
  background: var(--border-strong);
  border-radius: 2px;
  margin: 0 auto 1rem;
}
.modal-title {
  font-size: 1.1rem; font-weight: 700;
  color: var(--cream); margin-bottom: 0.25rem;
}
.modal-sub { font-size: 0.85rem; color: var(--text-dim); margin-bottom: 1.25rem; }

/* ---- ORDER SUMMARY INSIDE MODAL ---- */
.order-list { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.order-line {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.6rem 0.75rem;
  background: var(--bg3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.order-line-name { font-size: 0.9rem; color: var(--cream); flex: 1; }
.order-line-qty {
  font-size: 0.8rem; color: var(--text-dim);
  padding: 2px 8px;
  background: var(--surface2);
  border-radius: 10px;
  margin: 0 0.5rem;
}
.order-line-price { font-size: 0.9rem; font-weight: 600; color: var(--gold); }

.order-total {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem;
  background: var(--orange-dim);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  margin-bottom: 1rem;
}
.total-label { font-size: 0.9rem; color: var(--text-dim); }
.total-amount { font-size: 1.3rem; font-weight: 700; color: var(--gold); }

.order-note-label { font-size: 0.85rem; color: var(--text-dim); margin-bottom: 0.4rem; }
.order-note {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0.6rem 0.75rem;
  font-size: 0.9rem;
  resize: none;
  font-family: inherit;
  margin-bottom: 1rem;
}
.order-note:focus { outline: none; border-color: var(--orange); }

.btn-confirm {
  width: 100%;
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 0.9rem;
  font-size: 1rem; font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
}
.btn-confirm:active { background: var(--orange-light); }
.btn-cancel {
  width: 100%;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  font-size: 0.9rem;
  cursor: pointer;
  margin-top: 0.5rem;
}

/* ---- TOAST ---- */
#toast {
  position: fixed;
  top: 1rem; left: 50%; transform: translateX(-50%) translateY(-120px);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 0.6rem 1.25rem;
  font-size: 0.85rem; color: var(--cream);
  z-index: 1000;
  white-space: nowrap;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#toast.show { transform: translateX(-50%) translateY(0); }
#toast.success { border-color: #2ecc71; color: #2ecc71; }
#toast.warning { border-color: var(--gold); color: var(--gold); }
#toast.error { border-color: #e74c3c; color: #e74c3c; }

/* ---- ESTADO ENVIADO ---- */
#success-screen {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 800;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1rem;
  padding: 2rem;
  text-align: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.4s;
}
#success-screen.show { opacity: 1; pointer-events: all; }
.success-icon {
  font-size: 4rem;
  animation: bounceIn 0.6s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes bounceIn {
  from { transform: scale(0); }
  to { transform: scale(1); }
}
#success-screen h2 { font-size: 1.5rem; color: var(--cream); }
#success-screen p { color: var(--text-dim); font-size: 0.95rem; line-height: 1.6; }
.btn-back {
  background: var(--orange);
  color: #fff; border: none;
  border-radius: var(--radius);
  padding: 0.85rem 2rem;
  font-size: 1rem; font-weight: 700;
  cursor: pointer;
  margin-top: 0.5rem;
}

/* ---- EMPTY CART ---- */
.empty-cart {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty-cart .icon { font-size: 3rem; margin-bottom: 0.5rem; }

/* ---- MESERO / CUENTA MODAL ---- */
.action-modal-title {
  font-size: 1.5rem; text-align: center; margin-bottom: 0.5rem;
}
.action-modal-body {
  text-align: center; color: var(--text-dim);
  font-size: 0.9rem; margin-bottom: 1.5rem;
  line-height: 1.6;
}
.btn-action-confirm {
  width: 100%;
  padding: 0.9rem;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem; font-weight: 700;
  cursor: pointer;
  margin-bottom: 0.5rem;
}
.btn-action-orange { background: var(--orange); color:#fff; }
.btn-action-green { background: #27ae60; color:#fff; }
