/* ==========================================================================
   Theme: 🍔 麥當勞 Kiosk (BYT - Build Your Own Burger)
   ========================================================================== */

body.theme-mcd {
  --mcd-red: #da291c;
  --mcd-gold: #ffbc0d;
  --mcd-gold-dark: #e5a700;
  --mcd-dark: #1e1e24;
  --mcd-dark-card: #282830;
  --mcd-dark-card-hover: #32323c;
  --mcd-text-light: #f4f4f5;
  --mcd-text-muted: #a1a1aa;
  --mcd-border: #3f3f46;
  background-color: #121215;
  background-image: radial-gradient(#27272a 1px, transparent 1px);
  background-size: 24px 24px;
  font-family: -apple-system, BlinkMacSystemFont, "Speedee", "Noto Sans HK", sans-serif;
  padding-bottom: 140px; /* space for the sticky floating tray */
}

/* FIX CONTRAST-1: the near-white text colour used to sit on `body`, so it was
   inherited by every LIGHT core component that doesn't set its own colour —
   the whole tracking screen (.track-card / .track-panel / .ramen-ticket /
   .track-status-banner), the confirmation modal (.sushiro-*), .guest-info-section,
   .modal-card, .nav-tabs — giving white text on a white background. The light
   text now applies only to the regions this theme actually paints dark. */
body.theme-mcd .app-header,
body.theme-mcd #guest-view.ramen-sheet {
  color: var(--mcd-text-light);
}

body.theme-mcd .app-header {
  background: #18181b;
  border-bottom: 3px solid var(--mcd-gold);
}

body.theme-mcd .brand-icon {
  background: var(--mcd-red);
  color: var(--mcd-gold);
  border-radius: 8px;
  font-weight: 900;
  box-shadow: 0 0 12px rgba(218, 41, 28, 0.4);
}

body.theme-mcd .brand-title {
  color: var(--mcd-gold);
  font-weight: 900;
  letter-spacing: 0.05em;
}

body.theme-mcd .brand-subtitle {
  color: #d4d4d8;
}

/* FIX SWITCH-2: this theme repaints `.app-header` near-black, so the core
   dark-on-light store pills would vanish into it. Light-on-dark variant here,
   with a gold active pill to match the kiosk. */
body.theme-mcd .store-switcher-pills {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

body.theme-mcd .store-switch-btn {
  color: rgba(255, 255, 255, 0.82);
}

body.theme-mcd .store-switch-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
}

body.theme-mcd .store-switch-btn.active {
  background: var(--mcd-gold);
  color: #18181b;
}

/* Kiosk Layout */
.mcd-kiosk-container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Kiosk Hero Banner */
.mcd-hero-banner {
  background: linear-gradient(135deg, #da291c 0%, #9e1b12 100%);
  border-radius: 16px;
  padding: 22px 24px;
  margin-bottom: 24px;
  box-shadow: 0 8px 24px rgba(218, 41, 28, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 2px solid rgba(255, 188, 13, 0.4);
}

.mcd-hero-title {
  font-size: 1.45rem;
  font-weight: 900;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.mcd-hero-tag {
  background: var(--mcd-gold);
  color: #000;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}

.mcd-hero-subtitle {
  color: #ffedd5;
  font-size: 0.85rem;
  margin-top: 4px;
}

/* Step Bar */
.mcd-steps-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 24px;
  scrollbar-width: thin;
}

.mcd-step-chip {
  background: #27272a;
  color: #a1a1aa;
  border: 1px solid #3f3f46;
  border-radius: 30px;
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mcd-step-chip.active {
  background: var(--mcd-gold);
  color: #18181b;
  border-color: var(--mcd-gold);
  box-shadow: 0 0 14px rgba(255, 188, 13, 0.4);
}

.mcd-step-chip.completed {
  background: #3f3f46;
  color: #e4e4e7;
}

/* Step Section Card */
.mcd-step-section {
  background: #212127;
  border-radius: 16px;
  border: 1.5px solid #33333d;
  padding: 22px;
  margin-bottom: 24px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}

.mcd-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  border-bottom: 1px solid #32323c;
  padding-bottom: 12px;
}

.mcd-section-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--mcd-gold);
  display: flex;
  align-items: center;
  gap: 8px;
}

.mcd-section-note {
  font-size: 0.78rem;
  color: var(--mcd-text-muted);
}

/* Big Grid Cards for Kiosk Touch Selection */
.mcd-grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.mcd-touch-card {
  background: var(--mcd-dark-card);
  border: 2px solid var(--mcd-border);
  border-radius: 12px;
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100px;
}

.mcd-touch-card:hover:not(:disabled) {
  background: var(--mcd-dark-card-hover);
  border-color: #71717a;
  transform: translateY(-2px);
}

.mcd-touch-card.selected {
  background: #2d2613;
  border-color: var(--mcd-gold);
  box-shadow: 0 0 16px rgba(255, 188, 13, 0.35);
  transform: scale(1.02);
}

.mcd-touch-card.selected::after {
  content: '✓';
  position: absolute;
  top: 6px;
  right: 8px;
  background: var(--mcd-gold);
  color: #18181b;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mcd-card-icon {
  font-size: 2rem;
  margin-bottom: 6px;
}

.mcd-card-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
}

.mcd-card-desc {
  font-size: 0.72rem;
  color: var(--mcd-text-muted);
  margin-top: 4px;
  line-height: 1.25;
}

/* Floating Kiosk Order Tray (Bottom Sticky) */
.mcd-floating-tray {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #18181bee;
  backdrop-filter: blur(12px);
  border-top: 2px solid var(--mcd-gold);
  padding: 14px 20px;
  z-index: 999;
  box-shadow: 0 -8px 25px rgba(0,0,0,0.6);
}

.mcd-tray-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.mcd-tray-summary {
  flex: 1;
  min-width: 0;
}

.mcd-tray-heading {
  font-size: 0.82rem;
  color: var(--mcd-gold);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mcd-tray-burger-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.mcd-tray-subtext {
  font-size: 0.76rem;
  color: var(--mcd-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mcd-submit-btn {
  background: linear-gradient(135deg, var(--mcd-red) 0%, #b91c1c 100%);
  color: #ffffff;
  border: 2px solid #ef4444;
  border-radius: 12px;
  padding: 14px 24px;
  font-size: 1.05rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(218, 41, 28, 0.5);
  transition: all 0.15s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mcd-submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(218, 41, 28, 0.7);
  background: #ef4444;
}

.mcd-submit-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ============================================================================
   Multi-store patch: kiosk cards are real <button>s now (keyboard + a11y),
   the sticky tray no longer covers the last section, and the ramen paper sheet
   stops showing through in 麥當勞 mode.
   ========================================================================== */

/* Buttons need their UA styling neutralised to keep the card look. */
.mcd-touch-card,
.mcd-step-chip,
.mcd-step-nav-btn {
  font: inherit;
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

.mcd-touch-card {
  width: 100%;
  color: inherit;
}

.mcd-card-icon,
.mcd-card-title,
.mcd-card-desc {
  display: block;
}

.mcd-step-chip.done {
  background: #3f3f46;
  color: #e4e4e7;
}

.mcd-touch-card:focus-visible,
.mcd-step-chip:focus-visible,
.mcd-step-nav-btn:focus-visible,
.mcd-submit-btn:focus-visible {
  outline: 3px solid var(--mcd-gold, #ffbc0d);
  outline-offset: 2px;
}

/* Step Prev / Next */
.mcd-step-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

.mcd-step-nav-btn {
  background: #2a2a31;
  color: #e4e4e7;
  border: 1px solid #3f3f46;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}

.mcd-step-nav-btn:hover {
  background: #35353d;
  border-color: #52525b;
}

.mcd-step-nav-btn.mcd-step-nav-next {
  background: var(--mcd-gold, #ffbc0d);
  border-color: var(--mcd-gold, #ffbc0d);
  color: #18181b;
}

.mcd-remarks {
  width: 100%;
  background: #282830;
  color: #fff;
  border: 1px solid #3f3f46;
  border-radius: 8px;
  padding: 10px;
  resize: vertical;
}

/* The tray is position:fixed; `body.theme-mcd` reserves the scroll room above
   (padding-bottom), so the container must NOT add its own or the kiosk ends in
   ~270px of dead space. */
@media (max-width: 600px) {
  body.theme-mcd { padding-bottom: 170px; }
}

/* Drop the Japanese paper-sheet chrome behind the kiosk. */
body.theme-mcd #guest-view.ramen-sheet {
  background: #141418;
  border-color: #2a2a33;
  box-shadow: none;
}

body.theme-mcd #guest-view .sheet-banner {
  background: linear-gradient(135deg, #da291c 0%, #9e1b12 100%);
  border-color: #7f1a12;
}

/* `.sheet-title h1` carries its own dark `color: var(--text)`, so recolouring
   only the banner left near-black text on the red banner. */
body.theme-mcd #guest-view .sheet-title h1 {
  color: #ffffff;
}

body.theme-mcd #guest-view .sheet-subtitle {
  color: rgba(255, 255, 255, 0.88);
}

body.theme-mcd #guest-view .sheet-banner .badge {
  background: var(--mcd-gold, #ffbc0d);
  color: #18181b;
}

/* NOTE: `.sheet-notice` is deliberately NOT recoloured. It is a light-yellow
   chip with its own brown text (#fffbe6 / #8c6b00) — forcing white text onto it
   is what made it unreadable. It reads fine on any theme as-is. */

/* The shared guest-name strip is #fafafa in core CSS — a white band inside the
   dark kiosk. Paint it to match the theme instead of leaving it light. */
body.theme-mcd .guest-info-section {
  background: #1c1c22;
  border-bottom-color: #2f2f38;
  color: var(--mcd-text-light);
}

body.theme-mcd .guest-info-section .input-label {
  color: #e4e4e7;
}

body.theme-mcd .guest-info-section .text-input {
  background: #282830;
  border-color: #3f3f46;
  color: #ffffff;
}

body.theme-mcd .guest-info-section .text-input::placeholder {
  color: #a1a1aa;
}
