/* ==========================================================================
   The customer's account — desktop width
   --------------------------------------------------------------------------
   Loads after dashboard.css and is scoped to body.acct, so the sign-in page
   and everything else that shares .page keeps its narrow column. The account
   uses the screen it is given: the list pinned top-left, in line with the
   logo, and the screens filling the rest up to a wide ceiling.
   ========================================================================== */

/* The portal's shell (top bar, sidebar, page head, phone bar) lives in
   account-portal.css with the approved design; this file keeps the screens'
   own pieces. */
body.acct .page__head { margin-bottom: 1.25rem; }

/* An order is one line on a wide screen: what it is on the left, its state,
   total and the way in on the right. */
@media (min-width: 1000px) {
  body.acct .row-card__main { flex-basis: 320px; }
  body.acct .row-card__end { flex-wrap: nowrap; }
}

/* ── Special products ─────────────────────────────────────────────────────
   One item made for this account: its photos (whole, never cropped), what
   it is, what it comes to, and the Pay button. */
.sp-card {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 1.5rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  box-shadow: var(--sh-1);
}
.sp-card__media { display: grid; gap: 0.6rem; align-content: start; }
.sp-card__cover {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  border-radius: var(--r-sm, 8px);
  background: var(--surface-sunk);
}
.sp-card--plain { grid-template-columns: 1fr; }
.sp-card__thumbs { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.sp-card__thumb {
  width: 3.4rem;
  height: 3.4rem;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm, 8px);
  background: var(--surface-sunk);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 180ms ease;
}
.sp-card__thumb[aria-current="true"] { border-color: var(--accent); }
.sp-card__thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sp-card__body { display: grid; gap: 0.9rem; align-content: start; }
.sp-card__title { margin: 0; font-size: 1.25rem; font-weight: 600; letter-spacing: -0.02em; }
.sp-card__title .pill { margin-left: 0.35rem; vertical-align: 0.15em; }
.sp-card__desc { margin: 0; color: var(--text-2); white-space: pre-line; }
.sp-card__sum { margin: 0; display: grid; gap: 0.35rem; padding-top: 0.75rem; border-top: 1px solid var(--line-soft); }
.sp-card__sum div { display: flex; justify-content: space-between; gap: 1rem; }
.sp-card__sum dt { color: var(--text-2); }
.sp-card__sum dd { margin: 0; font-variant-numeric: tabular-nums; }
.sp-card__grand { padding-top: 0.35rem; font-weight: 600; font-size: 1.1rem; }

/* The list is tiles: photo, name, price — and a round ↗ button that opens
   the details window (.sp-detail). */
.sp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.sp-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  box-shadow: var(--sh-1);
  overflow: hidden;
}
.sp-tile__media { aspect-ratio: 4 / 3; background: var(--surface-sunk); }
.sp-tile__media img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sp-tile__noimg { display: block; width: 100%; height: 100%; }
.sp-tile__body { display: grid; gap: 0.35rem; align-content: start; padding: 0.85rem 3.6rem 1rem 1rem; }
.sp-tile__title { margin: 0; font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.sp-tile__price { margin: 0; font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.sp-tile__price span { margin-left: 0.25rem; color: var(--text-2); font-weight: 500; font-size: 0.88rem; }
.sp-tile .pill { justify-self: start; }
.sp-tile__open {
  position: absolute;
  right: 0.85rem;
  bottom: 0.85rem;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.sp-tile__open svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.sp-tile__open:hover { background: var(--accent-soft); border-color: var(--accent); }
.sp-tile__open:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }

/* The details window keeps the portal's one large fixed size (.sheet).
   Desktop: price, terms and Pay in a column on the left that stays put
   while the description scrolls on the right. Phone: one column, and the
   Pay button sticks to the bottom of the window. */
.sp-detail { display: flex; flex-direction: column; }
.sheet.sp-detail { width: min(980px, 100%); overflow: hidden; }
.sp-detail__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
  padding-top: 0.5rem;
}
.sp-detail__buy { position: sticky; top: 0; display: grid; gap: 1rem; align-content: start; }
.sp-detail__media { display: grid; gap: 0.6rem; align-content: start; }
.sp-detail__cover { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; border-radius: var(--r-sm, 8px); background: var(--surface-sunk); }
.sp-detail__actions { display: grid; gap: 0.75rem; }
/* where a special product ships: its sales tax is worked out for it */
.sp-shipto { display: grid; gap: 0.35rem; }
.sp-shipto .cof-note { margin: 0; }
.sp-detail__actions .btn { width: 100%; justify-content: center; }
.sp-detail__info { min-width: 0; }
.sp-detail__desc { margin: 0; color: var(--text-2); line-height: 1.65; white-space: pre-line; }
.sp-detail__desc--none { color: var(--text-3); }
@media (max-width: 720px) {
  .sp-detail__body { display: flex; flex-direction: column; align-items: stretch; gap: 1.1rem; }
  /* the column's pieces join the page flow: photos first, then the
     description, then the price, then the sticky Pay bar */
  .sp-detail__buy { display: contents; }
  .sp-detail__media { order: 1; }
  .sp-detail__info { order: 2; }
  .sp-detail__sum { order: 3; }
  .sp-detail__actions {
    order: 4;
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin: 0 calc(-1 * clamp(1.25rem, 3vw, 2rem)) calc(-1 * clamp(1.25rem, 3vw, 2rem));
    padding: 0.85rem clamp(1.25rem, 3vw, 2rem) calc(0.85rem + env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--line-soft);
    box-shadow: 0 -10px 24px -14px rgba(0, 0, 0, 0.35);
  }
  .sp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; }
  .sp-tile__body { padding: 0.7rem 3.2rem 0.85rem 0.8rem; }
}
@media (max-width: 380px) {
  .sp-grid { grid-template-columns: minmax(0, 1fr); }
}
.sp-card__grand dt { color: var(--text); }
.sp-card__agree { font-size: 0.9rem; color: var(--text-2); }
.sp-card__paid { margin: 0; color: var(--text-2); }
.sp-card__body > .btn { justify-self: start; }

@media (max-width: 720px) {
  .sp-card { grid-template-columns: 1fr; }
  .sp-card__body > .btn { justify-self: stretch; }
}
