:root {
  color-scheme: light;
  --wine-950: #3d0f18;
  --wine-900: #581522;
  --wine-800: #771f2d;
  --wine-700: #922b3b;
  --wine-100: #f6e8e8;
  --cream-50: #fffdf8;
  --cream-100: #fbf4e7;
  --cream-200: #f3e5ca;
  --gold-500: #d89a32;
  --gold-300: #f1c66f;
  --ink: #251d1c;
  --muted: #706563;
  --line: #e8ddd5;
  --success: #276749;
  --danger: #a32931;
  --surface: #ffffff;
  --shadow: 0 14px 38px rgb(61 15 24 / 10%);
  --radius-lg: 24px;
  --radius-md: 16px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { background: var(--cream-50); scroll-behavior: smooth; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% -10%, rgb(216 154 50 / 12%), transparent 28rem),
    var(--cream-50);
  -webkit-tap-highlight-color: transparent;
}

button,
input,
select,
textarea { font: inherit; }

button { color: inherit; }

button,
a,
input,
select,
textarea { touch-action: manipulation; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--gold-500);
  outline-offset: 3px;
}

[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: white;
  background: var(--wine-900);
  border-radius: 10px;
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.login-screen {
  min-height: 100dvh;
  display: grid;
  align-items: end;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, transparent 0 34%, var(--cream-50) 58%),
    radial-gradient(circle at 50% 10%, var(--gold-300), var(--cream-100) 42%, transparent 43%);
}

.login-card {
  width: min(100%, 480px);
  margin: 0 auto;
  padding: 28px 24px 24px;
  background: rgb(255 253 248 / 94%);
  border: 1px solid rgb(232 221 213 / 70%);
  border-radius: 30px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.login-logo {
  display: block;
  margin: -74px auto 22px;
  border: 8px solid var(--cream-50);
  border-radius: 50%;
  box-shadow: 0 8px 24px rgb(61 15 24 / 14%);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--wine-700);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

h1,
h2,
p { margin-top: 0; }

h1,
h2 { color: var(--wine-950); font-family: Georgia, "Times New Roman", serif; }

.login-card h1 {
  margin-bottom: 12px;
  font-size: clamp(2.2rem, 11vw, 3.4rem);
  line-height: .98;
  letter-spacing: -.045em;
}

.login-copy {
  margin-bottom: 24px;
  color: var(--muted);
  font-size: .98rem;
  line-height: 1.55;
}

label {
  display: block;
  margin-bottom: 7px;
  font-size: .84rem;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  color: var(--ink);
  background: white;
  border: 1px solid #d9ceca;
  border-radius: 12px;
}

textarea { resize: vertical; }

.phone-field {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  overflow: hidden;
  background: white;
  border: 1px solid #d9ceca;
  border-radius: 12px;
}

.phone-field:focus-within { outline: 3px solid var(--gold-500); outline-offset: 2px; }

.phone-field span { padding: 0 2px 0 14px; color: var(--muted); font-weight: 700; }

.phone-field input { border: 0; outline: 0; }

.field-help,
.field-error,
.legal-note { font-size: .75rem; }

.field-help { margin: 7px 0 0; color: var(--muted); }

.field-help-warning { color: var(--danger); font-weight: 700; }

.field-error { min-height: 1em; margin: 7px 0; color: var(--danger); font-weight: 700; }

.legal-note { margin: 18px 0 0; color: var(--muted); line-height: 1.45; text-align: center; }

.button {
  min-height: 48px;
  padding: 12px 19px;
  border: 0;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
}

.button:disabled { cursor: wait; opacity: .65; }

.button-wide { width: 100%; }

.button-primary {
  color: white;
  background: var(--wine-800);
  box-shadow: 0 8px 18px rgb(119 31 45 / 22%);
}

.button-primary:hover { background: var(--wine-900); }

.button-secondary {
  color: var(--wine-800);
  background: var(--wine-100);
  border: 1px solid #e2bfc3;
}

#login-form .button { margin-top: 13px; }

.app-shell { width: min(100%, 980px); margin: 0 auto; }

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: max(10px, env(safe-area-inset-top)) 18px 10px;
  background: rgb(255 253 248 / 91%);
  border-bottom: 1px solid rgb(232 221 213 / 65%);
  backdrop-filter: blur(14px);
}

.brand-button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0;
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.brand-button img { border-radius: 50%; }

.brand-button span { display: grid; gap: 2px; }
.brand-button strong { color: var(--wine-950); font-family: Georgia, serif; font-size: .97rem; }
.brand-button small { color: var(--muted); font-size: .7rem; }

.connection-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  color: var(--muted);
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 800;
}

.connection-badge i { width: 7px; height: 7px; background: var(--gold-500); border-radius: 50%; }
.connection-badge.online i { background: var(--success); }
.connection-badge.offline i { background: var(--danger); }

main { padding: 0 16px calc(100px + var(--safe-bottom)); }

.view { animation: view-in .22s ease-out; }

@keyframes view-in {
  from { opacity: .4; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}

.hero { padding: 30px 4px 16px; }
.hero h1,
.page-heading h1 { margin-bottom: 8px; font-size: clamp(2.15rem, 9vw, 3.4rem); line-height: 1; letter-spacing: -.035em; }
.hero p:last-child { max-width: 36rem; margin: 0; color: var(--muted); line-height: 1.5; }

.promo-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px;
  min-height: 190px;
  margin: 4px 0 28px;
  padding: 24px;
  overflow: hidden;
  color: white;
  background: linear-gradient(135deg, var(--wine-900), var(--wine-700));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.promo-card::after {
  content: "";
  position: absolute;
  right: -44px;
  bottom: -64px;
  width: 180px;
  height: 180px;
  background: rgb(241 198 111 / 12%);
  border: 1px solid rgb(241 198 111 / 25%);
  border-radius: 50%;
}

.promo-kicker { color: var(--gold-300); font-size: .72rem; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.promo-card h2 { margin: 8px 0 18px; color: white; font-size: 1.65rem; line-height: 1.05; }
.promo-card .text-button { color: var(--gold-300); }

.promo-mark {
  z-index: 1;
  align-self: center;
  justify-self: center;
  color: var(--gold-300);
  font-family: Georgia, serif;
  font-size: 5rem;
  font-weight: 800;
  text-shadow: 0 5px 15px rgb(0 0 0 / 18%);
}

.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.section-heading h2 { margin-bottom: 12px; font-size: 1.55rem; }

.text-button,
.back-button,
.logout-button {
  min-height: 44px;
  padding: 7px 0;
  color: var(--wine-700);
  background: transparent;
  border: 0;
  font-size: .83rem;
  font-weight: 800;
  cursor: pointer;
}

.category-strip {
  display: flex;
  gap: 9px;
  margin: 0 -16px 18px;
  padding: 2px 16px 8px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

.category-strip::-webkit-scrollbar { display: none; }

.category-button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 10px 15px;
  color: var(--wine-800);
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 800;
  cursor: pointer;
  scroll-snap-align: start;
}

.category-button[aria-pressed="true"] { color: white; background: var(--wine-800); border-color: var(--wine-800); }

.product-list { display: grid; gap: 12px; }

.product-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 18px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 5px 18px rgb(61 15 24 / 4%);
}

.product-card h3 { margin: 0 0 5px; color: var(--wine-950); font-family: Georgia, serif; font-size: 1.15rem; }
.product-card p { margin: 0; color: var(--muted); font-size: .79rem; line-height: 1.45; }
.product-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.product-price { color: var(--wine-800); font-size: .93rem; font-weight: 850; }
.category-label { color: var(--gold-500); font-size: .66rem; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }

.add-button,
.quantity-button {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  color: white;
  background: var(--wine-800);
  border: 0;
  border-radius: 50%;
  font-size: 1.5rem;
  font-weight: 500;
  cursor: pointer;
}

.add-button.added { color: var(--wine-800); background: var(--wine-100); }

.page-heading { padding: 30px 4px 18px; }
.page-heading.compact { padding-top: 8px; }
.back-button { margin-top: 16px; }

.empty-state {
  display: grid;
  justify-items: center;
  padding: 55px 22px;
  text-align: center;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.empty-state h2 { margin: 16px 0 7px; }
.empty-state p { max-width: 18rem; color: var(--muted); line-height: 1.5; }
.empty-icon {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  color: var(--wine-800);
  background: var(--gold-300);
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 2.4rem;
  font-weight: 850;
}

.cart-list { display: grid; gap: 10px; }
.cart-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 17px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.cart-item h2 { margin: 0 0 5px; font-size: 1.08rem; }
.cart-item p { margin: 0; color: var(--muted); font-size: .78rem; }
.cart-item-mods { margin-top: 4px !important; color: var(--wine-700) !important; font-weight: 700; }

.checkbox-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.checkbox-row:last-child { border-bottom: none; }
.checkbox-row label { display: flex; align-items: center; gap: 10px; font-weight: 650; }
.checkbox-row input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--wine-800); }
.checkbox-row .checkbox-extra-price { color: var(--wine-700); font-weight: 800; font-size: .85rem; }

.product-customize-button { margin-top: 6px; padding: 0; font-size: .78rem; }
.cart-item-price { align-self: start; color: var(--wine-800); font-weight: 850; }
.quantity-control { display: flex; align-items: center; gap: 13px; margin-top: 13px; }
.quantity-button { width: 42px; height: 42px; color: var(--wine-800); background: var(--wine-100); font-size: 1.15rem; }
.quantity-control output { min-width: 18px; text-align: center; font-weight: 850; }

.summary-card {
  margin-top: 18px;
  padding: 20px;
  background: var(--cream-100);
  border: 1px solid var(--cream-200);
  border-radius: var(--radius-md);
}

.summary-line { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 10px; color: var(--muted); font-size: .85rem; }
.summary-line.total { margin: 16px 0 18px; padding-top: 15px; color: var(--wine-950); border-top: 1px solid var(--cream-200); font-size: 1.05rem; font-weight: 850; }
.summary-note { margin: 0 0 17px; color: var(--muted); font-size: .75rem; line-height: 1.45; }

.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 16px; padding: 0; border: 0; }
.choice-card {
  position: relative;
  display: grid;
  justify-items: start;
  min-height: 142px;
  margin: 0;
  padding: 16px;
  background: white;
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.choice-card:has(input:checked) { background: var(--wine-100); border-color: var(--wine-800); }
.choice-card input { position: absolute; top: 12px; right: 12px; width: 20px; min-height: 20px; accent-color: var(--wine-800); }
.choice-icon { display: grid; place-items: center; width: 39px; height: 39px; margin-bottom: 10px; color: var(--wine-800); background: var(--cream-100); border-radius: 50%; font-size: 1.2rem; font-weight: 850; }
.choice-card strong { margin-bottom: 3px; color: var(--wine-950); font-family: Georgia, serif; font-size: 1.05rem; }
.choice-card small { color: var(--muted); font-size: .72rem; }

.form-card { margin-bottom: 16px; padding: 18px; background: white; border: 1px solid var(--line); border-radius: var(--radius-md); }
.form-card h2 { margin: 0 0 17px; font-size: 1.25rem; }
.form-card input,
.form-card select,
.form-card textarea { margin-bottom: 16px; }
.form-card label span { color: var(--muted); font-weight: 500; }
.split-fields { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(90px, .65fr); gap: 10px; }

.payment-note { display: flex; align-items: center; gap: 12px; margin: 18px 2px; }
.payment-note > span { display: grid; place-items: center; flex: 0 0 40px; width: 40px; height: 40px; color: var(--wine-800); background: var(--gold-300); border-radius: 50%; font-weight: 900; }
.payment-note p { margin: 0; line-height: 1.35; }
.payment-note small { color: var(--muted); }
.checkout-total { display: flex; justify-content: space-between; gap: 20px; margin: 20px 2px 4px; font-size: 1.08rem; }
.checkout-total strong { color: var(--wine-800); }

.order-card { overflow: hidden; background: white; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.order-card-header { padding: 22px; color: white; background: linear-gradient(135deg, var(--wine-900), var(--wine-700)); }
.order-card-header.declined { background: linear-gradient(135deg, #3a3532, var(--danger)); }
.order-card-header.completed { background: linear-gradient(135deg, var(--success), #3f9a6d); }
.order-card-header.completed .order-card-emoji { display: block; margin-bottom: 6px; font-size: 2.2rem; }
.order-card-header small { color: var(--gold-300); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.order-card-header h2 { margin: 8px 0 4px; color: white; font-size: 1.5rem; }
.order-card-header p { margin: 0; color: rgb(255 255 255 / 76%); font-size: .8rem; }
.order-body { padding: 22px; }

.timeline { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.timeline li { position: relative; display: grid; grid-template-columns: 30px 1fr; gap: 12px; min-height: 66px; color: var(--muted); }
.timeline li::after { content: ""; position: absolute; top: 29px; bottom: 0; left: 12px; width: 2px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline-dot { position: relative; z-index: 1; display: grid; place-items: center; width: 26px; height: 26px; color: white; background: #cfc6c2; border: 4px solid white; border-radius: 50%; box-shadow: 0 0 0 1px #cfc6c2; font-size: .64rem; }
.timeline li.complete,
.timeline li.current { color: var(--ink); }
.timeline li.complete .timeline-dot,
.timeline li.current .timeline-dot { background: var(--wine-800); box-shadow: 0 0 0 1px var(--wine-800); }
.timeline li.current .timeline-dot { animation: pulse 1.8s infinite; }
.timeline strong { display: block; margin: 2px 0; font-size: .9rem; }
.timeline small { font-size: .75rem; }

@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgb(119 31 45 / 12%); } }

.order-details { display: grid; gap: 9px; margin-top: 15px; padding-top: 17px; border-top: 1px solid var(--line); }
.order-details div { display: flex; justify-content: space-between; gap: 20px; font-size: .8rem; }
.order-details span { color: var(--muted); }
.demo-action { margin-top: 18px; }

.loyalty-card { margin-bottom: 18px; padding: 22px; color: white; background: linear-gradient(135deg, var(--wine-900), var(--wine-700)); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.loyalty-copy { display: grid; gap: 5px; }
.loyalty-copy span { color: var(--gold-300); font-size: .72rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.loyalty-copy strong { font-family: Georgia, serif; font-size: 1.5rem; }
.loyalty-copy strong b { color: var(--gold-300); font-size: 2rem; }
.loyalty-copy small { color: rgb(255 255 255 / 70%); line-height: 1.4; }
.stamp-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; margin-top: 20px; }
.stamp { aspect-ratio: 1; display: grid; place-items: center; color: rgb(255 255 255 / 38%); border: 1px solid rgb(255 255 255 / 30%); border-radius: 50%; font-family: Georgia, serif; font-size: .7rem; font-weight: 850; }
.stamp.earned { color: var(--wine-900); background: var(--gold-300); border-color: var(--gold-300); }
.reward-banner { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding: 15px 17px; background: linear-gradient(135deg, #fff3d6, #ffe6ae); border: 1px solid var(--gold-300); border-radius: 16px; }
.reward-banner strong { display: block; color: var(--wine-900); font-size: .98rem; }
.reward-banner small { color: #6b5312; }
.reward-banner-icon { flex-shrink: 0; font-size: 1.6rem; }
.profile-actions { display: grid; gap: 7px; margin-top: 18px; }
.logout-button { color: var(--danger); }

.bottom-nav {
  position: fixed;
  z-index: 30;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 7px max(8px, env(safe-area-inset-left)) calc(7px + var(--safe-bottom)) max(8px, env(safe-area-inset-right));
  background: rgb(255 255 255 / 94%);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 25px rgb(61 15 24 / 7%);
  backdrop-filter: blur(14px);
}

.bottom-nav button {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  min-height: 56px;
  color: #8b807c;
  background: transparent;
  border: 0;
  border-radius: 12px;
  font-size: 1.35rem;
  cursor: pointer;
}

.bottom-nav button[aria-current="page"] { color: var(--wine-800); background: var(--wine-100); }
.bottom-nav small { font-size: .64rem; font-weight: 800; }
.nav-icon { transform: rotate(8deg); }
.nav-badge { position: absolute; top: 4px; left: calc(50% + 8px); display: grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; color: white; background: var(--wine-800); border: 2px solid white; border-radius: 999px; font-size: .64rem; }

.toast {
  position: fixed;
  z-index: 60;
  right: 16px;
  bottom: calc(88px + var(--safe-bottom));
  left: 16px;
  width: min(calc(100% - 32px), 450px);
  margin: auto;
  padding: 13px 16px;
  color: white;
  background: var(--wine-950);
  border-radius: 13px;
  box-shadow: 0 12px 30px rgb(0 0 0 / 22%);
  font-size: .83rem;
  font-weight: 750;
  text-align: center;
}

@media (min-width: 700px) {
  main { padding-inline: 28px; }
  .topbar { padding-inline: 28px; }
  .promo-card { grid-template-columns: 1fr 150px; padding: 30px; }
  .promo-card h2 { font-size: 2rem; }
  .product-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-strip { margin-inline: -28px; padding-inline: 28px; }
  .bottom-nav { right: 50%; left: auto; width: min(520px, calc(100% - 32px)); transform: translateX(50%); bottom: 12px; padding: 7px; border: 1px solid var(--line); border-radius: 20px; }
  main { padding-bottom: 110px; }
  .login-screen { align-items: center; }
  .login-logo { margin-top: -74px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
