/* ═══════════════════════════════════════════════════════════════════
   EAT — shared components: glass cards, buttons, sheets, toasts
   ═══════════════════════════════════════════════════════════════════ */

/* ── Glass card ───────────────────────────────────────────────── */
.glass-card {
  background: var(--glass-fill);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
}

/* ── Buttons ──────────────────────────────────────────────────── */
.btn-gold {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px;
  background: var(--primary);
  color: var(--on-primary);
  border-radius: var(--radius-lg);
  font: var(--text-label-caps);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  transition: all 0.3s ease;
}
.btn-gold:hover:not(:disabled) {
  background: var(--primary-fixed);
  box-shadow: var(--gold-shadow);
}
.btn-gold:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-outline-gold {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--primary);
  color: var(--primary);
  border-radius: var(--radius-md);
  font: var(--text-label-caps);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  transition: all 0.3s ease;
  background: transparent;
}
.btn-outline-gold:hover {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: var(--gold-shadow);
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--on-surface-variant);
  transition: color 0.3s ease;
  position: relative;
}
.icon-btn:hover { color: var(--primary); }
.icon-btn .presence-dot {
  position: absolute;
  top: -2px; right: -2px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #22c55e;
  border: 1px solid var(--surface);
}

/* ── Segmented view toggle (ARIA CHAT / BROWSE MENU) ─────────── */
.seg-toggle {
  display: flex;
  padding: 4px;
  background: rgba(42, 42, 41, 0.4);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
.seg-toggle button {
  flex: 1;
  padding: 8px 24px;
  border-radius: var(--radius-pill);
  font: var(--text-label-caps);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--on-surface-variant);
  white-space: nowrap;
  transition: all 0.3s ease;
}
.seg-toggle button:hover { color: var(--on-surface); }
.seg-toggle button.active {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 2px 15px rgba(212, 175, 55, 0.3);
}

/* ── Bottom sheets ────────────────────────────────────────────── */
.sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: visibility 0s linear 0.5s;
  visibility: hidden;
}
.sheet-overlay.open { visibility: visible; transition-delay: 0s; }

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.sheet-overlay.open .sheet-backdrop { opacity: 1; }

.sheet-panel {
  position: relative;
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  background: var(--surface-container);
  border-top: 1px solid var(--glass-border);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-height: 85dvh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.5s var(--ease-lux);
}
.sheet-overlay.open .sheet-panel { transform: translateY(0); }

.sheet-handle {
  width: 48px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-bright);
  margin: -8px auto 0;
  flex-shrink: 0;
}

.sheet-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--surface-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--on-surface-variant);
  transition: color 0.3s ease;
}
.sheet-close:hover { color: var(--on-surface); }
.sheet-close .material-symbols-outlined { font-size: 16px; }

.sheet-divider { height: 1px; width: 100%; background: rgba(28, 27, 27, 0.9); border-bottom: 1px solid rgba(229, 226, 225, 0.08); }

/* ── Quantity stepper ─────────────────────────────────────────── */
.qty-stepper {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-dim);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  padding: 4px;
}
.qty-stepper button {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--on-surface-variant);
  transition: color 0.3s ease;
}
.qty-stepper button:hover { color: var(--primary); }
.qty-stepper .qty-value {
  font: var(--text-stats);
  font-size: 18px;
  min-width: 20px;
  text-align: center;
}

/* ── Underline input ──────────────────────────────────────────── */
.input-underline {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--outline-variant);
  padding: 12px 0;
  color: var(--on-surface);
  outline: none;
  transition: border-color 0.3s ease;
}
.input-underline::placeholder { color: var(--surface-bright); }
.input-underline:focus { border-bottom-color: var(--primary); }

/* ── Choice chips (cooking preference) ────────────────────────── */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 16px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-pill);
  font-size: 13px;
  color: var(--on-surface-variant);
  transition: all 0.3s ease;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

/* ── Toast ────────────────────────────────────────────────────── */
#toast-root {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: max-content;
  max-width: calc(100vw - 40px);
}
.toast {
  background: var(--surface-container);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: var(--radius-pill);
  padding: 10px 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  font: var(--text-label-caps);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--primary);
  opacity: 0;
  transform: translateY(-8px);
  transition: all 0.3s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.toast-error { color: var(--error); border-color: rgba(255, 180, 171, 0.4); }

/* ── Skeleton shimmer ─────────────────────────────────────────── */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--surface-container-low);
  border-radius: var(--radius-lg);
}
.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.04), transparent);
  animation: shimmer 1.2s infinite;
}
@keyframes shimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}

/* ── Typing dots (Aria) ───────────────────────────────────────── */
.typing-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--primary);
  animation: typing-bounce 1.2s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30%           { transform: translateY(-4px); opacity: 1; }
}

/* ── Pulsing status dot ───────────────────────────────────────── */
.pulse-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 10px rgba(242, 202, 80, 0.8);
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

/* ── Aria hand-off (cap reached) ──────────────────────────────────
   Shown when a spend cap trips. Styled as a calm hand-off to a human,
   deliberately using the normal gold palette — no red, no warning
   iconography — so a diner never reads it as an error. */
.aria-handoff {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 4px 2px;
}
.aria-handoff-btn { flex: 0 0 auto; min-width: 170px; }
.aria-handoff-link {
  font: var(--text-label-caps);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--on-surface-variant);
  border-bottom: 1px solid rgba(212, 175, 55, 0.35);
  padding-bottom: 2px;
}
.aria-handoff-link:hover { color: var(--primary); }
.aria-input-box.is-handed-off {
  opacity: 0.55;
  pointer-events: none;
}
