@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

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

:root {
  /* Colores Primarios (Inspirados en el fuego y la brasa) */
  --primary: #E65100;       /* Naranja vibrante: Representa la llama viva */
  --primary-dark: #BF360C;  /* Terracota oscuro: El color de la carne al barril */
  --primary-light: #FF8A50; /* Tono suave para hovers y detalles */

  /* Colores de Acento (Inspirados en el maíz y complementos) */
  --accent: #FFB300;        /* Dorado/Amarillo: Representa las arepas y el brillo del asado */
  --accent-dark: #C67100;   /* Tono para sombras de botones */

  /* Colores de Fondo y Superficie (Inspirados en el carbón y el hierro) */
  --bg: #120800;            /* Negro cálido: Carbón encendido */
  --bg2: #1E0E00;           /* Gris tostado: Brasa de noche */
  --card: #2A1508;          /* Tarjetas en tono madera quemada */
  --card2: #361D0A;         /* Superficie secundaria cálida */
  --border: #4A2810;        /* Bordes con subtono ámbar */

  /* Tipografía y Estado */
  --text: #F5F5F5;          /* Blanco cálido: Legibilidad sin cansar la vista */
  --text-muted: #B8906A;    /* Crema ámbar: Descriptores y textos secundarios */
  --success: #43A047;       /* Verde para confirmaciones de pedido */
  --white: #FFFFFF;
  
  /* Detalles de Diseño */
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.7), 0 2px 12px rgba(230, 81, 0, 0.15);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.4), 0 1px 4px rgba(230,81,0,0.1);
}

html { font-size: 16px; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(230,81,0,0.18) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(191,54,12,0.12) 0%, transparent 60%);
  color: var(--text);
  min-height: 100vh;
}

/* ── HEADER ── */
.header {
  background: linear-gradient(135deg, var(--bg2) 0%, #2A1000 100%);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
  box-shadow: 0 2px 16px rgba(230,81,0,0.12);
}
.header-logo { display: flex; align-items: center; gap: 10px; }
.header-logo img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid var(--primary); }
.header-logo span { font-size: 1.1rem; font-weight: 800; color: var(--primary-light); letter-spacing: -0.5px; }
.header-logo .tagline { font-size: 0.7rem; color: var(--text-muted); font-weight: 400; }
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.cart-btn {
  background: var(--primary); color: #fff; border: none; border-radius: 50px;
  padding: 8px 16px; font-size: 0.85rem; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; gap: 6px; transition: background 0.2s;
  text-decoration: none;
}
.cart-btn:hover { background: var(--primary-dark); }
.cart-badge {
  background: var(--accent); color: #000; border-radius: 50%;
  width: 20px; height: 20px; font-size: 0.7rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}

/* ── PROGRESS BAR ── */
.progress-wrap {
  background: linear-gradient(135deg, var(--bg2) 0%, #240F00 100%);
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}
.progress-steps { display: flex; align-items: center; justify-content: center; gap: 0; }
.step {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  flex: 1; position: relative;
}
.step:not(:last-child)::after {
  content: ''; position: absolute; top: 14px; left: 60%; width: 80%; height: 2px;
  background: var(--border); z-index: 0;
}
.step.active:not(:last-child)::after, .step.done:not(:last-child)::after { background: var(--primary); }
.step-dot {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--border); color: var(--text-muted);
  font-size: 0.75rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 1; transition: all 0.3s;
}
.step.active .step-dot { background: var(--primary); color: #fff; box-shadow: 0 0 0 4px rgba(230,81,0,0.3), 0 0 12px rgba(230,81,0,0.4); }
.step.done .step-dot { background: var(--success); color: #fff; }
.step-label { font-size: 0.6rem; font-weight: 600; color: var(--text-muted); text-align: center; }
.step.active .step-label { color: var(--primary-light); }
.step.done .step-label { color: var(--success); }

/* ── MAIN CONTENT ── */
.main { padding: 20px; max-width: 1200px; margin: 0 auto; }

/* ── PAGE TITLE ── */
.page-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 4px; }
.page-subtitle { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 20px; }

/* ── CATEGORY FILTER ── */
.category-row {
  display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 20px;
  scrollbar-width: none;
  margin-left: -20px; margin-right: -20px; padding-left: 20px; padding-right: 20px;
}
.category-row::-webkit-scrollbar { display: none; }
.cat-btn {
  background: var(--card); color: var(--text-muted); border: 1px solid var(--border);
  border-radius: 50px; padding: 6px 16px; font-size: 0.8rem; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: all 0.2s;
}
.cat-btn.active, .cat-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(230,81,0,0.35);
}

/* ── PRODUCTS ROWS (scrollable horizontal per category) ── */
.section-label { font-size: 1rem; font-weight: 700; margin-bottom: 12px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.section-label span { font-size: 1.2rem; }
.products-row {
  display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; margin-bottom: 24px;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
  margin-left: -20px; margin-right: -20px; padding-left: 20px; padding-right: 20px;
}
.products-row::-webkit-scrollbar { height: 4px; }
.products-row::-webkit-scrollbar-track { background: rgba(230,81,0,0.05); border-radius: 4px; }
.products-row::-webkit-scrollbar-thumb { background: var(--primary-dark); border-radius: 4px; }

/* ── PRODUCT CARD ── */
.product-card {
  background: var(--card); border-radius: var(--radius); border: 1px solid var(--border);
  min-width: 160px; max-width: 160px; overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s; cursor: pointer; flex-shrink: 0;
}
.product-card:hover { transform: translateY(-4px); box-shadow: 0 8px 30px rgba(0,0,0,0.7), 0 0 20px rgba(230,81,0,0.2); border-color: var(--primary-dark); }
.product-card img { width: 100%; height: 120px; object-fit: cover; }
.product-card .card-body { padding: 10px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-card .card-name { font-size: 0.85rem; font-weight: 700; color: var(--text); line-height: 1.2; }
.product-card .card-desc { font-size: 0.72rem; color: var(--text-muted); line-height: 1.3; }
.product-card .card-price { font-size: 1rem; font-weight: 800; color: var(--accent); }
.add-btn {
  background: var(--primary); color: #fff; border: none; border-radius: 8px;
  padding: 7px; font-size: 0.8rem; font-weight: 700; cursor: pointer;
  width: 100%; transition: background 0.2s; margin-top: auto;
}
.add-btn:hover { background: var(--primary-dark); }
.add-btn.added { background: var(--success); }

/* ── FLOATING CART ── */
.floating-cart {
  z-index: 1000;
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: #fff; border-radius: 50px;
  padding: 14px 28px; display: flex; align-items: center; gap: 12px;
  box-shadow: 0 8px 32px rgba(230,81,0,0.55), 0 2px 8px rgba(0,0,0,0.6); cursor: pointer;
  text-decoration: none; font-weight: 700; font-size: 0.95rem;
  transition: background 0.2s, transform 0.2s; white-space: nowrap;
  min-width: 240px; justify-content: space-between;
}
.floating-cart:hover { background: var(--primary-dark); transform: translateX(-50%) translateY(-2px); }
.floating-cart .fc-info { display: flex; flex-direction: column; line-height: 1.1; }
.floating-cart .fc-count { font-size: 0.75rem; opacity: 0.85; }
.floating-cart .fc-label { font-size: 0.95rem; font-weight: 800; }
.floating-cart .fc-price { font-size: 1rem; font-weight: 800; color: var(--accent); }

/* ── CART ITEMS (seleccionarProductos) ── */
.cart-item {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  display: flex; align-items: center; gap: 12px; padding: 12px; margin-bottom: 12px;
}
.cart-item img { width: 70px; height: 70px; object-fit: cover; border-radius: var(--radius-sm); flex-shrink: 0; }
.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 700; font-size: 0.9rem; }
.cart-item-price { color: var(--accent); font-weight: 800; font-size: 0.95rem; }
.qty-control { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.qty-btn {
  background: var(--card2); border: 1px solid var(--border); color: var(--text);
  width: 28px; height: 28px; border-radius: 6px; font-size: 1rem; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.2s;
}
.qty-btn:hover { background: var(--primary); border-color: var(--primary); }
.qty-num { font-weight: 700; font-size: 0.95rem; min-width: 20px; text-align: center; }
.remove-btn { background: none; border: none; color: var(--text-muted); font-size: 1.2rem; cursor: pointer; padding: 4px; transition: color 0.2s; }
.remove-btn:hover { color: var(--primary); }

/* ── ORDER TOTAL ── */
.order-total {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin: 16px 0;
}
.total-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 0.85rem; color: var(--text-muted); }
.total-row.big { font-size: 1.1rem; font-weight: 800; color: var(--text); border-top: 1px solid var(--border); padding-top: 10px; margin-top: 4px; }
.total-row .val { color: var(--accent); }

/* ── FORMS ── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 0.8rem; font-weight: 700; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.form-input {
  width: 100%; background: var(--card); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: 0.95rem;
  padding: 12px 14px; font-family: inherit; transition: border-color 0.2s, box-shadow 0.2s; outline: none;
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(217,79,43,0.18); }
.form-input::placeholder { color: var(--text-muted); }
textarea.form-input { resize: vertical; min-height: 80px; }

/* ── DELIVERY OPTIONS ── */
.delivery-options { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }
.delivery-card {
  background: var(--card); border: 2px solid var(--border); border-radius: var(--radius);
  padding: 20px; cursor: pointer; transition: all 0.25s; display: flex; align-items: center; gap: 16px;
}
.delivery-card:hover { border-color: var(--primary); background: rgba(217,79,43,0.08); }
.delivery-card.selected { border-color: var(--primary); background: rgba(217,79,43,0.1); box-shadow: 0 0 0 3px rgba(217,79,43,0.18); }
.delivery-icon { font-size: 2.5rem; width: 60px; text-align: center; flex-shrink: 0; }
.delivery-info .d-title { font-weight: 800; font-size: 1rem; margin-bottom: 4px; }
.delivery-info .d-desc { font-size: 0.8rem; color: var(--text-muted); }
.delivery-check { margin-left: auto; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.delivery-card.selected .delivery-check { background: var(--primary); border-color: var(--primary); color: #fff; font-size: 0.75rem; }

/* ── SUMMARY CARD ── */
.summary-section { margin-bottom: 20px; }
.summary-section-title { font-size: 0.75rem; font-weight: 700; color: var(--primary-light); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; }
.summary-box { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.summary-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
.summary-row:last-child { border-bottom: none; }
.summary-row .sr-label { color: var(--text-muted); }
.summary-row .sr-val { font-weight: 600; text-align: right; max-width: 55%; }
.summary-item-row { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.summary-item-row:last-child { border-bottom: none; }
.summary-item-row img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; }
.summary-item-info { flex: 1; font-size: 0.85rem; }
.summary-item-info .si-name { font-weight: 700; }
.summary-item-info .si-qty { color: var(--text-muted); font-size: 0.78rem; }
.summary-item-price { font-weight: 800; color: var(--accent); font-size: 0.9rem; }

/* ── WHATSAPP PREVIEW ── */
.wa-preview-wrap { background: #0B141A; border-radius: var(--radius); padding: 20px; margin-bottom: 20px; min-height: 260px; }
.wa-chat-header { display: flex; align-items: center; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid #1F2C34; margin-bottom: 16px; }
.wa-avatar { width: 40px; height: 40px; background: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.wa-name { font-weight: 700; font-size: 0.95rem; color: #E9EDF0; }
.wa-status { font-size: 0.72rem; color: #8696A0; }
.wa-bubble {
  background: #202C33; border-radius: 8px 18px 18px 18px;
  padding: 12px 14px; max-width: 85%; position: relative;
  font-size: 0.82rem; line-height: 1.6; color: #E9EDF0; white-space: pre-line;
}
.wa-bubble::before { content: ''; position: absolute; left: -8px; top: 0; border: 8px solid transparent; border-right-color: #202C33; border-top: 0; }
.wa-time { font-size: 0.65rem; color: #8696A0; text-align: right; margin-top: 6px; }
.wa-sent-label { text-align: center; font-size: 0.75rem; color: #8696A0; background: #0B141A; padding: 4px 14px; border-radius: 8px; margin-bottom: 10px; }

/* ── BUTTONS ── */
.btn {
  display: block; width: 100%; padding: 15px; border: none; border-radius: var(--radius);
  font-family: inherit; font-size: 1rem; font-weight: 800; cursor: pointer;
  transition: all 0.2s; text-align: center; text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(217,79,43,0.4); }
.btn-secondary { background: var(--card2); color: var(--text); border: 1.5px solid var(--border); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary-light); }
.btn-success { background: #25D366; color: #fff; }
.btn-success:hover { background: #1DA851; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(37,211,102,0.35); }
.btn-back { background: none; border: none; color: var(--text-muted); font-size: 0.9rem; cursor: pointer; display: flex; align-items: center; gap: 6px; margin-bottom: 16px; transition: color 0.2s; font-family: inherit; padding: 0; }
.btn-back:hover { color: var(--text); }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 50px 20px; }
.empty-state .empty-icon { font-size: 4rem; margin-bottom: 16px; }
.empty-state h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.empty-state p { font-size: 0.85rem; color: var(--text-muted); }

/* ── SUCCESS PAGE ── */
.success-wrap { text-align: center; padding: 40px 20px; }
.success-icon { width: 80px; height: 80px; background: rgba(37,211,102,0.15); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; margin: 0 auto 20px; border: 2px solid #25D366; }
.success-title { font-size: 1.5rem; font-weight: 900; margin-bottom: 8px; }
.success-sub { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 30px; }
.order-num { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 24px; }
.order-num span { font-size: 0.75rem; color: var(--text-muted); display: block; }
.order-num strong { font-size: 1.4rem; color: var(--accent); font-weight: 900; }

/* ── MISC ── */
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 50px; font-size: 0.7rem; font-weight: 700; }
.badge-delivery { background: rgba(245,166,35,0.15); color: var(--accent); }
.badge-pickup { background: rgba(46,204,113,0.15); color: var(--success); }
.pb-120 { padding-bottom: 120px; }
.gap-12 { display: flex; flex-direction: column; gap: 12px; }
.mt-12 { margin-top: 12px; }
.text-center { text-align: center; }

/* ── SPLASH / LOADING SCREEN ── */
#splash-screen {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  overflow: hidden;
}
.splash-bg-mosaic {
  position: absolute; inset: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr);
  opacity: 0.12; filter: blur(2px) brightness(0.4);
  pointer-events: none;
}
.splash-bg-mosaic img { width: 100%; height: 100%; object-fit: cover; }
.splash-content {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  animation: splashFadeIn 0.6s ease both;
}
.splash-logo-wrap {
  width: 130px; height: 130px; border-radius: 50%;
  border: 4px solid var(--primary);
  box-shadow: 0 0 40px rgba(230, 81, 0, 0.6), 0 0 80px rgba(230, 81, 0, 0.2);
  overflow: hidden; background: var(--card);
  animation: splashPulse 2s ease-in-out infinite;
}
.splash-logo-wrap img { width: 100%; height: 100%; object-fit: cover; }
.splash-name {
  font-size: 2.2rem; font-weight: 900; color: var(--text);
  text-align: center; letter-spacing: -1px;
  text-shadow: 0 2px 20px rgba(230, 81, 0, 0.4);
}
.splash-name span { color: var(--primary-light); }
.splash-tagline {
  font-size: 0.9rem; color: var(--text-muted); letter-spacing: 2px;
  text-transform: uppercase; text-align: center;
}
.splash-bar-wrap { width: 200px; height: 4px; background: var(--border); border-radius: 10px; overflow: hidden; margin-top: 10px; }
.splash-bar {
  height: 100%; width: 0%; background: linear-gradient(90deg, var(--primary-dark), var(--primary), var(--accent));
  border-radius: 10px; animation: splashLoad 2.4s ease forwards;
}
.splash-food-row {
  display: flex; gap: 12px; margin-top: 8px;
}
.splash-food-img {
  width: 64px; height: 64px; border-radius: 10px; object-fit: cover;
  border: 2px solid var(--border);
  animation: splashFoodIn 0.5s ease both;
  box-shadow: 0 4px 14px rgba(0,0,0,0.5);
}
.splash-food-img:nth-child(1) { animation-delay: 0.2s; }
.splash-food-img:nth-child(2) { animation-delay: 0.35s; }
.splash-food-img:nth-child(3) { animation-delay: 0.5s; }
.splash-food-img:nth-child(4) { animation-delay: 0.65s; }

@keyframes splashFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes splashPulse {
  0%, 100% { box-shadow: 0 0 40px rgba(230, 81, 0, 0.6), 0 0 80px rgba(230, 81, 0, 0.2); }
  50%       { box-shadow: 0 0 60px rgba(255, 179, 0, 0.7), 0 0 100px rgba(230, 81, 0, 0.3); }
}
@keyframes splashLoad {
  0%   { width: 0%; }
  100% { width: 100%; }
}
@keyframes splashFoodIn {
  from { opacity: 0; transform: scale(0.6) rotate(-10deg); }
  to   { opacity: 1; transform: scale(1) rotate(0deg); }
}
#splash-screen.hidden {
  animation: splashExit 0.5s ease forwards;
}
@keyframes splashExit {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(1.04); pointer-events: none; }
}
