@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: light;
  font-family: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --gold: #e3a81f;
  --gold-deep: #a8740a;
  --gold-soft: #fff3d1;
  --ink: #1b1a17;
  --muted: #8a857a;
  --line: #ece8de;
  --bg: #f6f5f1;
  --card: #fff;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --shadow: 0 6px 20px rgba(40, 32, 10, .07);
}

* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: #f3f2ee; color: var(--ink); }
button, input { color: inherit; font: inherit; }
button { appearance: none; -webkit-appearance: none; margin: 0; border: 0; background: none; -webkit-tap-highlight-color: transparent; cursor: pointer; }
button:focus { outline: none; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
.ui-icon { width: 1em; height: 1em; flex: none; vertical-align: -.15em; }

.app-frame { position: relative; display: flex; width: min(100%, 480px); min-height: 100dvh; flex-direction: column; margin: 0 auto; overflow: clip; background: var(--bg); box-shadow: 0 0 60px rgba(40, 32, 10, .12); }
.app-header { position: sticky; z-index: 5; top: calc(8px + env(safe-area-inset-top, 0px)); display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 8px; margin: 8px 10px 0; padding: 6px 8px 6px 6px; border-radius: 999px; background: #1a120c; color: #f4ead8; box-shadow: 0 10px 28px rgba(20, 14, 8, .38); }
.brand-mark { display: block; width: 44px; height: 44px; object-fit: contain; background: transparent; }
.header-copy { min-width: 0; }
.header-copy small { display: block; color: #cbb9a4; font-size: 10px; }
.header-copy strong { display: block; overflow: hidden; color: #fff; font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.icon-button { min-height: 36px; padding: 0 12px; border: 0; border-radius: 999px; background: #2b2118; color: #f4ead8; font-size: 12px; font-weight: 700; }

#app-main { flex: 1; padding: 12px 20px calc(118px + var(--safe-bottom)); }
.track-card { margin: 0 0 16px; padding: 14px 16px 16px; border-radius: 20px; background: #1a120c; color: #f4ead8; box-shadow: 0 10px 24px rgba(26, 18, 12, .28); }
.track-card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.track-card-top small { color: #cbb9a4; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.track-card-top strong { color: #fff; font-size: 13px; }
.track-status { margin: 8px 0 4px; color: var(--gold); font-size: 20px; font-weight: 800; letter-spacing: -.3px; }
.track-lede { margin: 0; color: #d8cbb8; font-size: 13px; line-height: 1.45; }
.track-times { display: grid; gap: 6px; margin-top: 12px; }
.track-times p { display: flex; align-items: center; gap: 8px; margin: 0; color: #cbb9a4; font-size: 12px; font-weight: 600; }
.track-times b { color: #fff; font-weight: 700; }
.track-times .ui-icon { color: var(--gold); }
.track-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 14px; }
.track-step { height: 5px; border-radius: 99px; background: #3a2e24; }
.track-step.on { background: var(--gold); }
.track-step.current { background: #f0d48a; }
.screen-title { margin: 14px 0 8px; font-size: 24px; font-weight: 800; letter-spacing: -.4px; }
.lede { margin-bottom: 16px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.eyebrow { color: var(--gold-deep); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }

.branch-list, .product-grid { display: grid; gap: 12px; }
.branch-list { margin-top: 8px; }
.branch-card, .product-card { overflow: hidden; border: 0; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); text-align: left; }
.branch-card { padding: 16px; }
.branch-card strong { display: block; font-size: 16px; }
.branch-card small { color: var(--muted); font-size: 12px; }

.table-pad { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 8px; }
.table-pad button { min-height: 56px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); font-size: 18px; font-weight: 800; box-shadow: var(--shadow); }
.table-pad button.active { border-color: var(--gold); background: var(--gold); color: #1b1405; }

.category-strip { display: flex; gap: 8px; overflow-x: auto; margin: 0 -20px 12px; padding: 2px 20px 6px; scrollbar-width: none; }
.category-strip::-webkit-scrollbar { display: none; }
.category-chip { display: inline-flex; flex: none; align-items: center; padding: 10px 15px; border: 1px solid var(--line); border-radius: 24px; background: var(--card); font-size: 12px; font-weight: 600; }
.category-chip.active { border-color: var(--gold); background: var(--gold); color: #1b1405; }

.product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
.product-media { position: relative; height: 148px; background: transparent; }
.product-image-button { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: transparent; }
.product-image { display: block; width: 100%; height: 100%; object-fit: cover; }
.product-image.cutout { object-fit: contain; padding: 6px; background: transparent; }
.product-media .placeholder { display: grid; width: 100%; height: 100%; place-items: center; color: var(--gold-deep); background: var(--gold-soft); }
.product-content { padding: 11px 12px 12px; }
.product-title { font-size: 13px; font-weight: 700; line-height: 1.3; }
.product-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.product-price { margin: 0; font-size: 14px; font-weight: 800; }
.add-product { display: grid; width: 30px; height: 30px; place-items: center; border: 0; border-radius: 50%; color: #1b1405; background: var(--gold); font-size: 17px; }
.product-card.off { opacity: .55; }

.gold-button, .outline-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 16px; border: 0; border-radius: 14px; font-size: 14px; font-weight: 800; }
.gold-button { appearance: none; -webkit-appearance: none; overflow: hidden; background: var(--gold); background-image: none; color: #1b1405; box-shadow: none; }
.outline-button { border: 1.5px solid var(--gold); background: #fff; color: var(--gold-deep); }
.gold-button:disabled, .outline-button:disabled { opacity: .55; cursor: default; }
.gold-button::-moz-focus-inner { border: 0; padding: 0; }

.action-dock { position: sticky; z-index: 6; bottom: 0; display: flex; gap: 8px; padding: 10px 16px calc(12px + var(--safe-bottom)); background: linear-gradient(180deg, transparent, var(--bg) 28%); }
.action-dock .gold-button, .action-dock .outline-button { flex: 1 1 0; min-width: 0; width: auto; }

.overlay { position: fixed; z-index: 10; inset: 0; display: flex; justify-content: center; background: rgba(27, 20, 5, .5); }
.sheet { position: relative; display: flex; width: min(100%, 480px); height: 100dvh; flex-direction: column; background: var(--card); }
.sheet-scroll { flex: 1; overflow-y: auto; }
.sheet-hero { position: relative; height: 240px; background: var(--bg); }
.sheet-hero img { display: block; width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.sheet-close { position: absolute; z-index: 3; top: max(14px, env(safe-area-inset-top)); right: 16px; display: grid; width: 44px; height: 44px; place-items: center; border: 0; border-radius: 50%; color: #fff; background: #1a120c; font-size: 20px; }
.sheet-body { position: relative; margin-top: -24px; padding: 20px; border-radius: 24px 24px 0 0; background: var(--card); }
.sheet-body h2 { margin-top: 8px; font-size: 22px; font-weight: 800; }
.sheet-description { margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.sheet-actions { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 12px 16px calc(16px + var(--safe-bottom)); border-top: 1px solid var(--line); }
.option-row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; margin-top: 10px; }
.option { display: grid; gap: 2px; padding: 10px 6px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card); text-align: center; }
.option.active { border-color: var(--gold); background: var(--gold-soft); }
.option strong { font-size: 12px; }
.option small { color: var(--muted); font-size: 11px; }
.block-title { margin: 18px 0 8px; font-size: 14px; font-weight: 700; }
.quantity-control { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.quantity-button { display: grid; width: 36px; height: 36px; place-items: center; border: 0; border-radius: 50%; background: #f3efe4; }
.quantity-button.primary { background: var(--gold); }
.cart-line { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-total { display: flex; justify-content: space-between; margin: 14px 0; font-size: 16px; font-weight: 800; }
.note-field { width: 100%; min-height: 72px; margin-top: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; resize: vertical; }
.empty-state { padding: 28px 12px; color: var(--muted); text-align: center; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: calc(24px + var(--safe-bottom)); transform: translateX(-50%); max-width: min(420px, calc(100% - 24px)); padding: 12px 16px; border-radius: 14px; background: #1a120c; color: #fff; font-size: 13px; font-weight: 600; box-shadow: 0 10px 24px rgba(0, 0, 0, .28); }
.toast[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
