﻿:root {
  --orange: #ff480a;
  --gold: #e6a024;
  --cream: #fff8ee;
  --paper: #ffffff;
  --ink: #281c16;
  --muted: #79685d;
  --line: #ead8c3;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
  background: linear-gradient(90deg, rgba(255,248,238,.94), rgba(255,248,238,.68)), url("../images/chilaquiles-hero.png") center / cover fixed;
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.mobile-stage { min-height: 100vh; display: grid; place-items: center; padding: 28px; }
.phone-frame { width: min(430px, 100%); min-height: 860px; overflow: hidden; border: 12px solid #181513; border-radius: 34px; background: var(--cream); box-shadow: 0 28px 70px rgba(0,0,0,.34); position: relative; }

.splash-screen { min-height: 860px; display: grid; place-items: center; align-content: center; gap: 18px; padding: 30px; color: #fff; background: radial-gradient(circle at 50% 35%, #ff7b38, var(--orange) 52%, #d43a05); }
.splash-screen img { width: 280px; max-width: 88%; filter: drop-shadow(0 18px 26px rgba(0,0,0,.22)); animation: logo-pop .7s ease both; }
.splash-screen p { margin: 0; font-size: 18px; font-weight: 900; letter-spacing: 0; }
@keyframes logo-pop { from { transform: scale(.84); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.auth-screen { min-height: 860px; padding: 30px 22px; display: flex; flex-direction: column; justify-content: center; background: linear-gradient(180deg, #fff8ee, #fff1dd); }
.auth-logo { display: block; width: 230px; max-width: 82%; margin: 0 auto 22px; }
.auth-screen h1 { margin: 0; text-align: center; font-size: 34px; line-height: 1; }
.auth-screen p { max-width: 310px; margin: 10px auto 22px; color: var(--muted); text-align: center; line-height: 1.45; }
.auth-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.auth-actions button, .primary-action, .app-header button { min-height: 44px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font-weight: 900; }
.auth-actions button.active, .primary-action { border-color: var(--orange); background: var(--orange); color: #fff; }
.customer-form, .checkout-panel { display: grid; gap: 12px; }
.customer-form label, .checkout-panel label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 800; }
.customer-form input, .checkout-panel input, .checkout-panel textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; color: var(--ink); background: #fff; }

.app-shell { min-height: 860px; background: var(--cream); }
.app-header { min-height: 118px; padding: 16px 18px; color: #fff; background: linear-gradient(135deg, var(--orange), #d93a05); display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; }
.app-header div { min-width: 0; }
.brand-logo { width: 132px; max-height: 64px; object-fit: contain; filter: drop-shadow(0 8px 18px rgba(0,0,0,.22)); }
.app-header span { display: block; max-width: 270px; margin-top: 6px; font-size: 12px; font-weight: 800; line-height: 1.3; }
.app-header button { min-height: 34px; padding: 0 10px; color: var(--orange); }
.mini-cart { position: relative; }
.mini-cart strong { display: inline-grid; place-items: center; min-width: 22px; height: 22px; margin-left: 5px; border-radius: 999px; background: var(--orange); color: #fff; font-size: 12px; }
.saved-order { margin: 12px 18px 0; padding: 12px 14px; border-radius: 8px; background: #e8f6ed; color: #20683b; font-weight: 800; }
.saved-order.error { background: #fde7e0; color: #a13222; }
.store-status { display: grid; gap: 4px; margin: 12px 18px 0; padding: 12px 14px; border: 1px solid #f0c5b9; border-radius: 8px; background: #fff0e8; color: #a13222; font-weight: 900; line-height: 1.35; }
.store-status strong { font-size: 16px; }
.store-status span { color: inherit; font-size: 12px; }
.store-status em { font-style: normal; color: #8b3f24; font-size: 12px; }
.store-status.is-open { border-color: #cdebc7; background: #eaf8e9; color: #196d2c; }
.store-status.is-closed { border-color: #f0c5b9; background: #fff0e8; color: #a13222; }

.app-tabs { position: sticky; top: 0; z-index: 3; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 12px 10px; background: rgba(255,248,238,.96); border-bottom: 1px solid var(--line); }
.app-tabs button { min-height: 38px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--muted); font-size: 12px; font-weight: 900; }
.app-tabs button.active { background: var(--orange); color: #fff; border-color: var(--orange); }
.app-tabs button:disabled { opacity: .45; cursor: not-allowed; }

.view { display: none; padding: 18px; padding-bottom: 112px; }
.view.active { display: block; }
.view-title { margin-bottom: 14px; }
.view-title p { margin: 0 0 4px; color: var(--orange); font-weight: 900; }
.view-title h1 { margin: 0; font-size: 30px; line-height: 1; }
.whatsapp-action { display: grid; place-items: center; min-height: 42px; margin: 0 0 14px; border: 1px solid #d6ecd4; border-radius: 8px; background: #eaf8e9; color: #196d2c; text-decoration: none; font-weight: 900; }

.menu-section, .flavor-card, .checkout-panel, .dish-builder-card { margin-bottom: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.menu-section h2, .checkout-panel h2 { margin: 0 0 12px; font-size: 20px; }
.menu-section p { margin: 10px 0 0; color: var(--orange); font-weight: 800; line-height: 1.35; }
.price-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dotted #d7bfa5; }
.price-row:last-of-type { border-bottom: 0; }
.price-row span { font-weight: 800; }
.price-row strong { color: #8b3f24; font-size: 18px; }
.pill-list, .choice-list { display: flex; flex-wrap: wrap; gap: 8px; }
.pill-list span, .choice-list button { min-height: 36px; display: inline-flex; align-items: center; padding: 0 10px; border: 1px solid #efd1ad; border-radius: 8px; background: #fff0d4; color: var(--ink); font-weight: 800; }
.compact-section { margin-top: 14px; }

.flavor-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.flavor-card span { font-weight: 900; }
.flavor-toggle { display: flex; gap: 8px; }
.flavor-toggle button { min-height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--muted); font-weight: 900; }
.flavor-toggle button.active { background: var(--orange); color: #fff; border-color: var(--orange); }
.menu-list { display: grid; gap: 12px; }
.menu-card { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; }
.menu-card h3 { margin: 0 0 5px; font-size: 18px; }
.menu-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.34; }
.menu-card strong { font-size: 18px; }
.dish-card { grid-template-columns: 1fr auto; }
.dish-card > strong { align-self: start; color: #8b3f24; }
.dish-card .customize-dish { grid-column: 1 / -1; min-height: 40px; border: 0; border-radius: 8px; background: var(--orange); color: #fff; font-weight: 900; }
.dish-count { display: inline-flex; margin-top: 8px; padding: 5px 8px; border-radius: 999px; background: #fff0d4; color: var(--muted); font-size: 12px; font-weight: 900; }
.dish-count.has-count { background: var(--orange); color: #fff; }
.qty-picker { display: grid; grid-template-columns: 34px 34px 34px; align-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff8ee; }
.qty-picker button { min-height: 36px; border: 0; background: transparent; color: var(--ink); font-size: 20px; font-weight: 900; }
.qty-picker .qty-plus { background: var(--orange); color: #fff; }
.qty-picker span { display: grid; place-items: center; min-height: 36px; color: var(--ink); font-weight: 900; }
.qty-picker.has-count { border-color: var(--orange); box-shadow: 0 8px 18px rgba(255,72,10,.12); }
.add-button { width: auto; min-height: 36px; border: 0; border-radius: 0; background: var(--orange); color: #fff; font-size: 20px; font-weight: 900; }
.add-chip.has-count { border-color: var(--orange); background: var(--orange); color: #fff; }
.drink-list { display: grid; gap: 10px; }
.drink-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fffaf1; }
.drink-row strong { display: block; font-size: 14px; }
.drink-row span { color: var(--muted); font-size: 13px; font-weight: 900; }
.drink-controls { display: grid; grid-template-columns: 34px 34px 34px; gap: 5px; align-items: center; }
.drink-controls button { min-height: 34px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font-weight: 900; }
.drink-controls button[data-drink-action="add"] { background: var(--orange); border-color: var(--orange); color: #fff; }
.drink-controls span { display: grid; place-items: center; min-height: 34px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
.dish-builder-card { margin-top: 14px; background: #fffaf1; box-shadow: 0 14px 30px rgba(62,41,22,.08); }
.builder-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.builder-head p { margin: 0 0 3px; color: var(--orange); font-size: 13px; font-weight: 900; }
.builder-head h2 { margin: 0; font-size: 22px; line-height: 1.1; }
.builder-head button { min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--muted); font-weight: 900; }
.builder-group { display: grid; gap: 10px; padding: 13px 0; border-top: 1px solid #f0dac0; }
.builder-group h3 { margin: 0; font-size: 16px; }
.builder-flavors, .option-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.builder-flavors button, .option-grid label { min-height: 42px; display: flex; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font-size: 13px; font-weight: 900; }
.builder-flavors button.active { border-color: var(--orange); background: var(--orange); color: #fff; }
.option-grid input { width: auto; accent-color: var(--orange); }
.builder-footer { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; padding-top: 14px; border-top: 1px solid #f0dac0; }
.builder-footer strong { justify-self: end; color: #8b3f24; font-size: 17px; text-align: right; }
.builder-footer .primary-action { grid-column: 1 / -1; }
.builder-qty button:last-child { background: var(--orange); color: #fff; }

.cart-items { display: grid; gap: 12px; }
.cart-item { padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; display: grid; gap: 12px; }
.cart-item h3 { margin: 0 0 4px; font-size: 17px; }
.cart-item span { color: var(--muted); font-size: 13px; font-weight: 800; }
.cart-controls { display: grid; grid-template-columns: 38px 1fr 38px auto; gap: 8px; align-items: center; }
.cart-controls button { min-height: 36px; border: 1px solid var(--line); border-radius: 8px; background: #fff8ee; color: var(--ink); font-weight: 900; }
.cart-controls strong { text-align: center; }
.cart-controls .remove { padding: 0 10px; color: #b63c22; }
.empty-cart { padding: 20px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); text-align: center; font-weight: 800; }
.primary-action.wide { width: 100%; margin-top: 14px; }

.tracker-screen { margin: -18px; margin-bottom: -112px; min-height: 760px; background: #fff; color: #b93a0c; }
.history-only .live-tracker { display: none; }
.history-tracker { display: none; }
.history-only .history-tracker { display: block; }
.tracker-header { min-height: 66px; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 0 18px; background: var(--orange); color: #fff; }
.tracker-header strong { font-size: 24px; letter-spacing: 0; }
.tracker-back { width: calc(100% - 32px); min-height: 42px; margin: 14px 16px 0; border: 1px solid #f0d2bf; border-radius: 8px; background: #fff8ee; color: #b93a0c; font-weight: 900; }
.tracker-cancel { width: calc(100% - 32px); min-height: 40px; margin: 8px 16px 0; border: 1px solid #f0c5b9; border-radius: 8px; background: #fff; color: #b63c22; font-weight: 900; }
.tracker-cancel[disabled] { opacity: .55; cursor: not-allowed; }
.tracker-progress-card { padding: 22px 16px 20px; background: #efefef; text-align: center; }
.tracker-progress-card h1 { margin: 0 0 14px; color: var(--orange); font-size: 25px; letter-spacing: 0; }
.tracker-labels { display: grid; grid-template-columns: repeat(6, 1fr); align-items: end; gap: 2px; margin-bottom: 5px; color: #b93a0c; font-size: 9px; font-weight: 900; line-height: 1.05; }
.status-steps { display: grid; grid-template-columns: repeat(6, 1fr); height: 58px; overflow: hidden; border: 3px solid #5c210d; border-radius: 34px; background: #fff1df; }
.status-step { position: relative; border-right: 3px solid #5c210d; background: #fff1df; transform: skewX(-28deg); transform-origin: center; }
.status-step:first-child { border-top-left-radius: 30px; border-bottom-left-radius: 30px; }
.status-step:last-child { border-right: 0; border-top-right-radius: 30px; border-bottom-right-radius: 30px; }
.status-step.active { background: var(--orange); box-shadow: inset 0 -9px 0 #e6a024; }
.tracker-clock { margin-top: 18px; color: #333; font-size: 20px; }
.tracker-order-card { padding: 18px 16px 16px; background: #fff; }
.tracker-order-card h2 { margin: 0 0 16px; color: #b93a0c; font-size: 25px; text-align: center; }
.tracker-order-card dl { display: grid; gap: 12px; margin: 0; }
.tracker-order-card div { display: flex; justify-content: space-between; gap: 18px; }
.tracker-order-card dt { color: #9a9a9a; }
.tracker-order-card dd { margin: 0; color: #b93a0c; text-align: right; }
.tracker-band { padding: 13px 16px; background: #f3f4fb; text-align: center; }
.tracker-band h2 { margin: 0; color: #8c8c8c; font-size: 25px; }
.tracker-status-text { padding: 20px 16px; text-align: center; }
.tracker-status-text h3 { margin: 0 0 14px; color: #b93a0c; font-size: 25px; font-weight: 500; }
.tracker-status-text p { margin: 0; color: #777; line-height: 1.4; }
.business-card { display: grid; gap: 5px; padding: 22px 18px; background: #fff; color: #777; font-size: 14px; line-height: 1.35; }
.business-card strong { color: #b93a0c; text-transform: uppercase; }
.business-card a { color: var(--orange); text-decoration: none; font-size: 18px; font-weight: 800; }
.tracker-order-list { display: grid; gap: 8px; min-height: 70px; padding: 18px 16px; color: #555; }
.tracker-order-list div { display: flex; justify-content: space-between; gap: 12px; }
.tracker-order-list p { margin: 6px 0 0; color: #777; line-height: 1.35; }
.tracker-history-panel { padding: 18px; background: #fff; }
.tracker-history { display: grid; gap: 8px; padding: 16px; color: #777; }
.history-order { display: flex; justify-content: space-between; gap: 10px; padding: 12px; border: 1px solid #f0d2bf; border-radius: 8px; background: #fff8ee; color: #b93a0c; font-weight: 800; text-align: left; }
.history-order span { color: #777; font-size: 13px; }
.history-filters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0 0; }
.history-filters button { min-height: 34px; border: 1px solid #f0d2bf; border-radius: 8px; background: #fff8ee; color: #b93a0c; font-size: 11px; font-weight: 900; }
.history-filters button.active { border-color: var(--orange); background: var(--orange); color: #fff; }
.history-order-card { display: grid; gap: 8px; padding: 12px; border: 1px solid #f0d2bf; border-radius: 8px; background: #fff8ee; color: #b93a0c; }
.history-order-main { display: flex; justify-content: space-between; gap: 10px; font-weight: 900; }
.history-order-main span { color: #777; font-size: 13px; text-align: right; }
.history-order-card small { color: var(--muted); font-weight: 800; }
.history-order-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.history-order-actions button { min-height: 34px; border: 1px solid #f0d2bf; border-radius: 8px; background: #fff; color: #b93a0c; font-weight: 900; }
.history-order-actions [data-history-repeat] { border-color: var(--orange); background: var(--orange); color: #fff; }
.tracker-total { display: flex; justify-content: space-between; gap: 12px; padding: 20px 8px; border-top: 1px solid #ececec; background: #fff; color: #b93a0c; font-size: 24px; font-weight: 900; }

.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gender-row { display: grid; grid-template-columns: auto 1fr 1fr; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.gender-row span { color: var(--muted); font-weight: 900; }
.gender-row label, .radio-grid label { display: flex; align-items: center; gap: 7px; color: var(--ink); font-size: 14px; }
.radio-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.radio-grid label { min-height: 42px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff8ee; font-weight: 800; }
.delivery-zone, .transfer-panel { display: grid; gap: 10px; margin-top: 12px; padding: 12px; border: 1px dashed #e5bc86; border-radius: 8px; background: #fff8ee; }
.delivery-zone p, .transfer-panel p { margin: 0; color: var(--muted); font-size: 13px; font-weight: 800; line-height: 1.35; }
.transfer-panel label { color: var(--ink); }
.transfer-panel input[type="file"] { padding: 9px; background: #fff; }

.cart-bar { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-top: 1px solid var(--line); background: #fff; box-shadow: 0 -12px 28px rgba(62,41,22,.12); }
.cart-bar span { display: block; max-width: 220px; margin-top: 3px; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-total { display: flex; align-items: flex-end; flex-direction: column; gap: 6px; }
.cart-total button { min-height: 42px; padding: 0 14px; border: 0; border-radius: 8px; background: var(--orange); color: #fff; font-weight: 900; }
.order-submit-overlay { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; align-content: center; gap: 8px; padding: 28px; background: rgba(40, 28, 22, .62); color: #fff; text-align: center; }
.order-submit-overlay strong { font-size: 23px; }
.order-submit-overlay span { max-width: 290px; line-height: 1.4; font-weight: 800; }

@media (max-width: 560px) {
  .mobile-stage { padding: 0; }
  .phone-frame { min-height: 100vh; border: 0; border-radius: 0; }
  .splash-screen, .auth-screen, .app-shell { min-height: 100vh; }
}
