@font-face {
  font-family: "Mabeo Vintage";
  src: url("fonts/MabeoVintageDemo-Regular.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
}

:root {
  --color-bg: #faf8f5;
  --color-surface: #ffffff;
  --color-text: #2c1810;
  --color-text-muted: #6b5b50;
  --color-accent: #5c3d2e;
  --color-accent-hover: #7a5240;
  --color-accent-light: #f0e6de;
  --color-border: #e0d5cc;
  --color-success: #2d7a4f;
  --color-danger: #b5342b;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 2px 8px rgba(44, 24, 16, 0.08);
  --shadow-lg: 0 4px 20px rgba(44, 24, 16, 0.12);
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-title: "Mabeo Vintage", serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

/* ─── Site Title ─────────────────────────────────────────────── */

.site-title {
  font-family: var(--font-title);
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: normal;
  color: var(--color-accent);
  text-align: center;
  padding: 20px 24px 12px;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  background: var(--color-bg);
}

/* ─── Embed Mode ─────────────────────────────────────────────── */
/* When ?embed=1, we're inside a host site's iframe (Wix /subscriptions
   today). Hide the duplicate site title, let height be content-driven so
   the host can autosize via postMessage, and remove the inner scroll
   container so the parent iframe handles scroll natively. */

html.embed-mode,
html.embed-mode body {
  min-height: 0;
  height: auto;
  overflow: visible;
  background: transparent;
}

html.embed-mode body {
  display: block;
}

html.embed-mode .site-title {
  display: none;
}

html.embed-mode .page-shell {
  flex: none;
  min-height: 0;
}

html.embed-mode .scroll-area {
  flex: none;
  min-height: 0;
  overflow: visible;
  padding-top: 8px;
}

html.embed-mode .detail-panel {
  max-height: none;
  overflow: visible;
}

/* Sticky checkout pins to the iframe viewport, which recreates inner scroll
   when the host iframe is shorter than the menu. Wix page scroll + floating
   mini-cart replace sticky in embed mode. */
html.embed-mode .checkout-bar {
  position: static;
}

/* ─── Embed floating cart (strategy B) ─────────────────────────
   Mini summary when the main checkout bar is off-screen (Wix scroll).
   Revert: set EMBED_FLOATING_CART_ENABLED = false in app.js; optional:
   delete this block and .embed-floating-cart-on rules below. */

html.embed-floating-cart-on .scroll-area {
  padding-bottom: 8px;
}

.embed-floating-cart {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: max(12px, env(safe-area-inset-bottom, 0px));
  z-index: 200;
  display: flex;
  align-items: stretch;
  gap: 8px;
  max-width: 900px;
  margin: 0 auto;
  padding: 10px 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius);
}

.embed-floating-cart[hidden] {
  display: none;
}

.embed-floating-cart-summary {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  padding: 6px 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-family: var(--font);
  color: var(--color-text);
}

.embed-floating-cart-summary:hover {
  background: var(--color-accent-light);
  border-radius: var(--radius);
}

.embed-floating-cart-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.embed-floating-cart-total {
  font-size: 17px;
  font-weight: 700;
  color: var(--color-accent);
}

.embed-floating-cart-cta {
  flex-shrink: 0;
  align-self: center;
  padding: 10px 18px;
  font-size: 14px;
  white-space: nowrap;
}

/* ─── Thanks Panel (embed-mode post-checkout) ────────────────── */

.thanks-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 32px 24px;
  margin: 16px 0 24px;
  text-align: center;
  box-shadow: var(--shadow);
}

.thanks-title {
  font-family: var(--font-title);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  color: var(--color-accent);
  margin-bottom: 12px;
  font-weight: normal;
}

.thanks-body {
  font-size: 15px;
  color: var(--color-text-muted);
  max-width: 520px;
  margin: 0 auto 20px;
  line-height: 1.6;
}

.thanks-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ─── About client (Marziale Tech) ──────────────────────────── */

.about-client-line {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2px 0;
  font-size: 14px;
  color: var(--color-text-muted);
  padding: 20px 0 24px;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.about-client-line img {
  height: 18px;
  width: auto;
  vertical-align: middle;
}

.about-client-line .about-client-angel {
  height: 40px;
  margin-left: -10px;
  margin-right: -10px;
}

.about-client-line .about-client-link {
  font-style: italic;
  font-weight: 700;
  text-decoration: none;
  color: var(--color-accent);
}

.about-client-line .about-client-link:hover {
  color: var(--color-accent-hover);
}

.about-client-line.about-client-line-inline {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

/* ─── Page Shell ─────────────────────────────────────────────── */

.page-shell {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.scroll-area {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 24px 8px;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

/* ─── Account Panel ──────────────────────────────────────────── */

.account-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0;
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.account-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 8px;
}

.account-subtitle {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-bottom: 14px;
}

.email-row {
  display: flex;
  gap: 8px;
  max-width: 420px;
}

.email-row input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  /* 16px prevents iOS Safari auto-zoom on focus (inputs < 16px trigger zoom). */
  font-size: 16px;
  outline: none;
  font-family: var(--font);
}

.email-row input:focus {
  border-color: var(--color-accent);
}

.otp-row {
  margin-bottom: 10px;
}

.otp-row input {
  letter-spacing: 0.2em;
  max-width: 180px;
}

.otp-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.account-status {
  margin-bottom: 12px;
}

.account-status p {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-bottom: 2px;
}

.account-status strong {
  color: var(--color-text);
}

.modify-hint {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 12px;
  font-style: italic;
}

/* ─── Subscription Card ──────────────────────────────────────── */

.sub-card {
  border: 1px solid var(--color-border);
  border-radius: 0;
  padding: 16px;
  background: var(--color-bg);
}

.sub-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.sub-cadence {
  font-weight: 700;
  font-size: 15px;
}

.sub-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.sub-badge.active { background: #dcfce7; color: var(--color-success); }
.sub-badge.past_due { background: #fef3c7; color: #92400e; }
.sub-badge.canceled { background: #fee2e2; color: var(--color-danger); }
.sub-badge.trialing { background: #dbeafe; color: #1e40af; }

.sub-items-list {
  list-style: none;
  margin-bottom: 12px;
}

.sub-items-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--color-accent-light);
}

.sub-items-list li:last-child { border-bottom: none; }

.sub-item-name {
  font-weight: 600;
  font-size: 13px;
}

.sub-item-detail {
  font-size: 13px;
  color: var(--color-text-muted);
  white-space: nowrap;
  margin-left: 12px;
}

.sub-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
  font-size: 13px;
}

.sub-total {
  font-weight: 700;
  color: var(--color-accent);
}

.sub-next {
  color: var(--color-text-muted);
}

.sub-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}

/* Cancellation banner — shown above the sub card when cancel_at_period_end
   is set. Warm-warning palette so it reads "informational, not error". */

.cancel-banner {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 0;
  margin-bottom: 12px;
  font-size: 13px;
  color: #78350f;
}

.cancel-banner-text {
  flex: 1;
  line-height: 1.45;
}

.cancel-banner-btn {
  white-space: nowrap;
}

.sub-card.ending {
  border-color: #f59e0b;
}

.sub-badge.ending {
  background: #fef3c7;
  color: #92400e;
}

.sub-next-final {
  color: #92400e;
  font-weight: 600;
}

/* Self-refund link sits below the action row so it doesn't compete with
   the primary "Billing & Payment" button visually but stays discoverable. */

.sub-refund-row {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--color-accent-light);
  text-align: right;
}

.sub-refund-link {
  font-size: 12px;
  color: var(--color-text-muted);
  text-decoration: underline;
}

.sub-refund-link:hover {
  color: var(--color-danger);
}

@media (max-width: 600px) {
  .cancel-banner {
    flex-direction: column;
    align-items: stretch;
  }
  .cancel-banner-btn {
    width: 100%;
  }
  .sub-refund-row {
    text-align: left;
  }
}

/* ─── Menu Section ───────────────────────────────────────────── */

.menu-section {
  margin-bottom: 100px;
}

.menu-shipping-banner {
  margin: 0 0 12px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.account-email-set {
  margin: 0 0 10px;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.45;
  background: var(--color-accent-light);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.account-email-set strong {
  color: var(--color-text);
}

.checkout-auth-panel {
  margin-bottom: 12px;
  padding: 14px 16px;
  background: #fffdf8;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.checkout-inline-auth {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: 1 1 auto;
  min-width: 0;
  margin-left: auto;
}

.checkout-inline-auth-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.checkout-inline-auth-hint {
  margin-bottom: 0;
  text-align: left;
}

.checkout-inline-auth-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  margin-left: auto;
}

.checkout-inline-otp {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: 1 1 auto;
  min-width: 0;
  margin-left: auto;
}

.checkout-inline-otp-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.checkout-inline-otp-hint {
  margin-bottom: 6px;
  text-align: left;
}

.checkout-inline-otp-hint strong {
  color: var(--color-text);
  font-weight: 600;
}

.checkout-inline-otp-error {
  margin-bottom: 6px;
}

.checkout-inline-otp-links {
  margin-top: 0;
}

.checkout-inline-otp-entry {
  flex: 0 0 auto;
  margin-bottom: 0;
  max-width: none;
  margin-left: auto;
}

.checkout-row-otp {
  flex-wrap: nowrap;
  align-items: center;
  gap: 12px;
}

.checkout-row-otp .cart-total {
  flex: 0 0 auto;
}

.checkout-bar-otp .checkout-row-otp {
  justify-content: flex-start;
}

@media (max-width: 720px) {
  .checkout-inline-otp {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .checkout-inline-otp-entry {
    margin-left: 0;
    width: 100%;
    max-width: 420px;
  }

  .checkout-inline-auth {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .checkout-inline-auth-entry {
    margin-left: 0;
    width: 100%;
    max-width: 420px;
  }
}

.checkout-inline-input {
  width: min(42vw, 180px);
  height: 40px;
  padding: 0 12px;
  font-size: 14px;
  border: 1px solid var(--color-border);
  border-radius: 0;
  background: #fff;
  color: var(--color-text);
}

.checkout-inline-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(139, 69, 19, 0.15);
}

.checkout-inline-input:disabled {
  opacity: 0.7;
  background: var(--color-surface);
}

.checkout-inline-go {
  min-width: 52px;
  padding: 10px 16px;
}

.checkout-auth-title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
}

.checkout-auth-subtitle {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--color-text-muted);
}

.checkout-auth-cancel {
  margin-top: 8px;
}

.checkout-btn[hidden] {
  display: none;
}

.menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.menu-header-start {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.menu-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-accent);
  margin: 0;
}

.cart-jump-btn {
  flex-shrink: 0;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 2px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s;
}

.cart-jump-btn.has-items {
  border-color: var(--color-danger);
  background: var(--color-danger);
  color: #fff;
}

.cart-jump-btn:hover {
  box-shadow: 0 2px 8px rgba(181, 52, 43, 0.35);
}

.cart-jump-count {
  display: block;
  line-height: 1;
}

.email-row input.email-input-highlight {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 3px rgba(181, 52, 43, 0.28);
  animation: email-input-shake 0.55s ease-out;
}

@keyframes email-input-shake {
  0%, 100% { transform: translateX(0); }
  18% { transform: translateX(-6px); }
  36% { transform: translateX(6px); }
  54% { transform: translateX(-4px); }
  72% { transform: translateX(4px); }
}

.account-panel-attention {
  border-color: var(--color-danger);
  animation: account-panel-pulse 2s ease-out;
}

@keyframes account-panel-pulse {
  0%, 100% {
    box-shadow: 0 0 0 3px rgba(181, 52, 43, 0.22), var(--shadow);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(181, 52, 43, 0.12), var(--shadow);
  }
}

.account-nudge {
  background: #fff8ed;
  border: 1px solid #e8c872;
  color: #7c5a10;
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}

.checkout-email-hint {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-danger);
  text-align: center;
  margin-bottom: 8px;
  line-height: 1.4;
}

.checkout-bar.checkout-highlight {
  box-shadow:
    0 0 0 3px rgba(181, 52, 43, 0.35),
    0 -4px 16px rgba(44, 24, 16, 0.1);
}

.checkout-btn.checkout-highlight {
  box-shadow: 0 0 0 3px rgba(181, 52, 43, 0.45);
}

/* ─── Cadence Toggle ─────────────────────────────────────────── */

.cadence-toggle {
  display: flex;
  background: var(--color-surface);
  border-radius: 0;
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.cadence-toggle.locked {
  opacity: 0.5;
  pointer-events: none;
}

.cadence-btn {
  padding: 6px 18px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: all 0.2s;
}

.cadence-btn.active {
  background: var(--color-accent);
  color: #fff;
}

/* ─── Category + Grid ────────────────────────────────────────── */

.category-section {
  margin-bottom: 14px;
}

.category-header {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding-bottom: 4px;
  margin-bottom: 8px;
  border-bottom: 2px solid var(--color-accent-light);
}

.flavor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  align-items: start;
}

/* ─── Flavor Tile ────────────────────────────────────────────── */

.flavor-tile {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: 0;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
}

.flavor-tile:hover { border-color: var(--color-accent); }

.flavor-tile.has-items {
  border-color: var(--color-accent);
  box-shadow: var(--shadow);
}

.flavor-tile.active-detail {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(92, 61, 46, 0.3);
}

.tile-header {
  display: flex;
  flex-direction: column;
  position: relative;
  cursor: pointer;
}

.tile-header:hover .tile-name,
.tile-header:hover .tile-subtitle,
.tile-header:hover .tile-from { background: var(--color-accent-light); }

.tile-img-wrap {
  position: relative;
  display: block;
}

.tile-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.tile-zoom-btn {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  transition: background 0.15s, transform 0.15s;
}

.tile-zoom-btn:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.05);
}

.tile-zoom-btn svg {
  width: 16px;
  height: 16px;
  display: block;
}

.tile-name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  padding: 10px 14px 0;
}

.tile-subtitle {
  margin: 0;
  padding: 4px 14px 0;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--color-text-muted, #6b6b6b);
  white-space: pre-wrap;
}

.tile-from {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 3px;
  padding: 0 14px 10px;
}

.tile-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 0;
  background: var(--color-danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.tile-body { padding: 0 10px 12px; }

.selector-row { margin-bottom: 10px; }

.pill-group {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.pill {
  padding: 6px 10px;
  border: 1px solid var(--color-border);
  border-radius: 0;
  background: var(--color-surface);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--color-text);
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  flex: 1;
  min-width: 0;
}

.pill:hover {
  border-color: var(--color-accent);
  background: var(--color-accent-light);
}

.pill.active {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

.pill-price {
  font-size: 11px;
  font-weight: 400;
  opacity: 0.8;
}

.add-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px solid var(--color-accent-light);
}

.add-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-accent);
}

.add-cadence {
  font-size: 12px;
  font-weight: 400;
  color: var(--color-text-muted);
}

.add-btn {
  width: 100%;
  padding: 10px 16px;
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: 0;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.add-btn:hover { background: var(--color-accent-hover); }

.qty-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.qty-btn {
  width: 34px;
  height: 34px;
  border-radius: 0;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  color: var(--color-text);
}

.qty-btn:hover { background: var(--color-accent-light); border-color: var(--color-accent); }
.qty-btn:disabled { opacity: 0.3; cursor: default; }

.qty-value {
  font-size: 17px;
  font-weight: 700;
  min-width: 22px;
  text-align: center;
}

/* ─── Menu Layout (grid + detail panel) ───────────────────────── */

.menu-layout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.menu-grid-area {
  flex: 1;
  min-width: 0;
}

.menu-layout.has-detail .menu-grid-area {
  flex: 55;
}

.menu-layout.has-detail .flavor-grid {
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
}

/* ─── Detail Panel ────────────────────────────────────────────── */

.detail-panel {
  flex: 45;
  min-width: 0;
  position: sticky;
  top: 0;
  align-self: flex-start;
  max-height: 100vh;
  overflow-y: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}

.detail-close-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-close-btn:hover {
  background: rgba(0, 0, 0, 0.7);
}

.detail-img-wrap {
  position: relative;
}

.detail-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.detail-body {
  padding: 16px;
}

.detail-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 8px;
}

.detail-description {
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-text-muted);
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--color-accent-light);
}

.detail-description p {
  margin: 0 0 12px;
}

.detail-description p:last-child {
  margin-bottom: 0;
}

.detail-description table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 13px;
}

.detail-description th,
.detail-description td {
  padding: 3px 0;
  vertical-align: top;
  text-align: left;
}

.detail-description th {
  font-weight: 600;
  color: var(--color-accent);
  padding-right: 12px;
  white-space: nowrap;
  width: 1%;
}

.detail-description td {
  color: var(--color-text);
}

/* On mobile, JS renders the row-based layout; desktop grid/panel not used */

/* ─── Checkout Bar ───────────────────────────────────────────── */

.checkout-bar {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -4px 16px rgba(44, 24, 16, 0.1);
  padding: 12px 24px;
  z-index: 100;
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
}

.checkout-bar.hidden { display: none; }

.cart-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
  /* Cap the summary height so the bar never grows past a few rows of chips;
     additional items scroll inside this area instead of pushing the bar up. */
  max-height: 30vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.cart-items::-webkit-scrollbar {
  width: 6px;
}

.cart-items::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}

.cart-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--color-accent-light);
  border-radius: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-accent);
}

.cart-chip-qty {
  background: var(--color-danger);
  color: #fff;
  width: 18px;
  height: 18px;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
}

.cart-chip-remove {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}

.cart-chip-remove:hover { color: var(--color-danger); }

.checkout-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-total {
  font-size: 13px;
  color: var(--color-text-muted);
}

.cart-total strong {
  color: var(--color-text);
  font-size: 18px;
}

.empty-cart-msg {
  font-size: 13px;
  color: var(--color-text-muted);
  font-style: italic;
}

.shipping-note {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-left: 4px;
}

.shipping-note.free,
.sub-shipping.free {
  color: var(--color-success);
  font-weight: 700;
}

.sub-shipping {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-left: 6px;
}

.free-ship-hint {
  font-size: 12px;
  color: var(--color-accent);
  background: var(--color-accent-light);
  padding: 6px 10px;
  border-radius: var(--radius);
  margin-bottom: 8px;
  text-align: center;
  font-weight: 600;
}

.checkout-btn {
  background: var(--color-accent);
  color: #fff;
  border: none;
  padding: 10px 32px;
  border-radius: 0;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.checkout-btn:hover { background: var(--color-accent-hover); }
.checkout-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.save-success {
  background: #dcfce7;
  color: var(--color-success);
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 8px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Buttons ────────────────────────────────────────────────── */

.btn-primary {
  padding: 10px 20px;
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: 0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.btn-primary:hover { background: var(--color-accent-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  padding: 8px 16px;
  border: 1px solid var(--color-border);
  border-radius: 0;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  border-color: var(--color-accent);
  background: var(--color-accent-light);
}

.btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-link {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.btn-link:hover { color: var(--color-accent); }

/* ─── Utility ────────────────────────────────────────────────── */

.loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-muted);
  font-size: 16px;
}

.loading-small {
  color: var(--color-text-muted);
  font-size: 14px;
  padding: 8px 0;
}

.error-msg {
  background: #fef2f2;
  color: var(--color-danger);
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 12px;
  font-size: 14px;
}

/* ─── Zoom Lightbox ──────────────────────────────────────────── */

.zoom-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.88);
  user-select: none;
}

.zoom-lightbox[hidden] { display: none; }

.zoom-backdrop {
  position: absolute;
  inset: 0;
}

.zoom-shell {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.zoom-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.zoom-close:hover { background: rgba(255, 255, 255, 0.28); }

.zoom-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}

.zoom-stage.is-panning { cursor: grabbing; }

.zoom-img {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  max-width: none;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  will-change: transform;
}

.zoom-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.45);
}

.zoom-controls button {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: none;
  padding: 8px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 4px;
  min-width: 44px;
  font-family: inherit;
}

.zoom-controls button:hover { background: rgba(255, 255, 255, 0.26); }

.zoom-desc {
  margin: 0;
  padding: 12px 20px 18px;
  color: #f0f0f0;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  white-space: pre-wrap;
  background: rgba(0, 0, 0, 0.45);
}

.zoom-desc:empty { display: none; }

/* Zoom lightbox is hidden on mobile via the main mobile block below */

/* ─── Mobile: compact row list + inline accordion ────────────── */

@media (max-width: 600px) {
  .scroll-area { padding: 14px 10px 8px; }
  .menu-header h2 { font-size: 18px; }
  .account-panel { padding: 16px; }
  .sub-card-footer { flex-direction: column; gap: 4px; align-items: flex-start; }
  .email-row { max-width: 100%; }
  .checkout-bar { padding: 10px 12px; }

  /* On phones, hard-cap the summary to ~2 rows of chips and scroll the rest,
     so the sticky bar can't expand upward and cover the menu. */
  .cart-items {
    max-height: 76px;
    margin-bottom: 8px;
    padding-right: 2px;
  }

  .mobile-product-list .category-header {
    margin-top: 12px;
  }

  .m-row-wrap {
    border-bottom: 1px solid var(--color-border);
  }

  .m-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 4px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .m-row:active {
    background: var(--color-accent-light);
  }

  .m-row-thumb-wrap {
    position: relative;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
  }

  .m-row-thumb {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
    display: block;
  }

  .m-row-thumb-empty {
    background: var(--color-accent-light);
  }

  .m-row-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--color-danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }

  .m-row-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
  }

  .m-row-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .m-row-price {
    font-size: 13px;
    color: var(--color-text-muted);
  }

  .m-row-chevron {
    flex-shrink: 0;
    font-size: 18px;
    color: var(--color-text-muted);
    width: 20px;
    text-align: center;
  }

  .m-row-active {
    background: var(--color-accent-light);
    border-radius: 4px;
  }

  .m-row-active .m-row-name {
    color: var(--color-accent);
  }

  /* ── Mobile back button ──────────────────────── */

  .m-back-btn {
    background: none;
    border: none;
    color: var(--color-accent);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 0;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
  }

  /* ── Mobile full-screen detail view ─────────── */

  .m-detail {
    padding: 0 0 14px;
  }

  .m-detail-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-accent);
    margin-bottom: 10px;
  }

  .m-detail-img {
    width: 100%;
    height: clamp(220px, 60vw, 320px);
    object-fit: contain;
    background: transparent;
    border-radius: 4px;
    display: block;
    margin-bottom: 12px;
  }

  .m-detail .selector-row { margin-bottom: 8px; }
  .m-detail .pill-group { gap: 6px; }
  .m-detail .pill { font-size: 13px; padding: 6px 12px; }
  .m-detail .size-pill .pill-price { font-size: 11px; }
  .m-detail .add-row { margin-top: 4px; }

  .m-detail-desc {
    font-size: 13px;
    line-height: 1.5;
    color: var(--color-text-muted);
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--color-accent-light);
  }

  .m-detail-desc table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-bottom: 8px;
  }

  .m-detail-desc th {
    text-align: left;
    font-weight: 600;
    color: var(--color-accent);
    padding: 2px 8px 2px 0;
    white-space: nowrap;
    width: 1%;
  }

  .m-detail-desc td {
    padding: 2px 0;
    color: var(--color-text);
  }

  .m-detail-desc p {
    margin: 0 0 8px;
  }

  .m-detail-desc p:last-child {
    margin-bottom: 0;
  }

  /* Hide the zoom lightbox trigger on mobile */
  .tile-zoom-btn { display: none !important; }
  .zoom-lightbox { display: none !important; }
}

/* ─── Responsive (desktop breakpoints) ───────────────────────── */

@media (min-width: 601px) and (max-width: 767px) {
  .flavor-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
}

@media (min-width: 768px) {
  .flavor-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
  .flavor-grid { grid-template-columns: repeat(4, 1fr); }
}
