/* Extra styles for the order panel and chat states. The base look is in index.html. */
.bubble.typing { opacity: 0.6; }
.bubble.error { background: #f7e1de; color: #6b2a22; }

#order-panel {
  border-top: 1px solid var(--border);
  background: var(--card);
  padding: 8px 16px;
  font-size: 0.9rem;
}
#order-panel[hidden] { display: none; }
#order-panel summary { cursor: pointer; font-weight: 600; color: var(--indigo-deep); display: flex; align-items: center; min-height: 44px; } /* 44px touch target */
#order-body { max-height: 30vh; overflow-y: auto; margin-top: 8px; }
.order-row { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
.order-row span:first-child { overflow-wrap: anywhere; }
.order-row span:last-child { white-space: nowrap; }
.order-note { color: var(--muted); font-size: 0.85rem; }
.order-total { border-top: 2px solid var(--edge); margin-top: 4px; padding-top: 4px; font-weight: 700; }

/* ---- Header action, progress steps, quick replies, focus ---- */
[hidden] { display: none !important; }
header .header-btn {
  margin-left: auto;
  padding: 6px 12px;
  font-size: 0.85rem;
  background: rgba(0, 0, 0, 0.18); /* darker, so white text keeps its contrast on the indigo header */
  border: 1px solid rgba(255, 255, 255, 0.55);
}
header .header-btn:hover:not(:disabled) { background: rgba(0, 0, 0, 0.28); }

.steps {
  list-style: none;
  margin: 0;
  padding: 8px 12px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
}
.steps li {
  flex: 1 0 auto;
  text-align: center;
  white-space: nowrap;
  padding: 3px 8px;
  border-radius: 12px;
  color: #4b4f73; /* muted indigo-slate: 7.4:1 on the page background */
  background: var(--bg);
}
.steps li.done { color: var(--indigo); }
.steps li.done::before { content: "\2713\00a0"; }
.steps li.current { background: linear-gradient(135deg, var(--indigo), var(--violet)); color: #fff; font-weight: 600; }

.tz-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  padding: 6px 12px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  color: #4b4f73;
}
.tz-row label { font-weight: 600; }
.tz-row select {
  flex: 1 1 12rem;
  min-width: 0; /* lets the long zone names shrink instead of widening the page */
  min-height: 44px; /* touch target */
  font: inherit;
  font-size: 1rem; /* 16px: phones do not zoom the page when the control is used */
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 8px;
}
.tz-row select:disabled { opacity: 0.6; }
.tz-row p { flex: 1 0 100%; margin: 0; font-size: 0.75rem; }
.tz-row select:focus-visible { outline: 2px solid var(--indigo-deep); outline-offset: 2px; }

.chips {
  display: flex;
  gap: 8px;
  padding: 8px 12px 0;
  overflow-x: auto;
  background: var(--card);
}
.chips:empty { display: none; }
.chip {
  flex: 0 0 auto;
  min-height: 44px; /* touch target */
  padding: 7px 14px;
  font-size: 0.9rem;
  border-radius: 16px;
  background: #fff;
  color: var(--indigo-deep);
  border: 2px solid var(--edge); /* indigo outline: secondary action */
}
.chip:hover:not(:disabled) { background: var(--cyan); border-color: var(--cyan); color: var(--ink); } /* cyan fill with dark text: 9.9:1 */
.chip-primary { background: var(--indigo); color: #fff; border-color: var(--indigo); }
.chip-primary:hover:not(:disabled) { background: var(--violet); border-color: var(--violet); color: #fff; }
.order-placed { font-weight: 700; color: #2f6b3a; margin-bottom: 4px; }

button:focus-visible, summary:focus-visible { outline: 2px solid var(--indigo-deep); outline-offset: 2px; }
header button:focus-visible { outline-color: #fff; }

@media (max-width: 480px) {
  .steps { padding: 6px 8px; gap: 4px; } /* keeps the 0.75rem size: the row scrolls sideways, so it does not need to shrink */
  .steps li { padding: 3px 6px; }
  #order-body { max-height: 26vh; }
}
@media (prefers-reduced-motion: no-preference) {
  .bubble { animation: pop 0.15s ease-out; }
  @keyframes pop { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
}

/* Link back to the portfolio (the page header is the only place the demo page links out). */
header .back-link {
  margin-left: auto;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  white-space: nowrap;
}
header .back-link + .header-btn { margin-left: 8px; }
/* 44px touch targets for the two header actions (Back to Portfolio, New order), at every width: tablets are touch screens too */
header .back-link, header .header-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; }
header .back-link:hover { background: rgba(0, 0, 0, 0.28); }
header .back-link:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
@media (max-width: 480px) {
  header { flex-wrap: wrap; }
  header .back-link { font-size: 0.8rem; padding: 4px 8px; }
}
