/* =====================================================
   MOY-MOY — ORDERING
   Shop, cart, checkout and confirmation. Built on the
   brand tokens in styles.css; nothing new is invented
   here except the product canvas.
   ===================================================== */

:root {
  /* The soft off-white the bottle was actually photographed against. Product
     shots sit on this rather than on a brand colour, which would crop in
     around the drink as a band of yellow. */
  --product-canvas: #f1eeec;
  --ink-muted: #6b6259;
  --hairline: #ece2cd;
  --surface: #fffdf7;
  --ok: #2d8a4e;
}

/* ── SHELL ───────────────────────────────────────── */
.order-main {
  background: var(--surface);
  min-height: 60vh;
  padding: 48px 0 var(--section-pad);
}
.order-narrow { max-width: 720px; margin: 0 auto; }

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.breadcrumbs a { color: var(--cherry-milk); }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs span[aria-current] { color: var(--toasted-tapioca); }

.order-card {
  background: var(--misty-cloud);
  border: 2px solid var(--hairline);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.order-card + .order-card { margin-top: 20px; }
.order-card h2 {
  font-family: var(--font-heading);
  color: var(--toasted-tapioca);
  font-size: 1.4rem;
  margin-bottom: 6px;
}
.order-card > p.card-lede {
  color: var(--ink-muted);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

/* ── ORDER CHANNEL CHOOSER ───────────────────────── */
.channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.channel {
  background: var(--misty-cloud);
  border: 2px solid var(--hairline);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.channel:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.channel-featured {
  border-color: var(--cherry-milk);
  background: var(--vanilla-cream);
}
.channel-badge {
  align-self: flex-start;
  background: var(--burnt-toffee);
  color: var(--midnight-boba);
  border-radius: var(--pill);
  padding: 5px 14px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.channel h3 { font-family: var(--font-heading); color: var(--toasted-tapioca); }
.channel p { font-size: 0.95rem; color: var(--ink-muted); flex: 1; }
.channel .btn { align-self: flex-start; }
.channel-featured p { color: var(--toasted-tapioca); }

/* ── PRODUCT ─────────────────────────────────────── */
.product-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
.product-figure {
  position: relative;
  background: var(--product-canvas);
  border-radius: var(--radius);
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 460px;
  overflow: hidden;
}
.product-figure img {
  width: 100%;
  height: auto;
  max-height: 620px;
  object-fit: contain;
}
.product-figure .star-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--burnt-toffee);
  color: var(--midnight-boba);
  border-radius: var(--pill);
  padding: 6px 14px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.product-info h1 {
  font-family: var(--font-heading);
  color: var(--cherry-milk);
  margin-bottom: 4px;
}
.product-subtitle {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-bottom: 16px;
}
.product-price {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--toasted-tapioca);
  margin-bottom: 18px;
}
.product-info p { line-height: 1.75; margin-bottom: 18px; }
.product-details {
  list-style: none;
  margin: 0 0 26px;
  padding: 0;
  display: grid;
  gap: 8px;
}
.product-details li {
  position: relative;
  padding-left: 22px;
  font-size: 0.94rem;
  color: var(--ink-muted);
}
.product-details li::before {
  content: "•";
  position: absolute;
  left: 6px;
  color: var(--cherry-milk);
  font-weight: 800;
}

.qty-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

.stepper {
  display: inline-flex;
  align-items: center;
  border: 2px solid var(--hairline);
  border-radius: var(--pill);
  overflow: hidden;
  background: var(--misty-cloud);
}
.stepper button {
  width: 44px;
  height: 44px;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--toasted-tapioca);
  transition: background 0.18s;
}
.stepper button:hover:not(:disabled) { background: var(--vanilla-cream); }
.stepper button:disabled { opacity: 0.35; cursor: not-allowed; }
.stepper output {
  min-width: 44px;
  text-align: center;
  font-weight: 800;
  font-size: 1.05rem;
}

.also-note {
  margin-top: 26px;
  padding: 16px 18px;
  background: var(--vanilla-cream);
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--toasted-tapioca);
}

/* ── CART ────────────────────────────────────────── */
.cart-line {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--hairline);
}
.cart-line:last-of-type { border-bottom: none; }
/* Portrait, not square: a drink three times taller than it is wide reads as a
   smudge in a 72px square. */
.cart-thumb {
  width: 64px;
  height: 88px;
  background: var(--product-canvas);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.cart-thumb img { width: 100%; height: 100%; object-fit: contain; }
.cart-line-name { font-weight: 800; color: var(--toasted-tapioca); }
.cart-line-meta { font-size: 0.85rem; color: var(--ink-muted); }
.cart-line-right { text-align: right; display: grid; gap: 8px; justify-items: end; }
.cart-line-price { font-weight: 800; white-space: nowrap; }
.link-remove {
  background: none;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--cherry-milk);
  text-decoration: underline;
}

.totals { display: grid; gap: 8px; margin-top: 20px; }
.totals-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.95rem;
}
.totals-row span:last-child { white-space: nowrap; }
.totals-row.muted { color: var(--ink-muted); }
.totals-row.grand {
  border-top: 2px solid var(--toasted-tapioca);
  padding-top: 12px;
  margin-top: 6px;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--toasted-tapioca);
}

.empty-state { text-align: center; padding: 40px 20px; }
.empty-state p { color: var(--ink-muted); margin-bottom: 20px; }

/* ── FORMS ───────────────────────────────────────── */
.field { margin-bottom: 18px; }
.field label,
.fieldset-legend {
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--toasted-tapioca);
  margin-bottom: 7px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 13px 16px;
  border: 2px solid var(--hairline);
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--misty-cloud);
  color: var(--midnight-boba);
  outline: none;
  transition: border-color 0.18s;
}
.field textarea { min-height: 88px; resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--cherry-milk); }
.field .hint { font-size: 0.82rem; color: var(--ink-muted); margin-top: 6px; }
.field .field-error {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--cherry-milk);
  margin-top: 6px;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 6px;
}
.segmented button {
  padding: 16px 14px;
  border: 2px solid var(--hairline);
  border-radius: 12px;
  background: var(--misty-cloud);
  text-align: left;
  transition: all 0.18s ease;
}
.segmented button strong {
  display: block;
  font-family: var(--font-body);
  font-weight: 800;
  color: var(--toasted-tapioca);
  margin-bottom: 2px;
}
.segmented button span { font-size: 0.82rem; color: var(--ink-muted); }
.segmented button[aria-pressed="true"] {
  border-color: var(--cherry-milk);
  background: var(--vanilla-cream);
}

.tip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tip-row button {
  padding: 11px 18px;
  border: 2px solid var(--hairline);
  border-radius: var(--pill);
  background: var(--misty-cloud);
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--toasted-tapioca);
  transition: all 0.18s ease;
}
.tip-row button[aria-pressed="true"] {
  background: var(--burnt-toffee);
  border-color: var(--burnt-toffee);
  color: var(--midnight-boba);
}

/* ── ADDRESS COMBOBOX ────────────────────────────── */
.combobox { position: relative; }
.combobox-list {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--misty-cloud);
  border: 2px solid var(--hairline);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  max-height: 300px;
  overflow-y: auto;
  padding: 6px;
  margin: 0;
  list-style: none;
}
.combobox-list[hidden] { display: none; }
.combobox-list li {
  padding: 11px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.94rem;
  line-height: 1.45;
}
.combobox-list li[aria-selected="true"],
.combobox-list li:hover { background: var(--vanilla-cream); }
.combobox-list .suggestion-note {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 2px;
}
.combobox-status { font-size: 0.85rem; color: var(--ink-muted); margin-top: 6px; }
.combobox-status.is-good { color: var(--ok); font-weight: 700; }
.combobox-status.is-bad { color: var(--cherry-milk); font-weight: 700; }

/* ── NOTICES ─────────────────────────────────────── */
.notice {
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 0.93rem;
  line-height: 1.6;
  margin-bottom: 20px;
  border: 2px solid transparent;
}
.notice-info { background: var(--vanilla-cream); color: var(--toasted-tapioca); }
.notice-warn { background: #fff4e2; border-color: var(--burnt-toffee); color: var(--toasted-tapioca); }
.notice-error { background: #fdecea; border-color: var(--cherry-milk); color: #7c1a14; }
.notice-ok { background: #eaf6ee; border-color: var(--ok); color: #1c5c33; }
.notice[hidden] { display: none; }

/* ── CONFIRMATION ────────────────────────────────── */
.confirm-hero { text-align: center; margin-bottom: 32px; }
.confirm-hero h1 { font-family: var(--font-heading); color: var(--cherry-milk); margin-bottom: 8px; }
.reference-chip {
  display: inline-block;
  background: var(--vanilla-cream);
  border-radius: 14px;
  padding: 16px 32px;
  margin: 18px 0 8px;
}
.reference-chip .reference-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.reference-chip .reference-value {
  display: block;
  font-family: var(--font-heading);
  font-size: 2rem;
  letter-spacing: 0.06em;
  color: var(--toasted-tapioca);
}

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.detail-grid dt {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 4px;
}
.detail-grid dd { margin: 0 0 4px; font-size: 0.98rem; }

/* ── HEADER CART BADGE ───────────────────────────── */
.cart-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: var(--toasted-tapioca);
  font-size: 1.05rem;
  transition: background 0.18s;
  flex-shrink: 0;
}
.cart-link:hover { background: var(--vanilla-cream); }
.cart-count {
  position: absolute;
  top: 1px;
  right: -1px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: var(--pill);
  background: var(--cherry-milk);
  color: var(--misty-cloud);
  font-size: 0.68rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cart-count[hidden] { display: none; }
.nav-order-group { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* The header CTA area now holds the bag as well as whatever button the page
   already had, and the bag has to survive the mobile collapse — a count you
   cannot see is a count you do not trust. */
.nav-cta {
  display: flex;
  align-items: center;
  gap: 10px;
}
@media (max-width: 900px) {
  .nav-cta {
    display: flex;
    padding-left: 0 !important;
    margin-right: 4px;
  }
  .nav-cta .btn { display: none; }
}

.is-busy { opacity: 0.6; pointer-events: none; }
.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;
}

/* ── RESPONSIVE ──────────────────────────────────── */
@media (max-width: 860px) {
  .product-layout { grid-template-columns: 1fr; gap: 24px; }
  .product-figure { min-height: 340px; }
  .product-figure img { max-height: 420px; }
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .order-card { padding: 20px; }
  .field-row { grid-template-columns: 1fr; }
  .segmented { grid-template-columns: 1fr; }
  .cart-line { grid-template-columns: 56px 1fr; }
  .cart-thumb { width: 56px; height: 78px; }
  .cart-line-right { grid-column: 1 / -1; justify-items: start; text-align: left; }
}
