/* ──────────────────────────────────────────────────────────────────────────
   Takeaway widget — extends the restaurant's existing dark/gold identity
   (see ExternalInterfaces/emails.py for the email counterpart of this palette).
   Scoped entirely under .taw-* classes so it never leaks into a host page
   when iframed.
   ────────────────────────────────────────────────────────────────────────── */

.taw-root {
  --ink:        #0d0c0a;
  --panel:      #141210;
  --panel-2:    #1b1814;
  --hairline:   #2e2b26;
  --gold:       #c8a96e;
  --gold-dim:   #8a7147;
  --cream:      #f0e8d8;
  --muted:      #9c9080;
  --success:    #6b8f5e;
  --success-bg: rgba(107, 143, 94, 0.14);
  --error:      #b3503f;
  --error-bg:   rgba(179, 80, 63, 0.14);
  --error-text: #e2a89b;

  --display: 'Cormorant Garamond', Georgia, serif;
  --body:    'Inter', -apple-system, Segoe UI, sans-serif;

  background: var(--ink);
  color: var(--cream);
  font-family: var(--body);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 28px 14px 60px;
  box-sizing: border-box;
}

/* The height we report to a host becomes the height of the frame we live in,
   which is what 100vh below measures. Any margin here is therefore added to
   our own viewport on every cycle: the browser's default 8px top and bottom
   grew the dashboard's ordering box by 16px per frame until it hit the host's
   clamp, pushing everything under it off the page. */
body.taw-root { margin: 0; }

/* Embedded, the frame is already sized to our content, so filling "the
   viewport" would mean filling a box whose height we are the ones deciding.
   Standalone, min-height still paints the page background to the bottom. */
.taw-root.taw-embedded { min-height: 0; }

.taw-root * { box-sizing: border-box; }

.taw-card {
  width: 100%;
  max-width: 480px;
  background: var(--panel);
  border: 1px solid var(--hairline);
  position: relative;
  animation: taw-rise 0.5s ease both;
}

@keyframes taw-rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .taw-card, .taw-step, .taw-row { animation: none !important; transition: none !important; }
}

/* gold top line, matches the email's hairline-gold gradient */
.taw-card::before {
  content: '';
  display: block;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* ── Header / eyebrow / step ornament ─────────────────────────────────── */

.taw-header {
  text-align: center;
  padding: 30px 32px 0;
}

.taw-eyebrow {
  margin: 0 0 18px;
  font-family: var(--body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--gold);
}

.taw-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 0 18px;
  font-size: 9px;
  color: var(--gold-dim);
}

.taw-ornament .filled { color: var(--gold); }

.taw-title {
  margin: 0 0 4px;
  font-family: var(--display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--cream);
}

.taw-sub {
  margin: 0 0 24px;
  font-size: 13px;
  font-style: italic;
  color: var(--muted);
}

/* ── Steps ─────────────────────────────────────────────────────────────── */

.taw-step { padding: 0 32px 28px; }
.taw-step[hidden] { display: none; }

.taw-step-enter {
  animation: taw-slide 0.32s ease both;
}
@keyframes taw-slide {
  from { opacity: 0; transform: translateX(10px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Menu line (the signature element: dot-leader menu typesetting) ─────── */

.taw-menu-list { list-style: none; margin: 0; padding: 0; }

/* Nothing to order — a menu not yet published, or a menu that would not load.
   Says which, because the two need different things from the guest. */
.taw-empty {
  padding: 28px 4px;
  text-align: center;
  font-style: italic;
  line-height: 1.6;
  color: var(--muted, #9c9080);
}

/* ── Language and section bars ──────────────────────────────────────────────
   The two controls that make a long card usable on a phone. The section bar
   sticks: on a card of forty dishes the way back to the headings must not be
   forty dishes up. */

.taw-langbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 4px;
}
.taw-lang {
  background: transparent;
  border: 1px solid var(--hairline);
  color: var(--muted);
  font-family: var(--body);
  font-size: 12px;
  padding: 5px 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.taw-lang:hover { border-color: var(--gold-dim); color: var(--cream); }
.taw-lang.is-on {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(200, 169, 110, 0.07);
}

.taw-sectionbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 10px 0;
  margin-bottom: 4px;
  background: var(--panel);
  border-bottom: 1px solid var(--hairline);
}
.taw-sectionbar::-webkit-scrollbar { display: none; }
/* A button, not a link: it chooses which section is shown rather than
   scrolling to it, so the reset that a bare <button> needs comes with it. */
.taw-sectionbar-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  cursor: pointer;
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  border: 1px solid transparent;
  padding: 5px 11px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.taw-sectionbar-link:hover { color: var(--cream); }
.taw-sectionbar-link.is-here { color: var(--gold); border-color: var(--gold-dim); }

/* How many from this section are already in the order. The one thing a tabbed
   menu takes away is being able to see that you have already chosen a drink;
   this gives it back where the sections are. */
.taw-tab-count {
  min-width: 17px;
  padding: 1px 5px;
  border-radius: 9px;
  background: var(--gold);
  color: var(--ink);
  font-family: var(--body);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0;
  text-align: center;
}

/* ── The basket, kept in front of the customer ──────────────────────────── */

/* Sticky at the foot of the card. With one section on screen at a time
   everything already chosen is out of sight, and that is worse than the long
   list it replaced unless something says what is in the order. */
.taw-basket {
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin-top: 18px;
  padding-top: 2px;
  background: var(--panel);
  border-top: 1px solid var(--hairline);
}
.taw-basket-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0 4px;
}
.taw-basket-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: var(--body);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.taw-basket-toggle:hover { color: var(--cream); }
.taw-basket-count {
  min-width: 22px;
  padding: 2px 7px;
  border-radius: 11px;
  background: var(--gold);
  color: var(--ink);
  font-weight: 600;
  font-size: 12px;
  text-align: center;
}
.taw-basket-chev { transition: transform 0.15s ease; font-size: 10px; }
.taw-basket-toggle.is-open .taw-basket-chev { transform: rotate(180deg); }
.taw-basket-total {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
  color: var(--cream);
}

/* `hidden` has to beat the layout rules.
   The UA stylesheet's `[hidden] { display: none }` loses to any class that
   sets a display, which is why the empty-order button sat under a full basket
   with `hidden` faithfully set on it. This file already spells it out per
   class for the steps, the banners and the identity block; these are the same
   thing for the same reason. */
.taw-basket[hidden],
.taw-basket-lines[hidden],
.taw-actions[hidden],
.taw-section[hidden] { display: none; }

.taw-basket-lines {
  max-height: 42vh;
  overflow-y: auto;
  padding: 10px 0 2px;
  border-bottom: 1px solid var(--hairline);
}
.taw-basket-line {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
}
.taw-basket-line + .taw-basket-line { border-top: 1px solid var(--hairline); }
.taw-basket-line-name { font-size: 13.5px; color: var(--cream); }
.taw-basket-line-sum {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: var(--muted);
  min-width: 4.5em;
  text-align: right;
}

/* ── A heading and the dishes under it ──────────────────────────────────── */

.taw-section { scroll-margin-top: 52px; }   /* clears the sticky bar */
.taw-section-name {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 22px 0 0;
}
.taw-section-note {
  font-family: var(--body);
  font-size: 12px;
  font-style: italic;
  color: var(--muted);
  margin: 5px 0 0;
  line-height: 1.5;
}
.taw-section-list { list-style: none; margin: 6px 0 0; padding: 0; }

.taw-row {
  padding: 14px 4px;
  border-bottom: 1px solid var(--hairline);
  transition: background 0.2s ease;
}
.taw-row:hover { background: rgba(200, 169, 110, 0.05); }

.taw-row-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

/* The description, and what is in it. Under the name rather than beside it:
   the leader-and-price line only works when the name has a line to itself. */
.taw-row-desc {
  font-family: var(--body);
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
  margin: 5px 0 0;
}
.taw-row-marks {
  font-family: var(--body);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--gold-dim);
  margin: 5px 0 0;
}
.taw-row-foot { display: flex; justify-content: flex-end; margin-top: 6px; }

.taw-row-name {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 500;
  color: var(--cream);
}

.taw-row-leader {
  flex: 1;
  border-bottom: 1px dotted var(--gold-dim);
  margin-bottom: 4px;
  min-width: 16px;
}

.taw-row-price {
  font-family: var(--body);
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
}

.taw-stepper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.taw-stepper button {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--gold-dim);
  background: transparent;
  color: var(--gold);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.taw-stepper button:hover { background: rgba(200, 169, 110, 0.12); border-color: var(--gold); }
.taw-stepper button:active { transform: scale(0.94); }
.taw-stepper button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.taw-stepper-qty {
  min-width: 18px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--cream);
}

/* ── Cart review rows (editable list) ─────────────────────────────────── */

.taw-cart-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 4px;
  border-bottom: 1px solid var(--hairline);
}
.taw-cart-row-main { display: flex; flex-direction: column; gap: 2px; }
.taw-cart-row-name { font-family: var(--display); font-size: 16px; color: var(--cream); }
.taw-cart-row-line { font-size: 13px; color: var(--muted); }
.taw-remove {
  background: none; border: none; color: var(--muted);
  font-size: 18px; cursor: pointer; padding: 4px 8px;
}
.taw-remove:hover { color: var(--error-text); }

/* ── Totals ────────────────────────────────────────────────────────────── */

.taw-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 16px;
  margin-top: 4px;
}
.taw-total-label {
  font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted);
}
.taw-total-value {
  font-family: var(--display); font-size: 24px; font-weight: 600; color: var(--cream);
}

/* ── Forms ─────────────────────────────────────────────────────────────── */

.taw-field { margin-bottom: 18px; }

.taw-label {
  display: block;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.taw-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--hairline);
  color: var(--cream);
  font-family: var(--body);
  font-size: 16px;
  padding: 8px 2px;
  transition: border-color 0.2s ease;
}
.taw-input::placeholder { color: #5c564a; }

.taw-field-row {
  display: flex;
  gap: 14px;
}
.taw-field-row .taw-input { flex: 1; }

.taw-hint {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--muted);
}

/* ── Returning-customer identity strip ─────────────────────────────────── */

.taw-identity {
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--gold-dim);
  padding: 12px 14px;
  margin-bottom: 20px;
}
.taw-identity[hidden] { display: none; }

.taw-identity-line {
  margin: 0 0 4px;
  font-size: 13px;
  color: var(--muted);
}

.taw-identity-name {
  color: var(--cream);
  font-weight: 600;
}

/* Link-styled button: keeps it a real <button> for keyboard/AT users. */
.taw-linkbtn {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--body);
  font-size: 12px;
  color: var(--gold);
  text-decoration: underline;
  cursor: pointer;
}
.taw-linkbtn:hover { color: #d6ba85; }
.taw-linkbtn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

#taw-signin-form { margin-top: 12px; }
#taw-signin-form .taw-btn { width: 100%; }

/* ── Pickup day tabs + time slot grid (mirrors the reservation widget) ──── */

.taw-day-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.taw-day-tab {
  flex: 1 1 auto;
  min-width: 96px;
  font-family: var(--body);
  font-size: 12px;
  letter-spacing: 1px;
  padding: 10px 12px;
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.taw-day-tab:hover { border-color: var(--gold-dim); color: var(--cream); }
.taw-day-tab.selected {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(200, 169, 110, 0.08);
}
.taw-day-tab:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.taw-slots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.taw-slot {
  font-family: var(--body);
  font-size: 13px;
  letter-spacing: 1px;
  padding: 10px 0;
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.taw-slot:hover { border-color: var(--gold-dim); color: var(--cream); }
.taw-slot.selected {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(200, 169, 110, 0.08);
}
.taw-slot:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.taw-slots-empty {
  grid-column: 1 / -1;
  font-size: 13px;
  font-style: italic;
  color: var(--muted);
  padding: 4px 0;
}

/* native date-picker icon recolored to sit on the dark field */
.taw-input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.7) sepia(1) saturate(3) hue-rotate(10deg);
  cursor: pointer;
}
.taw-input:focus { outline: none; border-color: var(--gold); }
.taw-input:focus-visible { outline: none; border-color: var(--gold); }

/* ── Banners (errors / hints / success — same shape as the email's wl_banner) ── */

.taw-banner {
  border-left: 3px solid var(--gold);
  background: rgba(200, 169, 110, 0.08);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0 18px;
}
.taw-banner-error {
  border-left-color: var(--error);
  background: var(--error-bg);
  color: var(--error-text);
}
.taw-banner-success {
  border-left-color: var(--success);
  background: var(--success-bg);
  color: var(--cream);
}
.taw-banner[hidden] { display: none; }

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

.taw-actions {
  display: flex;
  gap: 12px;
  margin-top: 22px;
}

.taw-btn {
  flex: 1;
  font-family: var(--body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 14px 18px;
  border: 1px solid var(--gold-dim);
  background: transparent;
  color: var(--cream);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}
.taw-btn:hover { border-color: var(--gold); }
.taw-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.taw-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.taw-btn-primary {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
}
.taw-btn-primary:hover { background: #d6ba85; border-color: #d6ba85; }

/* ── Footer ornament (closing flourish, matches the email) ───────────────── */

.taw-footer-ornament {
  display: flex; align-items: center; gap: 10px;
  padding: 0 32px 28px;
  color: var(--gold-dim);
}
.taw-footer-ornament .line { flex: 1; height: 1px; background: var(--hairline); }
.taw-footer-ornament .dot { font-size: 8px; }

/* ── Payment step ──────────────────────────────────────────────────────── */

#taw-dropin-container { min-height: 160px; }

.taw-stub-actions {
  display: flex; flex-direction: column; gap: 10px;
  border: 1px dashed var(--gold-dim);
  padding: 16px;
}
.taw-stub-label {
  font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--gold);
  margin-bottom: 4px;
}

/* ── Confirmation page ─────────────────────────────────────────────────── */

.taw-confirm-icon {
  width: 48px; height: 48px; margin: 0 auto 18px;
  border: 1px solid var(--gold-dim); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--gold); font-size: 22px;
}

.taw-spinner {
  width: 22px; height: 22px; margin: 0 auto;
  border: 2px solid var(--hairline);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: taw-spin 0.8s linear infinite;
}
@keyframes taw-spin { to { transform: rotate(360deg); } }

.taw-ref {
  font-family: var(--display); font-size: 20px; letter-spacing: 2px; color: var(--cream);
  text-align: center;
}

@media (max-width: 380px) {
  .taw-title { font-size: 22px; }
  .taw-step, .taw-header, .taw-footer-ornament { padding-left: 20px; padding-right: 20px; }
}
