/* Developer: Shahid Malla (https://shahidmalla.com) · Owner: ElySpace — client-area app shell (account.css) */ /* ac:ready */
/* ==========================================================================
   account.css — the client area, app-style (account pages, track-order,
   checkout, order confirmation and the sign-in pages).

   Loaded ONLY on those pages, through {{> account-head}} inside each page's
   {{#> head}} block, so it comes after layout.css and wins at equal
   specificity. That is also why the few global rules below are safe here.

   Tokens only (tokens.css + theme-vars). Dark mode comes from the tokens.
   Logical properties throughout; safe-area padding is physical on purpose.

   §1 Chrome · §2 Layout · §3 Components · §4 RTL, motion, print
   ========================================================================== */

:root {
  --ac-max: 1040px;
  --ac-side: 232px;
  --ac-gap: var(--sp-8);
  --ac-bar: 56px;
  /* mask for the search field's leading glyph — only the alpha channel is read (same pattern as components.css --i-*) */
  --ac-i-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='10.8' cy='10.8' r='6.8'/%3E%3Cpath d='m15.7 15.7 4.9 4.9'/%3E%3C/svg%3E");
}


/* ==========================================================================
   §1 CHROME
   ========================================================================== */

/* the app bar replaces the signed-in header on phones and tablets */
@media (max-width: 1023.98px) {
  body.ac-app .hac-header { display: none; }
}

html:has(body.ac-app),
html:has(body.co-app) {
  scroll-padding-top: calc(var(--ac-bar) + var(--safe-t) + var(--sp-3));
}

/* 16px or more stops iOS zooming into a field on focus */
.input,
.select,
.textarea { font-size: max(16px, var(--fs-md)); }

/* the signed-in header (shown from 1024px, and on pages without the app bar): 44px targets */
.hac-header .hac-burger { min-inline-size: var(--control-md); }
.hac-brand { min-block-size: var(--control-md); }

/* the slim footer: every link a 44px target */
.fac-links a,
.fac-copy a {
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
}
.fac-links a { min-inline-size: 44px; justify-content: center; }
/* store-live.js adds the High contrast button next to Privacy (inline styles set its padding and font): match the other links */
.fac-links [data-contrast-toggle] { display: inline-flex; align-items: center; min-block-size: 44px; min-inline-size: 44px; padding: 0 !important; border: 0; background: none; color: var(--ink-3); font: inherit; font-size: var(--fs-2xs) !important; text-decoration: none !important; cursor: pointer; }
.fac-links [data-contrast-toggle]:hover { color: var(--ink); text-decoration: underline !important; }
/* the credit stays in one piece: "Developed by Shahid Malla · ElySpace." never splits at the dot */
.fac-credit { white-space: nowrap; }
body.ac-app .fac-footer,
body.co-app .fac-footer { margin-block-start: var(--sp-8); }
body.ac-app .fac-inner,
body.co-app .fac-inner { padding-block: var(--sp-3); row-gap: 0; }
body.ac-app .fac-links,
body.co-app .fac-links { column-gap: var(--sp-3); }
@media (max-width: 1023.98px) {
  /* no back-to-top button under 1024px, so the links need no room kept clear for it */
  body.ac-app .fac-links,
  body.co-app .fac-links { margin-inline-start: 0; padding-inline-end: 0; }
}

/* ---- app bar ------------------------------------------------------------ */
.ac-appbar {
  position: sticky;
  inset-block-start: 0;
  z-index: var(--z-header);
  padding-top: var(--safe-t);
  background: color-mix(in oklab, var(--bg) 90%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-block-end: 1px solid var(--line);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .ac-appbar { background: var(--bg); }
}
.ac-appbar__inner {
  display: grid;
  grid-template-columns: 1fr minmax(0, auto) 1fr;
  align-items: center;
  min-block-size: var(--ac-bar);
  padding-inline: max(var(--sp-1), var(--safe-l)) max(var(--sp-1), var(--safe-r));
}
.ac-appbar__start,
.ac-appbar__end {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  min-inline-size: 0;
}
.ac-appbar__start { justify-self: start; }
.ac-appbar__end { justify-self: end; }
.ac-appbar__title {
  margin: 0;
  min-inline-size: 0;
  text-align: center;
  color: var(--ink);
  font: var(--fw-semibold) var(--fs-md) / 1.25 var(--font-sans);
  letter-spacing: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ac-appbar__btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  inline-size: var(--control-md);
  block-size: var(--control-md);
  padding: 0;
  border: 0;
  border-radius: var(--r-full);
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-2) var(--ease);
}
.ac-appbar__btn:hover { background: var(--surface-2); }
.ac-appbar__btn[aria-expanded="true"] { background: var(--surface-2); }
.ac-appbar__back-label { display: none; }
.ac-appbar__text {
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
  padding-inline: var(--sp-3);
  border: 0;
  border-radius: var(--r-full);
  background: none;
  color: var(--brand-text);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur-2) var(--ease);
}
.ac-appbar__text:hover { background: var(--surface-2); }
.ac-appbar__btn:focus-visible,
.ac-appbar__text:focus-visible {
  outline: var(--ring-w) solid var(--focus-ink);
  outline-offset: 2px;
}

@media (min-width: 1024px) {
  .ac-appbar {
    position: static;
    padding-top: 0;
    background: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border-block-end: 0;
  }
  .ac-appbar__inner {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    max-inline-size: var(--ac-max);
    margin-inline: auto;
    padding: var(--sp-6) var(--container-pad) 0;
  }
  .ac-appbar:not(.ac-appbar--solo) .ac-appbar__inner {
    padding-inline-start: calc(var(--container-pad) + var(--ac-side) + var(--ac-gap));
  }
  .ac-appbar--solo .ac-appbar__inner { max-inline-size: calc(640px + 2 * var(--container-pad)); }
  .ac-appbar__title {
    text-align: start;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: var(--fs-3xl);
    line-height: var(--lh-snug);
  }
  .ac-appbar__end { margin-inline-start: auto; }
  /* back: a bordered 44px circle plus its label */
  .ac-appbar__back {
    inline-size: auto;
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    padding-inline-end: var(--sp-3);
    color: var(--ink-2);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
  }
  .ac-appbar__back .icon {
    box-sizing: content-box;
    padding: 9px;
    border: 1px solid var(--line-2);
    border-radius: var(--r-full);
    color: var(--ink);
  }
  .ac-appbar__back:hover { background: none; color: var(--ink); }
  .ac-appbar__back:hover .icon { background: var(--surface-2); }
  .ac-appbar__back-label { display: inline; }
  /* the header carries the bag from 1024px: one bag icon on screen, not two */
  .ac-appbar__btn[data-drawer-open="cart"] { display: none; }
}

/* ---- checkout / sign-in bar --------------------------------------------- */
.co-header {
  position: sticky;
  inset-block-start: 0;
  z-index: var(--z-header);
  padding-top: var(--safe-t);
  background: var(--bg);
  border-block-end: 1px solid var(--line);
}
.co-header__bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--sp-2);
  min-block-size: var(--ac-bar);
  max-inline-size: var(--container);
  margin-inline: auto;
  padding-inline: max(var(--container-pad), var(--safe-l)) max(var(--container-pad), var(--safe-r));
}
.co-header__bar > :first-child { justify-self: start; }
.co-header__bar > :last-child { justify-self: end; }
.co-header__back {
  display: inline-grid;
  place-items: center;
  inline-size: var(--control-md);
  block-size: var(--control-md);
  margin-inline-start: calc(var(--sp-2) * -1);
  border-radius: var(--r-full);
  color: var(--ink);
  text-decoration: none;
  transition: background-color var(--dur-2) var(--ease);
}
.co-header__back:hover { background: var(--surface-2); }
.co-header__brand {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--control-md);
  text-decoration: none;
}
.co-header__logo {
  inline-size: auto;
  block-size: 28px;
  max-inline-size: 100%;
  object-fit: contain;
}
.co-header__secure {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  color: var(--ink-2);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  white-space: nowrap;
}
.co-header__back:focus-visible,
.co-header__brand:focus-visible {
  outline: var(--ring-w) solid var(--focus-ink);
  outline-offset: 2px;
}


/* ==========================================================================
   §2 LAYOUT
   ========================================================================== */

.ac-wrap {
  display: grid;
  gap: var(--sp-6);
  padding: var(--sp-4) max(var(--container-pad), var(--safe-r)) var(--sp-8) max(var(--container-pad), var(--safe-l));
}
.ac-wrap > * { min-inline-size: 0; }
@media (min-width: 768px) and (max-width: 1023.98px) {
  /* tablets: one comfortable column, not a stretched phone */
  .ac-wrap { max-inline-size: calc(720px + 2 * var(--container-pad)); margin-inline: auto; }
}
@media (min-width: 1024px) {
  .ac-wrap {
    max-inline-size: var(--ac-max);
    margin-inline: auto;
    grid-template-columns: var(--ac-side) minmax(0, 1fr);
    gap: var(--ac-gap);
    align-items: start;
    padding-block: var(--sp-6) var(--sp-16);
  }
  .ac-wrap--solo {
    max-inline-size: calc(640px + 2 * var(--container-pad));
    grid-template-columns: minmax(0, 640px);
    justify-content: center;
  }
}

.ac-content {
  display: grid;
  gap: var(--sp-6);
  align-content: start;
  min-inline-size: 0;
}

.ac-menu {
  display: grid;
  gap: var(--sp-3);
  align-content: start;
}
.ac-menu--side { display: none; }
@media (min-width: 1024px) {
  .ac-menu--side {
    display: grid;
    position: sticky;
    top: calc(64px + var(--sp-6));
  }
  .ac-menu--side .ac-row { gap: var(--sp-2); min-block-size: 48px; padding: var(--sp-1) var(--sp-3); }
  .ac-menu--side .ac-row__icon { inline-size: 32px; block-size: 32px; }
  .ac-menu--side .ac-row__label { font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ac-menu--side .ac-row__value { font-size: var(--fs-xs); }
  .ac-menu--side .ac-row__chev { display: none; }
  .ac-menu--list { display: none; }
}

.ac-section { display: grid; gap: var(--sp-2); }
.ac-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}
.ac-label {
  margin: 0;
  padding-inline: var(--sp-1);
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  letter-spacing: normal;
}
legend.ac-label { margin-block-end: var(--sp-2); }

/* a plain text action next to a label ("See all"), 44px */
.ac-link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  min-block-size: 44px;
  min-inline-size: 44px;
  padding-inline: var(--sp-1);
  color: var(--brand-text);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  text-decoration: none;
}
.ac-link:hover { text-decoration: underline; }

.ac-form { display: grid; gap: var(--sp-4); }


/* ==========================================================================
   §3 COMPONENTS
   ========================================================================== */

/* ---- grouped list and its rows ------------------------------------------ */
.ac-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.ac-list > li { margin: 0; }
.ac-list > li + li { border-block-start: 1px solid var(--line); }
.ac-list--quiet { border-color: transparent; }

.ac-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  inline-size: 100%;
  min-block-size: 56px;
  margin: 0;
  padding: var(--sp-2) var(--sp-4);
  color: var(--ink);
  background: none;
  border: 0;
  border-radius: 0;
  font: inherit;
  text-align: start;
  text-decoration: none;
  cursor: default;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}
a.ac-row,
button.ac-row,
label.ac-row,
summary.ac-row {
  cursor: pointer;
  transition: background-color var(--dur-2) var(--ease);
}
a.ac-row:hover,
button.ac-row:hover,
label.ac-row:hover,
summary.ac-row:hover { background: var(--surface-2); }
.ac-row:focus-visible {
  outline: var(--ring-w) solid var(--focus-ink);
  outline-offset: -3px;
}
.ac-row[aria-current="page"] { background: var(--surface-2); }
.ac-row[aria-current="page"] .ac-row__label { font-weight: var(--fw-semibold); }
.ac-row[aria-current="page"] .ac-row__icon { background: var(--brand-soft); color: var(--brand-text); }
.ac-row:disabled,
.ac-row[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

.ac-row__icon {
  display: inline-grid;
  place-items: center;
  flex: none;
  inline-size: 36px;
  block-size: 36px;
  border-radius: var(--r-full);
  background: var(--surface-2);
  color: var(--ink-2);
}
.ac-row__body {
  flex: 1;
  min-inline-size: 0;
  display: grid;
  gap: 2px;
}
.ac-row__label {
  color: inherit;
  font-size: var(--fs-md);
  font-weight: var(--fw-medium);
  line-height: var(--lh-snug);
  overflow-wrap: break-word;
}
.ac-row__label--clamp {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.ac-row__sub {
  color: var(--ink-2);
  font-size: var(--fs-xs);
  line-height: var(--lh-snug);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ac-row__sub--wrap { white-space: normal; overflow: visible; overflow-wrap: anywhere; }
.ac-row__value {
  flex: none;
  max-inline-size: 50%;
  color: var(--ink-2);
  font-size: var(--fs-sm);
  text-align: end;
  font-variant-numeric: tabular-nums;
}
.ac-row__chev { flex: none; color: var(--ink-3); }
.ac-row > .badge,
.ac-row > .switch,
.ac-row > .btn { flex: none; }

.ac-row--danger { color: var(--danger); }
.ac-row--danger .ac-row__icon { background: var(--danger-soft); color: var(--danger); }
.ac-row--static,
.ac-row--static:hover { background: none; cursor: default; }
.ac-row--switch .switch { margin-inline-start: auto; }
.ac-row--switch:has(.switch__input:focus-visible) {
  outline: var(--ring-w) solid var(--focus-ink);
  outline-offset: -3px;
}
.ac-row--order { padding-block: var(--sp-3); }
.ac-row--order .ac-row__label { font-weight: var(--fw-semibold); }
/* order rows (thumb · number + sub · pill · chevron) on phones: the pill moves under the text so an order
   number like AIM-2026-10440 stays on one line. Also covers any row or details summary built the same way. */
@media (max-width: 599.98px) {
  .ac-row--order,
  .ac-row:has(> .ac-thumb-wrap + .ac-row__body + .badge),
  details.ac-card > summary:has(> .ac-thumb-wrap + .ac-row__body + .badge) {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    column-gap: var(--sp-3);
    row-gap: var(--sp-1);
    align-items: center;
  }
  :is(.ac-row--order, .ac-row, details.ac-card > summary):has(> .ac-thumb-wrap + .ac-row__body + .badge) > .ac-thumb-wrap,
  .ac-row--order > .ac-thumb-wrap { grid-column: 1; grid-row: 1 / span 2; }
  :is(.ac-row--order, .ac-row, details.ac-card > summary):has(> .ac-thumb-wrap + .ac-row__body + .badge) > .ac-row__body,
  .ac-row--order > .ac-row__body { grid-column: 2; grid-row: 1; align-self: end; }
  :is(.ac-row--order, .ac-row, details.ac-card > summary):has(> .ac-thumb-wrap + .ac-row__body + .badge) > .badge,
  .ac-row--order > .badge { grid-column: 2; grid-row: 2; justify-self: start; align-self: start; }
  :is(.ac-row--order, .ac-row, details.ac-card > summary):has(> .ac-thumb-wrap + .ac-row__body + .badge) > :last-child:not(.badge),
  .ac-row--order > .ac-row__chev { grid-column: 3; grid-row: 1 / span 2; }
}
.ac-row--order .ac-row__label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* a row laid straight into a card (the dashboard's active order) */
.ac-row--flush { padding-inline: 0; border-radius: var(--r-md); }
a.ac-row--flush:hover,
button.ac-row--flush:hover { background: none; }
a.ac-row--flush:hover .ac-row__label { text-decoration: underline; }

/* ---- cards ---------------------------------------------------------------- */
.ac-card {
  display: grid;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  color: var(--ink);
  min-inline-size: 0;
}
.ac-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  min-inline-size: 0;
}
.ac-card__title {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
  letter-spacing: normal;
}
.ac-card__meta { margin: 0; color: var(--ink-2); font-size: var(--fs-xs); }
.ac-card--brand {
  background: var(--brand-soft);
  border-color: transparent;
  color: var(--ink);
}
/* a card that opens and closes (returns, the confirmation's items) */
details.ac-card > summary {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-block-size: 56px;
  margin: calc(var(--sp-2) * -1) calc(var(--sp-2) * -1);
  padding: var(--sp-2);
  border-radius: var(--r-md);
  list-style: none;
  cursor: pointer;
}
details.ac-card > summary::-webkit-details-marker { display: none; }
details.ac-card > summary::marker { content: ""; }
details.ac-card > summary:focus-visible {
  outline: var(--ring-w) solid var(--focus-ink);
  outline-offset: 0;
}
details.ac-card > summary .ac-row__chev { transition: rotate var(--dur-2) var(--ease); rotate: 90deg; }
details.ac-card[open] > summary .ac-row__chev { rotate: -90deg; }

/* ---- the hello row (avatar, name, tier) --------------------------------- */
.ac-hello {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-block-size: 72px;
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  color: var(--ink);
  text-decoration: none;
}
a.ac-hello { transition: background-color var(--dur-2) var(--ease); }
a.ac-hello:hover { background: var(--surface-2); }
a.ac-hello:focus-visible {
  outline: var(--ring-w) solid var(--focus-ink);
  outline-offset: 2px;
}
.ac-card > .ac-hello,
.ac-hello--plain { padding: 0; background: none; border: 0; border-radius: 0; }
.ac-hello__avatar {
  flex: none;
  inline-size: 52px;
  block-size: 52px;
  font-size: var(--fs-lg);
}
.ac-hello__avatar:not(.account-card__avatar) {
  display: inline-grid;
  place-items: center;
  border-radius: var(--r-full);
  overflow: hidden;
  background: var(--surface-2);
  color: var(--ink-2);
  font-weight: var(--fw-bold);
}
.ac-hello__avatar > * { grid-area: 1 / 1; }
/* dark mode: the initials stay readable on the avatar, on every account page */
[data-theme="dark"] .ac-hello__avatar:has(img) { color: var(--avatar-ink); }
.ac-hello__avatar img { inline-size: 100%; block-size: 100%; object-fit: cover; }
.ac-hello__body { flex: 1; min-inline-size: 0; display: grid; gap: 2px; }
.ac-hello__name {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: 400;
  line-height: var(--lh-snug);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ac-hello__sub {
  margin: 0;
  color: var(--ink-2);
  font-size: var(--fs-xs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ac-menu--side .ac-hello__name { font-size: var(--fs-xl); }

/* ---- tiles ---------------------------------------------------------------- */
.ac-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-3);
  margin: 0;
  padding: 0;
  list-style: none;
}
.ac-tile {
  display: grid;
  align-content: space-between;
  gap: var(--sp-1);
  min-block-size: 88px;
  padding: var(--sp-3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  color: var(--ink);
  text-decoration: none;
  min-inline-size: 0;
  transition: background-color var(--dur-2) var(--ease);
}
a.ac-tile:hover { background: var(--surface-2); }
.ac-tile:focus-visible {
  outline: var(--ring-w) solid var(--focus-ink);
  outline-offset: 2px;
}
.ac-tile__icon { inline-size: 20px; block-size: 20px; color: var(--ink-2); }
.ac-tile__value {
  color: var(--ink);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ac-tile__label { color: var(--ink-2); font-size: var(--fs-xs); line-height: var(--lh-snug); }

/* ---- chips (filters) ------------------------------------------------------ */
.ac-chips {
  display: flex;
  gap: var(--sp-2);
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 calc(var(--container-pad) * -1);
  padding: 0 var(--container-pad);
  list-style: none;
  -webkit-overflow-scrolling: touch;
}
.ac-chips::-webkit-scrollbar { display: none; }
.ac-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1);
  flex: none;
  min-block-size: 44px;
  min-inline-size: 44px;
  padding-inline: var(--sp-4);
  border: 1px solid var(--line-2);
  border-radius: var(--r-full);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur-2) var(--ease), color var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease);
}
.ac-chip:hover { background: var(--surface-2); }
.ac-chip[aria-current="page"],
.ac-chip[aria-pressed="true"],
.ac-chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}
.ac-chip:focus-visible {
  outline: var(--ring-w) solid var(--focus-ink);
  outline-offset: 2px;
}
@media (min-width: 1024px) {
  .ac-chips { margin-inline: 0; padding-inline: 0; flex-wrap: wrap; overflow: visible; }
}

/* ---- search field --------------------------------------------------------- */
.ac-search { position: relative; display: block; margin: 0; }
.ac-search[hidden] { display: none; }
.ac-search::before {
  content: "";
  position: absolute;
  inset-inline-start: var(--sp-4);
  inset-block-start: 50%;
  inline-size: 20px;
  block-size: 20px;
  margin-block-start: -10px;
  background: var(--ink-2);
  -webkit-mask: var(--ac-i-search) center / contain no-repeat;
  mask: var(--ac-i-search) center / contain no-repeat;
  pointer-events: none;
}
.ac-search:has(> .icon)::before { display: none; }
.ac-search > .icon {
  position: absolute;
  inset-inline-start: var(--sp-4);
  inset-block-start: 50%;
  margin-block-start: -10px;
  color: var(--ink-2);
  pointer-events: none;
}
.ac-search .input {
  inline-size: 100%;
  min-block-size: 48px;
  padding-inline-start: calc(var(--sp-4) + 20px + var(--sp-2));
  border-radius: var(--r-full);
}

/* ---- order progress ------------------------------------------------------- */
.ac-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}
.ac-steps__item {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: var(--sp-2);
  min-inline-size: 0;
  text-align: center;
}
.ac-steps__item + .ac-steps__item::before {
  content: "";
  position: absolute;
  inset-block-start: 6px;
  inset-inline-end: 50%;
  inline-size: 100%;
  block-size: 2px;
  background: var(--line-2);
}
.ac-steps__item.is-done::before { background: var(--success); }
.ac-steps__dot {
  position: relative;
  z-index: 1;
  inline-size: 14px;
  block-size: 14px;
  border: 2px solid var(--line-2);
  border-radius: var(--r-full);
  background: var(--surface);
}
.ac-steps__item.is-done .ac-steps__dot { background: var(--success); border-color: var(--success); }
.ac-steps__item.is-current .ac-steps__dot {
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-ring);
}
.ac-steps__label {
  color: var(--ink-2);
  font-size: var(--fs-2xs);
  line-height: var(--lh-snug);
  overflow-wrap: anywhere;
}
.ac-steps__item.is-current .ac-steps__label { color: var(--ink); font-weight: var(--fw-semibold); }

/* ---- thumbnails ------------------------------------------------------------ */
.ac-thumb-wrap { position: relative; flex: none; display: inline-block; line-height: 0; }
.ac-thumb {
  display: block;
  inline-size: 56px;
  block-size: 56px;
  border-radius: var(--r-md);
  object-fit: cover;
  background: var(--surface-2);
}
.ac-thumb__more {
  position: absolute;
  inset-block-end: -4px;
  inset-inline-end: -4px;
  min-inline-size: 22px;
  padding: 2px 6px;
  border-radius: var(--r-full);
  background: var(--ink);
  color: var(--bg);
  box-shadow: 0 0 0 2px var(--surface);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  line-height: 1.3;
  text-align: center;
}

/* ---- totals ---------------------------------------------------------------- */
.ac-totals { display: grid; gap: var(--sp-2); margin: 0; }
.ac-totals > div,
.ac-totals__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
  color: var(--ink-2);
  font-size: var(--fs-sm);
}
.ac-totals dt,
.ac-totals dd { margin: 0; }
.ac-totals dd { color: var(--ink); text-align: end; font-variant-numeric: tabular-nums; }
.ac-totals > .ac-totals__total {
  margin-block-start: var(--sp-1);
  padding-block-start: var(--sp-3);
  border-block-start: 1px solid var(--line);
  color: var(--ink);
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
}

/* ---- empty state ----------------------------------------------------------- */
.ac-empty {
  display: grid;
  justify-items: center;
  gap: var(--sp-3);
  padding: var(--sp-10) var(--sp-4);
  text-align: center;
}
.ac-empty__icon {
  display: inline-grid;
  place-items: center;
  inline-size: 56px;
  block-size: 56px;
  border-radius: var(--r-full);
  background: var(--surface-2);
  color: var(--ink-2);
}
.ac-empty__title {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  letter-spacing: normal;
}
.ac-empty__text { margin: 0; max-inline-size: 32ch; color: var(--ink-2); font-size: var(--fs-sm); }
.ac-empty .btn { margin-block-start: var(--sp-2); }

/* ---- segmented control ----------------------------------------------------- */
.ac-seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  margin: 0;
  padding: 4px;
  border: 0;
  background: var(--surface-2);
  border-radius: var(--r-full);
  box-shadow: inset 0 0 0 1px var(--line);
}
.ac-seg > button,
.ac-seg > label {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1);
  min-block-size: 44px;
  min-inline-size: 0;
  padding-inline: var(--sp-3);
  border: 0;
  border-radius: var(--r-full);
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  text-align: center;
  cursor: pointer;
  transition: background-color var(--dur-2) var(--ease), color var(--dur-2) var(--ease);
}
.ac-seg > label > input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  opacity: 0;
}
.ac-seg > .is-active,
.ac-seg > [aria-pressed="true"],
.ac-seg > label:has(input:checked) {
  background: var(--surface);
  color: var(--ink);
  font-weight: var(--fw-semibold);
  box-shadow: var(--sh-1);
}
.ac-seg > button:focus-visible,
.ac-seg > label:has(input:focus-visible) {
  outline: var(--ring-w) solid var(--focus-ink);
  outline-offset: 0;
}

/* ---- product strip (saved items) ------------------------------------------ */
.ac-strip {
  display: flex;
  gap: var(--sp-3);
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--container-pad);
  margin: 0 calc(var(--container-pad) * -1);
  padding: 0 var(--container-pad) var(--sp-1);
  list-style: none;
  -webkit-overflow-scrolling: touch;
}
.ac-strip::-webkit-scrollbar { display: none; }
.ac-strip > li { flex: none; margin: 0; }
.ac-mini {
  display: grid;
  gap: var(--sp-1);
  flex: none;
  inline-size: 128px;
  color: var(--ink);
  text-decoration: none;
  scroll-snap-align: start;
}
.ac-mini__img {
  display: block;
  inline-size: 128px;
  block-size: 160px;
  border-radius: var(--r-md);
  object-fit: cover;
  background: var(--surface-2);
}
.ac-mini__title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  color: var(--ink);
  font-size: var(--fs-xs);
  line-height: var(--lh-snug);
}
.ac-mini__price { color: var(--ink); font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.ac-mini:focus-visible {
  outline: var(--ring-w) solid var(--focus-ink);
  outline-offset: 2px;
  border-radius: var(--r-md);
}
@media (min-width: 1024px) {
  .ac-strip { margin-inline: 0; padding-inline: 0; scroll-padding-inline: 0; }
}

/* ---- action buttons -------------------------------------------------------- */
.ac-actions { display: grid; gap: var(--sp-2); }
.ac-actions--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ac-actions--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ac-actions > .btn { inline-size: 100%; min-inline-size: 0; }

/* ---- copy button ----------------------------------------------------------- */
.ac-copy {
  display: inline-grid;
  place-items: center;
  flex: none;
  inline-size: var(--control-md);
  block-size: var(--control-md);
  padding: 0;
  border: 0;
  border-radius: var(--r-full);
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: background-color var(--dur-2) var(--ease), color var(--dur-2) var(--ease);
}
.ac-copy:hover { background: var(--surface-2); color: var(--ink); }
.ac-copy:focus-visible {
  outline: var(--ring-w) solid var(--focus-ink);
  outline-offset: 0;
}

/* ---- bottom sheet (modifier on .sheet) ------------------------------------ */
.ac-sheet .sheet__panel { max-block-size: 88dvh; }
.ac-sheet .sheet__head { padding-inline: var(--sp-4); }
.ac-sheet .sheet__body { padding: var(--sp-4) var(--sp-4) var(--sp-5); }
.ac-sheet .sheet__foot { padding-inline: var(--sp-4); }
.ac-sheet .sheet__title {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  letter-spacing: normal;
}
.ac-sheet .sheet__close { inline-size: 44px; block-size: 44px; }
.ac-sheet .sheet__close:focus-visible {
  outline: var(--ring-w) solid var(--focus-ink);
  outline-offset: 0;
  box-shadow: none;
}
.ac-sheet__lede { margin: 0 0 var(--sp-4); color: var(--ink-2); font-size: var(--fs-sm); }
@media (min-width: 768px) {
  .ac-sheet .sheet__panel {
    max-inline-size: 480px;
    inset-block-end: var(--sp-6);
    margin-inline: auto;
    padding-bottom: 0;
    border-radius: var(--r-xl);
    overflow: hidden;
  }
  .ac-sheet:not(.is-open) .sheet__panel { transform: translateY(calc(100% + var(--sp-6))); }
}

/* ---- success screen (order placed) ----------------------------------------- */
.ac-done {
  display: grid;
  justify-items: center;
  gap: var(--sp-3);
  inline-size: 100%;
  max-inline-size: 480px;
  margin-inline: auto;
  text-align: center;
}
.ac-done__mark {
  display: inline-grid;
  place-items: center;
  inline-size: 72px;
  block-size: 72px;
  border-radius: var(--r-full);
  background: var(--success-soft);
  color: var(--success);
}
.ac-done__mark .icon { inline-size: 32px; block-size: 32px; stroke-width: 2; }
.ac-done__mark.is-warn { background: var(--warning-soft); color: var(--warning-ink); }
.ac-done__mark.is-bad { background: var(--danger-soft); color: var(--danger); }
.ac-done__title {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: var(--fs-3xl);
  font-weight: 400;
  line-height: var(--lh-snug);
}
.ac-done__lines {
  display: grid;
  gap: var(--sp-1);
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--ink-2);
  font-size: var(--fs-sm);
}
.ac-done__lines p { margin: 0; }
.ac-done__actions { display: grid; gap: var(--sp-2); inline-size: 100%; margin-block-start: var(--sp-2); }
.ac-done > .btn,
.ac-done__actions > .btn { inline-size: 100%; }

/* ---- auth screens (sign in, code, reset, sign up) -------------------------- */
.ac-auth {
  display: grid;
  gap: var(--sp-5);
  max-inline-size: 420px;
  margin-inline: auto;
  padding: var(--sp-8) var(--container-pad) var(--sp-10);
}
.ac-auth__title {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: var(--fs-3xl);
  font-weight: 400;
  line-height: var(--lh-snug);
}
.ac-auth__lede { margin: 0; color: var(--ink-2); }
/* the three highlights under the sign-in / create-account title */
.ac-auth__perks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.ac-auth__perks li {
  display: grid;
  justify-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  white-space: nowrap;
  background: var(--surface);
  color: var(--ink);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  text-align: center;
  line-height: var(--lh-snug);
}
.ac-auth__perks .icon { inline-size: 22px; block-size: 22px; color: var(--brand-text); }
@media (max-width: 374.98px) { .ac-auth__perks li { white-space: normal; } }   /* small phones: a label may take two lines */
.ac-auth__foot { margin: 0; color: var(--ink-2); font-size: var(--fs-sm); text-align: center; }
.ac-auth__foot a {
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
  color: var(--brand-text);
  font-weight: var(--fw-semibold);
}


/* ==========================================================================
   §4 RTL, MOTION, PRINT
   ========================================================================== */

[dir="rtl"] .ac-row__chev,
[dir="rtl"] .ac-appbar__back .icon,
[dir="rtl"] .co-header__back .icon { transform: scaleX(-1); }
/* components.css moves the switch thumb with a physical translateX; mirror it in a right-to-left page */
[dir="rtl"] .switch__input:checked + .switch__track .switch__thumb { transform: translateX(-19px); }
/* the open/close chevron on a details card turns, it does not mirror */
[dir="rtl"] details.ac-card > summary .ac-row__chev { transform: none; }

@media (prefers-reduced-motion: reduce) {
  .ac-appbar__btn,
  .ac-appbar__text,
  .co-header__back,
  .ac-row,
  .ac-hello,
  .ac-tile,
  .ac-chip,
  .ac-seg > button,
  .ac-seg > label,
  .ac-copy,
  details.ac-card > summary .ac-row__chev,
  .ac-sheet .sheet__panel { transition: none; }
}

@media print {
  .ac-appbar__btn,
  .ac-menu,
  .sheet,
  .tabbar { display: none !important; }
  .ac-appbar { position: static; border: 0; background: none; }
}
