/* css-shared-service-buttons-service-widget.css — styles that only matter when one of these sections is on the page:
 * service-buttons, service-widget.
 * Linked from each of them (see the first line of the section file); theme.css
 * holds the common styles. */

/* ---- Home: how would you like your order? -----------------------------------
 * The PLUS app's first screen as a row of large buttons — Delivery, Pick up,
 * Dine in, Table reservation (sections/service-buttons). An icon tile, the
 * name, one line of what it means, a chevron; the current service in the
 * accent. One column on a phone, as PLUS stacks them. */
/* The bottom padding clears the footer: its logo plaque is pulled up 2.75rem over
 * whatever precedes it, which on a home page ending in these buttons sat on the
 * last one. */
.svc-home { padding-block: clamp(1.5rem, 4vw, 2.5rem) clamp(4.25rem, 8vw, 5.25rem); }

.svc-home__title {
  margin: 0 0 1rem;
  text-align: center;
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
}

.svc-home__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
  gap: 0.75rem;
  max-width: 60rem;
  margin-inline: auto;
}

.svc-home__form { display: contents; }

.svc-home__btn {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  min-height: 4.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s var(--ease, ease), box-shadow 0.15s var(--ease, ease);
}

.svc-home__btn:hover { color: var(--ink); border-color: var(--accent); box-shadow: 0 10px 24px -16px color-mix(in srgb, var(--accent) 65%, transparent); }

.svc-home__btn.is-active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

.svc-home__icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--accent);
}

.svc-home__btn.is-active .svc-home__icon { background: var(--accent); color: var(--accent-contrast, #fff); }

/* A merchant-uploaded icon image (snippets/service-icon) sits in the same tile as a glyph. */
.svc-home__img { display: block; width: 1.75rem; height: 1.75rem; object-fit: contain; border-radius: 6px; }

.delivery-modal__mark .svc-home__img { width: 1rem; height: 1rem; border-radius: 3px; }

.svc-home__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }

.svc-home__text strong { font-family: var(--font-display); font-size: 1rem; font-weight: 700; }

.svc-home__text small { font-size: 0.8rem; color: var(--muted); }

.svc-home__btn.is-active .svc-home__text small { color: var(--accent-ink); font-weight: 600; }

.svc-home__btn > svg:last-child { flex: none; color: var(--muted); }

[dir="rtl"] .svc-home__btn > svg:last-child { transform: scaleX(-1); }

.svc-home__dinein p { margin: 0; line-height: 1.6; color: var(--ink-soft, var(--ink)); }

/* ---- Home: order status (PLUS's "Following order") ----------------------------
 * First in the service buttons, full width, while there is an order to follow
 * (theme.js sets data-state). Each state has its own glyph and motion, as the
 * PLUS app's: waiting — three dots; preparing — steam over the dish; out for
 * delivery — the truck bumping with wind streaming past; ready / delivered —
 * a tick that pops in; cancelled — a red cross. The tile pulses while the
 * order is in progress. None of the motion where less is asked for. */
.svc-home__track { grid-column: 1 / -1; border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }

.svc-home__track[hidden] { display: none; }

.svc-track__icon { position: relative; overflow: visible; }

.svc-track__glyph { position: relative; display: none; align-items: center; justify-content: center; }

.svc-home__track[data-state="waiting"] .svc-track__glyph--waiting,
.svc-home__track[data-state="preparing"] .svc-track__glyph--preparing,
.svc-home__track[data-state="delivery"] .svc-track__glyph--delivery,
.svc-home__track[data-state="ready"] .svc-track__glyph--ready,
.svc-home__track[data-state="done"] .svc-track__glyph--ready,
.svc-home__track[data-state="cancelled"] .svc-track__glyph--cancelled { display: inline-flex; }

/* Waiting: three dots, one after another. */
.svc-track__glyph--waiting { gap: 3px; }

.svc-track__glyph--waiting i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: trk-dot 1.2s infinite ease-in-out; }

.svc-track__glyph--waiting i:nth-child(2) { animation-delay: 0.15s; }

.svc-track__glyph--waiting i:nth-child(3) { animation-delay: 0.3s; }

/* Preparing: steam rising over the dish. */
.svc-track__steam { position: absolute; top: -9px; left: 50%; display: flex; gap: 3px; transform: translateX(-50%); }

.svc-track__steam i { width: 2px; height: 7px; border-radius: 2px; background: currentColor; opacity: 0; animation: trk-steam 1.6s infinite ease-out; }

.svc-track__steam i:nth-child(2) { animation-delay: 0.35s; }

.svc-track__steam i:nth-child(3) { animation-delay: 0.7s; }

/* Out for delivery: the truck bumps along, wind streaming past behind it. */
.svc-track__glyph--delivery svg { animation: trk-bump 0.45s infinite alternate ease-in-out; }

.svc-track__wind { position: absolute; top: 50%; inset-inline-start: -11px; display: grid; gap: 3px; transform: translateY(-50%); }

.svc-track__wind i { display: block; width: 8px; height: 2px; border-radius: 2px; background: currentColor; animation: trk-wind 0.8s infinite linear; }

.svc-track__wind i:nth-child(2) { width: 6px; animation-delay: 0.25s; }

.svc-track__wind i:nth-child(3) { animation-delay: 0.5s; }

[dir="rtl"] .svc-track__glyph--delivery { transform: scaleX(-1); }

/* Ready / delivered: the tick pops in, the tile goes solid. */
.svc-track__glyph--ready svg { animation: trk-pop 0.5s cubic-bezier(0.3, 1.6, 0.5, 1) both; }

.svc-home__track:is([data-state="ready"], [data-state="done"]) .svc-track__icon { background: var(--accent); color: var(--accent-contrast, #fff); }

.svc-home__track:is([data-state="ready"], [data-state="done"]) .svc-home__text small { color: var(--accent-ink); font-weight: 600; }

/* Cancelled: in the danger colour. */
.svc-home__track[data-state="cancelled"] { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }

.svc-home__track[data-state="cancelled"] .svc-track__icon { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--danger); }

.svc-home__track[data-state="cancelled"] .svc-home__text small { color: var(--danger); font-weight: 600; }

/* In progress: the tile breathes. */
.svc-home__track:is([data-state="waiting"], [data-state="preparing"], [data-state="delivery"]) .svc-track__icon { animation: trk-ring 2s infinite; }

.svc-home__track:is([data-state="waiting"], [data-state="preparing"], [data-state="delivery"]) .svc-home__text small { color: var(--accent-ink); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  .svc-home__track *, .svc-home__track .svc-track__icon { animation: none !important; }
  .svc-track__steam, .svc-track__wind { display: none; }
}
