/* ==========================================================================
   Shared by the account, sign-in, wishlist and order tracking pages (functions/living-account.php)
   ========================================================================== */

/* ---- Segmented control: <div class="seg" role="tablist" data-…><button role="tab" aria-selected> ---- */
.seg {
  display: inline-flex;
  gap: var(--space-1);
  max-width: 100%;
  padding: var(--space-1);
  border-radius: var(--radius-pill);
  background: var(--color-sand-100);
}
.seg > * {
  flex: 1;
  height: 40px;
  padding-inline: var(--space-3);
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  color: var(--color-text-muted);
  white-space: nowrap;
  transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}
.seg > :is([aria-selected="true"], [aria-pressed="true"]) { background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow-sm); }
.seg--block { display: flex; width: 100%; }

.seg > a { display: grid; place-items: center; }
.seg > [aria-current] { background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow-sm); }

/* ---- White box ---- */
.box { padding: var(--space-5); border: 1px solid var(--color-line); border-radius: var(--radius-lg); background: var(--color-surface); }
.box__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-5); }
.box__title { font-size: var(--fs-lg); font-weight: var(--fw-bold); }

/* Small text button (forgot password, edit, remove) */
.text-btn { font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--color-accent); text-decoration: underline; text-underline-offset: 4px; transition: color var(--duration-fast) var(--ease-out); }
.text-btn:hover { color: var(--color-text); }
.text-btn--muted { color: var(--color-text-subtle); font-weight: var(--fw-medium); }
.text-btn--muted:hover { color: var(--color-favorite); }

/* Back link: arrow + text (the arrow already points back in RTL) */
.back-link { display: inline-flex; align-items: center; gap: var(--space-2); justify-self: start; font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--color-text-muted); transition: color var(--duration-fast) var(--ease-out); }
.back-link:hover { color: var(--color-accent); }

/* Quiet note under a form or in a panel */
.note { display: flex; align-items: center; gap: var(--space-2); font-size: var(--fs-sm); color: var(--color-text-subtle); }
.note .icon { color: var(--color-green); }
.note--ok { padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); background: var(--color-green-soft); color: var(--color-green); font-weight: var(--fw-bold); }

/* ---- Order status badge: <span class="status status--ship">في الطريق</span> ---- */
.status {
  --status-bg: var(--color-sand-100);
  --status-fg: var(--color-text);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: 28px;
  padding-inline: var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--status-bg);
  color: var(--status-fg);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  white-space: nowrap;
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: var(--radius-pill); background: currentColor; }
.status--ship { --status-bg: var(--color-rust-soft); --status-fg: var(--color-rust); }
.status--done { --status-bg: var(--color-green-soft); --status-fg: var(--color-green); }
.status--cancel { --status-bg: var(--color-red-soft); --status-fg: var(--color-red); }

.note--error { padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); background: var(--color-red-soft); color: var(--color-red); font-weight: var(--fw-bold); }

/* ---- Empty state: <div class="empty"><span class="empty__icon">svg</span><h2>…</h2><p>…</p><div class="empty__actions">…</div></div> ---- */
.empty { display: grid; justify-items: center; gap: var(--space-3); padding: var(--space-11) var(--space-6); text-align: center; }
.empty__icon { display: grid; place-items: center; width: var(--empty-icon); height: var(--empty-icon); margin-bottom: var(--space-2); border-radius: var(--radius-pill); background: var(--color-sand-100); color: var(--color-accent); }
.empty__icon .icon { --icon-size: 36px; }
.empty__title { font-size: var(--fs-xl); font-weight: var(--fw-black); }
.empty p { max-width: 420px; color: var(--color-text-muted); }
.empty__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-3); margin-top: var(--space-3); }

/* ---- Panel: a white rounded surface (the cart-panel look without the sticking) ---- */
.panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);   /* long inputs or rows never push it wider than its column */
  align-content: start;
  gap: var(--space-5);
  padding: var(--space-5);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}
.panel--soft { border-color: transparent; background: var(--color-sand-100); }
.panel__title { font-size: var(--fs-lg); font-weight: var(--fw-bold); }
.panel__text { color: var(--color-text-muted); }

/* ---- Horizontal stepper (same states as .timeline, labels under the dots) ---- */
.stepper { display: grid; grid-template-columns: repeat(var(--steps, 5), 1fr); text-align: center; }
.stepper li {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: var(--space-2);
  padding-inline: 0;
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  color: var(--color-text-subtle);
  line-height: var(--lh-heading);
}
.stepper li::before {
  content: "";
  position: relative;
  z-index: var(--z-raised);
  display: grid;
  place-items: center;
  width: var(--timeline-dot);
  height: var(--timeline-dot);
  border: var(--timeline-line) solid var(--color-line-strong);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-white);
  font-size: var(--fs-xs);
}
.stepper li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: calc(var(--timeline-dot) / 2 - var(--timeline-line) / 2);
  inset-inline-start: 50%;
  width: 100%;
  height: var(--timeline-line);
  background: var(--color-line-strong);
}
.stepper small { font-size: var(--fs-xs); font-weight: var(--fw-regular); }
.stepper .is-done { color: var(--color-text); }
.stepper .is-done::before { content: "✓"; border-color: var(--color-green); background: var(--color-green); }
.stepper li.is-done:not(:last-child)::after { background: var(--color-green); }
.stepper [aria-current] { color: var(--color-rust); }
.stepper [aria-current]::before { border-color: var(--color-rust); background: var(--color-rust); box-shadow: 0 0 0 var(--space-1) var(--color-sand-100); }

/* ---- Order number ---- */
.order-ref { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); font-size: var(--fs-sm); color: var(--color-text-muted); }
.order-ref strong { direction: ltr; font-size: var(--fs-md); font-weight: var(--fw-black); color: var(--color-text); font-variant-numeric: tabular-nums; }

/* ---- Help card: WhatsApp + email in one row ---- */
.help-card { display: grid; grid-template-columns: auto 1fr; gap: var(--space-2) var(--space-4); align-items: center; }
.help-card > .icon { --icon-size: 30px; grid-row: span 2; color: var(--color-accent); }
.help-card strong { font-weight: var(--fw-bold); }
.help-card p { font-size: var(--fs-sm); color: var(--color-text-muted); }
.help-card__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); grid-column: 1 / -1; margin-top: var(--space-2); }
.help-card__actions .btn { flex: 1; height: var(--control-height); padding-inline: var(--space-5); font-size: var(--fs-sm); white-space: nowrap; }

/* ---- Room before the footer ---- */
main > :is(.auth-page, .dash1, .wl-page, .trk) { padding-bottom: var(--space-section); }

/* ---- One order ---- */
.trk-eta { font: var(--fw-black) var(--fs-2xl) / var(--lh-heading) var(--font-family); }
.trk-address { display: grid; gap: var(--space-1); color: var(--color-text-muted); font-style: normal; }
.trk-address strong { color: var(--color-text); }
.trk-address bdi { justify-self: start; }
.trk-side { display: grid; gap: var(--space-5); align-content: start; }
.trk1-result { container-type: inline-size; min-width: 0; }   /* narrower inside the account than on the tracking page */
.trk1-head { display: flex; align-items: end; justify-content: space-between; gap: var(--space-5); flex-wrap: wrap; }
.trk1-head .trk-eta { margin-top: var(--space-2); }
.trk1-stepper { margin-block: var(--space-6); padding: var(--space-5) var(--space-1); border-radius: var(--radius-lg); background: var(--color-surface); border: 1px solid var(--color-line); }
.trk1-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: var(--space-6); align-items: start; margin-top: var(--space-6); }
@container (max-width: 1000px) {
  .trk1-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 639.98px) {
  .stepper small { display: none; }
  .box.empty { padding: var(--space-5); }   /* an empty box keeps the box's padding on phones */
}

@media (min-width: 640px) {
  .box { padding: var(--space-6); }
  .empty { padding: var(--space-11) var(--space-6); }   /* after .box: an empty box gets the roomier padding */
  .seg > * { padding-inline: var(--space-5); }
  .panel { padding: var(--space-8); border-radius: var(--radius-lg); }
  .stepper li { padding-inline: var(--space-1); font-size: var(--fs-sm); }
  .trk1-stepper { margin-block: var(--space-10); padding: var(--space-8) var(--space-6); }
}
