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

:root {
  --bg: #f7f5f0;
  --bg-2: #fcfbfa;
  --bg-card: #ffffff;
  --bg-card-solid: #ffffff;
  --bg-card-2: #f2eee8;
  --accent: #ff9f1c;
  --accent-strong: #e76f51;
  --success: #2ec4b6;
  --error: #e63946;
  --info: #0077b6;
  --text: #2f2a25;
  --text-dim: #5c554e;
  --text-faint: #9c938a;
  --radius: 12px;
  --shadow: 0 4px 16px rgba(160, 150, 140, 0.12);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  max-width: 560px;
  margin: 0 auto;
  padding-bottom: 96px;
  min-height: 100%;
}

header.app {
  padding: 24px 16px 14px;
  text-align: center;
  position: sticky;
  top: 0;
  background: var(--bg);
  backdrop-filter: blur(8px);
  z-index: 20;
}
header.app h1 {
  font-size: 26px;
  letter-spacing: 2px;
  font-weight: 900;
  color: var(--text);
}
header.app h1 span { color: var(--accent); }
header.app p { color: var(--text-dim); font-size: 14.5px; margin-top: 4px; font-weight: 500; }

.card {
  background: var(--bg-card);
  border: 1px solid #eae6df;
  border-radius: var(--radius);
  padding: 16px;
  margin: 12px 16px;
  box-shadow: var(--shadow);
}
a .card { transition: transform 0.15s ease, border-color 0.15s ease; }
a:active .card { transform: scale(0.985); border-color: var(--accent); }

.btn {
  display: block;
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 15px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  color: #ffffff;
  background: var(--accent);
  transition: transform 0.1s ease, filter 0.1s ease;
}
.btn:active { transform: scale(0.98); filter: brightness(0.92); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.secondary {
  background: var(--bg-card-2);
  color: var(--text);
  border: 1px solid #e0d9cf;
}
.btn.success {
  background: #25d366;
  color: #ffffff;
}
.btn.whatsapp {
  background: #128c7e;
  color: #ffffff;
}
.btn.small { padding: 8px 14px; font-size: 13px; width: auto; display: inline-block; }

.muted { color: var(--text-dim); font-size: 13.5px; line-height: 1.45; }
.faint { color: var(--text-faint); font-size: 11.5px; }
.row { display: flex; align-items: center; gap: 12px; }
.grow { flex: 1; min-width: 0; }

input, textarea {
  width: 100%;
  background: #ffffff;
  border: 1.5px solid #eae6df;
  border-radius: 10px;
  color: var(--text);
  padding: 12px;
  font-size: 15px;
  margin-top: 6px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 159, 28, 0.15); }
input::placeholder, textarea::placeholder { color: var(--text-faint); }
label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  display: block;
  margin-top: 14px;
  text-transform: uppercase;
}

.store-thumb {
  width: 60px; height: 60px; border-radius: 12px; object-fit: cover;
  background: var(--bg-card-2); flex-shrink: 0;
  border: 1px solid #eae6df;
}
.product-img {
  width: 100%; height: 165px; object-fit: cover; border-radius: 10px;
  background: var(--bg-card-2);
}
.price { color: var(--accent-strong); font-weight: 700; font-size: 16px; }
.price .faint { font-weight: 500; color: var(--text-faint); }

.qty-controls { display: flex; align-items: center; gap: 10px; }
.qty-controls button {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid #e0d9cf;
  background: var(--bg-card-2); color: var(--text);
  font-size: 18px; font-weight: 700; cursor: pointer;
  transition: transform 0.1s ease, background 0.1s;
}
.qty-controls button:active { transform: scale(0.9); }
.qty-controls button.add {
  background: var(--accent);
  color: #ffffff; border: none;
}
.qty-controls span { min-width: 24px; text-align: center; font-weight: 700; font-size: 15px; }

.cart-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  max-width: 560px; margin: 0 auto;
  background: rgba(253, 251, 247, 0.95);
  backdrop-filter: blur(8px);
  border-top: 1px solid #eae6df;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  z-index: 30;
}

.badge {
  display: inline-block; padding: 4px 10px; border-radius: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
  white-space: nowrap;
}
.badge.open    { background: rgba(37, 211, 102, 0.12); color: #0e8f3f; border: 1px solid rgba(37, 211, 102, 0.3); }
.badge.closed  { background: rgba(230, 57, 70, 0.12);  color: #e63946; border: 1px solid rgba(230, 57, 70, 0.3); }
.badge.waiting { background: rgba(255, 159, 28, 0.12);  color: #d87d00; border: 1px solid rgba(255, 159, 28, 0.3); }
.badge.going   { background: rgba(0, 119, 182, 0.12); color: #0077b6; border: 1px solid rgba(0, 119, 182, 0.3); }
.badge.done    { background: rgba(92, 85, 78, 0.12);   color: var(--text-dim); border: 1px solid rgba(92, 85, 78, 0.2); }

.folio-box { text-align: center; padding: 24px 16px; }
.folio-box .folio {
  font-size: 34px; font-weight: 900; letter-spacing: 3px;
  color: var(--accent-strong);
  margin-top: 6px;
}

#map {
  height: 50vh;
  border-radius: var(--radius);
  margin: 12px 16px;
  z-index: 1;
  border: 1px solid #eae6df;
  box-shadow: var(--shadow);
}
.driver-arrow {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  transition: transform 0.4s linear;
}
.driver-arrow svg { width: 100%; height: 100%; }

.mini-map-wrap {
  position: relative;
  margin-top: 12px;
}
#mini-map {
  height: 220px;
  border-radius: 10px;
  border: 1px solid #eae6df;
  z-index: 1;
}
.center-pin {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -95%);
  font-size: 34px;
  z-index: 5;
  pointer-events: none;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.6));
}
.suggestions {
  position: absolute;
  left: 0; right: 0; top: 100%;
  background: var(--bg-card-solid);
  border: 1px solid rgba(244, 248, 251, 0.14);
  border-radius: 13px;
  margin-top: 4px;
  z-index: 40;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.suggestion-item {
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(244, 248, 251, 0.06);
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:active { background: var(--bg-card-2); }
.suggestion-item strong { display: block; font-size: 14px; }
.suggestion-item .faint { display: block; margin-top: 2px; }

.code-box {
  margin-top: 16px;
  padding: 16px;
  text-align: center;
  background: rgba(255, 183, 3, 0.10);
  border: 1.5px dashed rgba(255, 183, 3, 0.55);
  border-radius: 14px;
}
.code-box .code {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 8px;
  color: var(--accent);
  margin-top: 6px;
  text-shadow: 0 0 24px rgba(255, 183, 3, 0.35);
}

.spinner {
  border: 3px solid rgba(244,248,251,0.15); border-top-color: var(--accent);
  border-radius: 50%; width: 32px; height: 32px;
  animation: spin 0.8s linear infinite; margin: 28px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed; bottom: 104px; left: 16px; right: 16px;
  max-width: 528px; margin: 0 auto;
  background: var(--error); color: white; padding: 14px; border-radius: 14px;
  font-size: 13.5px; font-weight: 700; text-align: center; z-index: 99; display: none;
  box-shadow: var(--shadow);
}
.toast.ok { background: var(--success); color: #04302b; }

.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.modal-content.bottom-sheet {
  width: 100%;
  max-width: 560px;
  background: var(--bg-card-solid);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  padding: 20px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.5);
  animation: slideUp 0.3s ease-out;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.modal-header {
  position: relative;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(244, 248, 251, 0.1);
  margin-bottom: 15px;
}
.modal-close {
  position: absolute;
  right: 0; top: 0;
  font-size: 28px;
  cursor: pointer;
  color: var(--text-dim);
}
.modal-body {
  overflow-y: auto;
  flex: 1;
  padding-bottom: 20px;
}
.modal-section {
  margin-bottom: 20px;
}
.modal-section h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}
.modal-section h3 span.required {
  color: var(--error);
  margin-left: 4px;
}
.option-row {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(244, 248, 251, 0.04);
  cursor: pointer;
}
.option-row input {
  width: auto;
  margin: 0 12px 0 0;
  cursor: pointer;
}
.option-row label {
  flex: 1;
  margin: 0;
  text-transform: none;
  font-size: 14px;
  font-weight: normal;
  color: var(--text);
  cursor: pointer;
}
.option-row .price-mod {
  font-size: 13.5px;
  color: var(--success);
  font-weight: 700;
}
.modal-footer {
  border-top: 1px solid rgba(244, 248, 251, 0.1);
  padding-top: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.qty-selector-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.qty-selector-wrap label {
  margin: 0;
  font-size: 10px;
  text-transform: uppercase;
}
