/* ui.css — shared components and motion, loaded on every page after base.css. */
@view-transition { navigation: auto; }               /* smooth cross-page fade (Chromium) */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; }
/* Theme switch: keep the snapshots still and let core.js open the new palette with a soft wave. */
html.theme-anim::view-transition-old(root) { animation: none; mix-blend-mode: normal; }
html.theme-anim::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
  -webkit-mask-image: radial-gradient(circle closest-side, #000 0%, #000 88%, rgba(0,0,0,.72) 94%, rgba(0,0,0,.28) 98%, transparent 100%);
  mask-image: radial-gradient(circle closest-side, #000 0%, #000 88%, rgba(0,0,0,.72) 94%, rgba(0,0,0,.28) 98%, transparent 100%);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 0 0;
  mask-size: 0 0;
  -webkit-mask-position: 0 0;
  mask-position: 0 0;
}
/* Older engines without CSS masks: fall back to a clean circular clip. */
html.theme-clip::view-transition-new(root) { -webkit-mask-image: none; mask-image: none; -webkit-mask-size: auto; mask-size: auto; }
body { transition: opacity .35s var(--ease); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; padding: 10px 16px; border-radius: 10px; background: var(--ink); color: var(--bg); }
.skip:focus { left: 8px; }

/* nav */
.nav { display: flex; gap: 4px; margin-right: 8px; }
.nav__a { position: relative; padding: 10px 14px; border-radius: 999px; font-weight: 700; font-size: .95rem; text-decoration: none; color: var(--muted); transition: color .2s, background-color .2s; }
.nav__a:hover { color: var(--ink); background: rgba(128,128,128,.12); }
.nav__a[aria-current="page"] { color: var(--ink); }
.nav__a[aria-current="page"]::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px; border-radius: 2px; background: var(--accent); animation: grow .5s var(--ease) both; }
@keyframes grow { from { transform: scaleX(0); } }
@media (max-width: 860px) { .nav { display: none; } }

/* reveal on scroll (core.js adds .is-in) */
[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease) var(--d, 0ms), transform .6s var(--ease) var(--d, 0ms); }
[data-reveal].is-in { opacity: 1; transform: none; }
.foot__in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; }

/* buttons + fields */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 24px; border: 0; border-radius: 999px; background: var(--btn-bg); color: var(--btn-ink); font-weight: 800; text-decoration: none; cursor: pointer; overflow: hidden; transition: transform .15s var(--ease), box-shadow .25s, opacity .2s; }
.btn:hover { box-shadow: 0 8px 22px -10px rgba(0,0,0,.45); transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn[aria-busy="true"] { color: transparent; }
.btn[aria-busy="true"]::after { content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--btn-ink); border-right-color: transparent; animation: spin .7s linear infinite; }
.btn--ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn--ghost[aria-busy="true"]::after { border-color: var(--ink); border-right-color: transparent; }
.btn--danger { background: #c4372a; color: #fff; }
.btn--sm { min-height: 40px; padding: 0 16px; font-size: .9rem; }
.btn--wide { width: 100%; }
.textbtn { border: 0; background: none; padding: 6px 0; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; justify-self: start; cursor: pointer; color: inherit; }
.fld { display: grid; gap: 6px; font-weight: 700; }
.fld input, .fld select, .fld textarea { width: 100%; min-height: 50px; padding: 0 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); font: inherit; font-weight: 500; color: inherit; transition: border-color .2s, box-shadow .2s; }
.fld textarea { padding: 12px 16px; resize: vertical; }
.fld input:focus, .fld select:focus, .fld textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.fld small { font-weight: 500; }
.fld--inline { grid-auto-flow: column; align-items: center; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 700; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.err { min-height: 1.4em; color: #d1432f; font-weight: 700; }
.err:empty { min-height: 0; }
.small { font-size: .85rem; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row--between { justify-content: space-between; }
.row--end { justify-content: flex-end; }
.row2 { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
@media (max-width: 520px) { .row2 { grid-template-columns: 1fr; } }
.stack { display: grid; gap: 14px; }
.panel { display: grid; gap: 14px; align-content: start; padding: 24px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.panel h2 { font-family: var(--font-display); font-weight: 500; font-size: 1.3rem; }
.pill { display: inline-flex; align-items: center; padding: 3px 12px; border-radius: 999px; background: rgba(128,128,128,.14); font-size: .8rem; font-weight: 800; white-space: nowrap; }
.pill--pending { background: rgba(216,154,43,.18); color: #a86d00; }
.pill--accepted, .pill--validated, .pill--paid { background: var(--accent-soft); color: var(--accent); }
.pill--declined, .pill--refused, .pill--cancelled { background: var(--used-soft); color: var(--used); }
:root[data-theme="dark"] .pill--pending { color: #f0c060; }
.eyebrow { font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.empty { padding: 48px 0; color: var(--muted); }
.plain { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }

/* repair status chips */
.st { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px; font-size: .82rem; font-weight: 800; background: rgba(128,128,128,.14); white-space: nowrap; }
.st::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.st--diagnostic_in_progress, .st--repair_in_progress, .st--board_repair { color: #2f6fbf; background: rgba(47,111,191,.13); }
.st--diagnostic_in_progress::before, .st--repair_in_progress::before, .st--board_repair::before { animation: pulse 1.6s ease-in-out infinite; }
.st--awaiting_customer_response, .st--awaiting_parts, .st--awaiting_processing, .st--diagnostic_completed { color: #a86d00; background: rgba(216,154,43,.16); }
.st--ready_for_pickup { color: var(--accent); background: var(--accent-soft); }
.st--ready_for_pickup::before { animation: pulse 1.2s ease-in-out infinite; }
.st--picked_up { color: var(--muted); }
:root[data-theme="dark"] .st--diagnostic_in_progress, :root[data-theme="dark"] .st--repair_in_progress, :root[data-theme="dark"] .st--board_repair { color: #8fbaf0; }
:root[data-theme="dark"] .st--awaiting_customer_response, :root[data-theme="dark"] .st--awaiting_parts, :root[data-theme="dark"] .st--awaiting_processing, :root[data-theme="dark"] .st--diagnostic_completed { color: #f0c060; }
@keyframes pulse { 50% { transform: scale(1.6); opacity: .45; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* tabs with a sliding underline */
.tabs { position: relative; display: flex; gap: 4px; margin: 6px 0 26px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tab { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 14px 16px; border: 0; background: none; font-weight: 800; color: var(--muted); white-space: nowrap; cursor: pointer; transition: color .2s; }
.tab[aria-selected="true"] { color: var(--ink); }
.tab__n { display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--bg); font-size: .75rem; }
.tabs__ink { position: absolute; left: 0; bottom: -1px; height: 3px; border-radius: 3px; background: var(--accent); transition: transform .45s var(--ease), width .45s var(--ease); }

/* glow that follows the pointer */
.glow { position: relative; isolation: isolate; }
.glow::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), var(--accent-soft), transparent 70%); }
.glow:hover::after { opacity: 1; }

/* loading, errors */
.loading { display: flex; align-items: center; gap: 12px; padding: 48px 0; color: var(--muted); font-weight: 700; }
.spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.loaderr { display: grid; gap: 14px; justify-items: start; padding: 32px 0; font-weight: 700; color: #d1432f; }
.shake { animation: shake .45s var(--ease); }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }

/* toasts */
.toasts { position: fixed; z-index: 200; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { padding: 14px 18px; border-radius: 16px; background: var(--ink); color: var(--bg); font-weight: 700; box-shadow: 0 14px 40px -12px rgba(0,0,0,.5); animation: toastIn .45s var(--ease) both; }
.toast--ok { background: var(--accent); color: #fff; }
.toast--bad { background: #c4372a; color: #fff; }
.toast.is-out { animation: toastOut .4s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px) scale(.96); } }

/* dialogs */
.modal { width: min(94vw, 560px); max-height: 90vh; padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px -20px rgba(0,0,0,.55); }
.modal[open] { animation: modalIn .4s var(--ease); }
.modal::backdrop { background: rgba(17,16,14,.5); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: fade .3s; }
.modal__in { padding: 26px; }
.modal__text { margin-bottom: 20px; font-size: 1.1rem; font-weight: 600; }
.modal h2 { font-family: var(--font-display); font-weight: 500; font-size: 1.5rem; }
.modal h3 { margin: 6px 0 0; font-size: 1rem; }
@keyframes modalIn { from { opacity: 0; transform: translateY(24px) scale(.97); } }
@keyframes fade { from { opacity: 0; } }

/* skeleton cards while products load */
.skel { pointer-events: none; }
.skel .card__img { aspect-ratio: 5/4; }
.skel i { display: block; height: 14px; border-radius: 8px; background-color: var(--line); }
.skel i:nth-child(2) { width: 70%; } .skel i:nth-child(3) { width: 40%; height: 22px; margin-top: 10px; }
.skel .card__img, .skel i { background-image: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* tables */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th { text-align: left; padding: 12px 14px; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-bottom: 1px solid var(--line); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color .2s; }
.table tbody tr:hover { background: rgba(128,128,128,.06); }
.lines { width: 100%; border-collapse: collapse; }
.lines td, .lines th { padding: 8px 0; border-bottom: 1px dashed var(--line); text-align: left; }
.lines td:last-child, .lines th:last-child { text-align: right; white-space: nowrap; }
.lines__total td { font-weight: 800; border-bottom: 0; }
.meta { display: grid; gap: 10px 20px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); margin: 0; }
.meta dt { font-size: .8rem; color: var(--muted); font-weight: 700; }
.meta dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }

/* account menu: opens under the avatar on hover, focus or tap */
.accmenu { position: relative; }
.accmenu__panel { position: absolute; right: 0; top: 100%; z-index: 60; display: grid; min-width: 250px; padding: 8px; margin-top: 10px;
  border-radius: 18px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 24px 60px -20px rgba(0,0,0,.45);
  opacity: 0; visibility: hidden; transform: translateY(-8px) scale(.97); transform-origin: top right;
  transition: opacity .22s var(--ease), transform .3s var(--ease), visibility 0s linear .3s; }
.accmenu__panel::before { content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 14px; } /* hover bridge over the gap */
.accmenu:hover .accmenu__panel, .accmenu:focus-within .accmenu__panel, .accmenu.is-open .accmenu__panel {
  opacity: 1; visibility: visible; transform: none; transition: opacity .22s var(--ease), transform .3s var(--ease), visibility 0s; }
.accmenu__panel a, .accmenu__panel button { display: flex; align-items: center; min-height: 42px; padding: 0 14px; border: 0; border-radius: 12px; background: none;
  font: inherit; font-weight: 700; text-align: left; text-decoration: none; color: inherit; cursor: pointer; transition: background-color .15s, transform .2s var(--ease); }
.accmenu__panel a:hover, .accmenu__panel button:hover, .accmenu__panel a:focus-visible, .accmenu__panel button:focus-visible { background: rgba(128,128,128,.12); transform: translateX(3px); outline: none; }
.accmenu__panel hr { width: 100%; margin: 6px 0; border: 0; border-top: 1px solid var(--line); }
.accmenu__out { color: #c4372a !important; }
.accmenu__who { display: grid; gap: 2px; padding: 10px 14px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.accmenu__who small { color: var(--muted); font-size: .75rem; }
.accmenu__who span { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.accmenu__panel > * { opacity: 0; transform: translateY(-4px); transition: opacity .25s, transform .3s var(--ease); }
.accmenu:hover .accmenu__panel > *, .accmenu:focus-within .accmenu__panel > *, .accmenu.is-open .accmenu__panel > * { opacity: 1; transform: none; }
.accmenu__panel > *:nth-child(2) { transition-delay: .03s; } .accmenu__panel > *:nth-child(3) { transition-delay: .06s; }
.accmenu__panel > *:nth-child(4) { transition-delay: .09s; } .accmenu__panel > *:nth-child(n+5) { transition-delay: .12s; }

/* shop: three-way switch New / All / Used with a sliding pill */
.seg { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.seg button { position: relative; z-index: 1; min-height: 42px; padding: 0 20px; border: 0; border-radius: 999px; background: none; font-weight: 800; color: var(--muted); cursor: pointer; transition: color .3s; }
.seg button[aria-pressed="true"] { color: var(--bg); }
.seg__pill { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 3); border-radius: 999px; background: var(--ink);
  transform: translateX(calc(var(--i, 1) * 100%)); transition: transform .45s var(--ease), background-color .3s; }
.seg[data-mode="new"] .seg__pill { background: var(--accent); }
.seg[data-mode="used"] .seg__pill { background: var(--used); }
@media (max-width: 720px) { .seg { width: 100%; } }

/* =====================================================================
   Light mode for weak computers (html.lite, set by js/theme.js / core.js):
   no blur, no endless animations, no moving light, no pointer glow, instant reveals.
   Everything stays usable; only decoration is removed.
   ===================================================================== */
.lite *, .lite *::before, .lite *::after { animation: none !important; }
.lite [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
.lite .bar, .lite .glass, .lite .modal::backdrop, .lite .home__top .iconbtn { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
.lite .bar { background: var(--surface); }
.lite .glass { background: var(--surface); }
.lite .glow::after, .lite body::before, .lite .auth::before { display: none !important; }
.lite .card, .lite .btn, .lite .rcard, .lite .dcard, .lite .accmenu__panel, .lite .modal, .lite .authcard, .lite .toast { box-shadow: none !important; }
.lite .card:hover, .lite .btn:hover { transform: none; }
.lite .card__img img, .lite .pd__img img { transition: none; }
.lite .card:hover .card__img img, .lite .pd__img:hover img { transform: none; }
.lite .skel .card__img, .lite .skel i { background-image: none; }
.lite .steps::after { transition: none; }
.lite .accmenu__panel, .lite .accmenu__panel > * { transition: none; }
.lite::view-transition-old(root), .lite::view-transition-new(root) { animation: none !important; }
/* home: the slanted halves keep their hover effect, but it is instant and the light no longer moves */
.lite .half, .lite .seam, .lite .half__in { transition: none !important; }
.lite .half__bg { inset: 0; }
.lite .split-words .w > span { transform: none; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}
