@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 {
  --primary: #D94F2B;
  --primary-dark: #B03A1C;
  --primary-light: #F26744;
  --accent: #F5A623;
  --accent-dark: #D4891A;
  --bg: #121212;
  --bg2: #1E1E1E;
  --card: #252525;
  --card2: #2E2E2E;
  --border: #3A3A3A;
  --text: #F5F5F5;
  --text-muted: #9E9E9E;
  --success: #2ECC71;
  --white: #FFFFFF;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
}

html { font-size: 16px; }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }

/* ── HEADER ── */
.header {
  background: var(--bg2);
  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;
}
.header-logo { display: flex; align-items: center; gap: 10px; }
.header-logo img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.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: var(--bg2); 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(217,79,43,0.25); }
.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); }

/* ── 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: transparent; }
.products-row::-webkit-scrollbar-thumb { background: var(--border); 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(-3px); box-shadow: var(--shadow); }
.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(217,79,43,0.5); 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; }
