/* ==========================================================================
   Shop - hardware cards (products), checkout (order) and confirmation
   (order-complete)
   ==========================================================================
   Load order: tokens.css first, then main.css, footer.css, navmenu.css,
   blog.css, skyline.css, landing.css, THIS FILE, and accent.css last.
   Colours come from tokens.css and the --lp-* surface tokens in
   landing.css (which already switch for body.dark-mode). Lemon is kept for
   the one primary action on each card and the Pay button.
   ========================================================================== */

:root {
  --shop-bad: #b3261e;
  --shop-bad-bg: #fdecea;
  --shop-ok-bg: var(--lemon-tint);
}
body.dark-mode {
  --shop-bad: #ffb4ab;
  --shop-bad-bg: rgb(255 180 171 / .1);
  --shop-ok-bg: rgb(182 242 58 / .12);
}

/* hidden must win over the display rules below. */
.shop-page [hidden], #hardware [hidden] { display: none !important; }

/* -- Product cards (products.html #hardware) ----------------------------- */
.shop-group { margin-top: 48px; }
.shop-group:first-of-type { margin-top: 0; }
.shop-group-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin: 0 0 18px; font-size: 1.25rem;
  font-weight: 700; color: var(--lp-ink); }
.shop-group-h small { font-size: .9rem; font-weight: 500; color: var(--lp-ink-3); }
.shop-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.shop-card { display: flex; flex-direction: column; overflow: hidden; background: var(--lp-surface);
  border: 1px solid var(--lp-rule); border-radius: var(--radius-card);
  transition: border-color .18s ease, box-shadow .18s ease; }
.shop-card:hover { border-color: rgb(var(--vypa-blue-rgb) / .35);
  box-shadow: 0 18px 40px -30px rgb(var(--vypa-blue-rgb) / .5); }
body.dark-mode .shop-card:hover { border-color: rgb(182 242 58 / .35); box-shadow: none; }
.shop-card-media { display: grid; place-items: center; aspect-ratio: 4 / 3; padding: 20px 24px;
  background: radial-gradient(80% 70% at 50% 40%, var(--lp-surface), var(--lp-surface-2)); border-bottom: 1px solid var(--lp-rule); }
.shop-card-media img { display: block; width: 100%; height: 100%; object-fit: contain; }
.shop-card-body { display: flex; flex-direction: column; flex: 1; padding: 22px 24px 24px; }
.shop-card-name { margin: 0 0 6px; font-size: 1.15rem; line-height: 1.3; font-weight: 700; color: var(--lp-ink); }
.shop-blurb { margin: 0 0 10px; font-size: .95rem; line-height: 1.55; color: var(--lp-ink-2); }
.shop-goodfor { margin: 0 0 18px; font-size: .9rem; line-height: 1.55; color: var(--lp-ink-3); }
.shop-goodfor b { color: var(--lp-ink-2); font-weight: 600; }
.shop-price-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: auto 0 16px; }
.shop-price { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; color: var(--lp-ink);
  font-variant-numeric: tabular-nums; }
.shop-price-note { font-size: .85rem; color: var(--lp-ink-3); }
.shop-buy { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  min-height: 48px; padding: 0 22px; font-size: 1rem; text-decoration: none; box-sizing: border-box; }
.shop-buy i { font-size: .85em; }

/* Delivery and "what's included" strip under the cards. */
.shop-facts { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  margin: 40px 0 0; padding: 0; list-style: none; }
.shop-facts li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 0 14px; align-items: start;
  padding: 18px 20px; background: var(--lp-surface); border: 1px solid var(--lp-rule); border-radius: var(--radius-card); }
.shop-facts .lp-ico { width: 40px; height: 40px; margin: 0; grid-row: span 2; }
.shop-facts b { font-size: .98rem; color: var(--lp-ink); }
.shop-facts span { font-size: .9rem; line-height: 1.55; color: var(--lp-ink-2); }
body.dark-mode .shop-card .lp-ico,
body.dark-mode .shop-facts .lp-ico { color: var(--lemon); }

/* Hero visual: the three players on one soft stage. */
.shop-stage { position: relative; width: 100%; max-width: 520px; aspect-ratio: 5 / 4; border-radius: 28px;
  background: radial-gradient(70% 60% at 50% 45%, var(--lp-surface), var(--lp-blue-soft));
  border: 1px solid var(--lp-rule); overflow: hidden; }
.shop-stage img { position: absolute; display: block; height: auto; }
.shop-stage .s-pi { width: 62%; left: 6%; top: 10%; }
.shop-stage .s-box { width: 50%; right: 4%; top: 36%; }
.shop-stage .s-stick { width: 44%; left: 14%; bottom: 4%; }

/* -- Page shell for order + order-complete ------------------------------- */
.shop-page { padding: calc(var(--hdr-h) + 16px) 0 80px; }
.shop-page .crumbs { margin: 0 0 14px; font-size: 13px; }
.shop-page .crumbs li { color: var(--lp-ink-3); }
.shop-page .crumbs li[aria-current="page"] { color: var(--lp-ink); }
.shop-page .crumbs a { color: var(--lp-ink-3); }
body.dark-mode .shop-page .crumbs a { color: var(--lemon); }
.shop-h1 { margin: 0 0 8px; font-size: clamp(1.9rem, 3.6vw, 2.6rem); line-height: 1.1; font-weight: 700;
  letter-spacing: -.02em; color: var(--lp-ink); text-wrap: balance; }
.shop-lede { margin: 0 0 28px; max-width: 62ch; font-size: 1.02rem; line-height: 1.6; color: var(--lp-ink-2); }
.shop-h2 { margin: 0 0 16px; padding: 0; font-size: 1.1rem; font-weight: 700; color: var(--lp-ink); }
.shop-narrow { max-width: 760px; }

/* Notes above the form: switched market (blue), cancelled payment (sun). */
.shop-note { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 20px; padding: 14px 18px;
  border-radius: var(--radius-callout); background: var(--lp-blue-soft); color: var(--lp-ink); }
.shop-note i { margin-top: 3px; color: var(--lp-blue); }
.shop-note p { margin: 0; font-size: .95rem; line-height: 1.55; }
.shop-note--sun { background: var(--sun); color: var(--ink); }
.shop-note--sun i { color: var(--ink); }
body.dark-mode .shop-note:not(.shop-note--sun) i { color: var(--sun); }

/* -- Checkout layout ----------------------------------------------------- */
.shop-checkout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .9fr);
  grid-template-areas: "form summary"; gap: 28px; align-items: start; }
.shop-summary { grid-area: summary; position: sticky; top: calc(var(--hdr-h) + 12px); }
.shop-formcol { grid-area: form; display: grid; gap: 20px; min-width: 0; }
.shop-panel { margin: 0; padding: 24px; min-width: 0; background: var(--lp-surface);
  border: 1px solid var(--lp-rule); border-radius: var(--radius-card); }
fieldset.shop-panel { padding-top: 22px; }
fieldset.shop-panel legend { float: left; width: 100%; }
fieldset.shop-panel legend + * { clear: left; }

.shop-item { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; align-items: center; margin-bottom: 18px; }
.shop-item-media { display: grid; place-items: center; width: 96px; height: 80px; border-radius: 14px;
  background: var(--lp-surface-2); border: 1px solid var(--lp-rule); }
.shop-item-media img { display: block; width: 84%; height: 84%; object-fit: contain; }
.shop-item-name { margin: 0 0 4px; font-size: 1.05rem; font-weight: 700; color: var(--lp-ink); }
.shop-item-blurb { margin: 0; font-size: .88rem; line-height: 1.5; color: var(--lp-ink-3); }

.shop-qty { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  padding: 14px 0; border-block: 1px solid var(--lp-rule); }
.shop-qty > label { font-weight: 600; color: var(--lp-ink); }
.shop-qty .shop-hint { flex-basis: 100%; margin: 0; }
.shop-stepper { display: inline-flex; align-items: center; border: 1px solid var(--lp-rule); border-radius: var(--radius-pill);
  background: var(--lp-surface-2); }
.shop-stepper button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0;
  border-radius: 50%; background: transparent; color: var(--lp-ink); font-size: 1.25rem; cursor: pointer; }
.shop-stepper button:hover:not(:disabled) { background: var(--lp-blue-soft); color: var(--lp-blue); }
.shop-stepper button:disabled { opacity: .35; cursor: not-allowed; }
.shop-stepper button:focus-visible { outline: none; box-shadow: var(--focus-ring-light); }
.shop-stepper input { width: 3.2em; height: 44px; padding: 0; border: 0; background: transparent; color: var(--lp-ink);
  font: inherit; font-size: 1.05rem; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums;
  -moz-appearance: textfield; appearance: textfield; }
.shop-stepper input::-webkit-outer-spin-button,
.shop-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.shop-stepper input:focus-visible { outline: none; box-shadow: var(--focus-ring-light); border-radius: 8px; }

.shop-lines { margin: 14px 0 0; }
.shop-lines > div { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; font-size: .95rem; }
.shop-lines dt { color: var(--lp-ink-2); }
.shop-lines dd { margin: 0; color: var(--lp-ink); font-variant-numeric: tabular-nums; text-align: right; }
.shop-lines > .is-total { margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--lp-rule); font-size: 1.15rem; font-weight: 700; }
.shop-lines > .is-total dt { color: var(--lp-ink); }
.shop-lines[aria-busy="true"] dd { color: transparent; border-radius: 6px; min-width: 5.5em;
  background: linear-gradient(90deg, var(--lp-surface-2), var(--lp-rule), var(--lp-surface-2)) 0 0 / 200% 100%;
  animation: shop-shimmer 1.2s linear infinite; }
@keyframes shop-shimmer { to { background-position: -200% 0; } }

.shop-hint { margin: 6px 0 0; font-size: .85rem; line-height: 1.5; color: var(--lp-ink-3); }

/* -- Form fields --------------------------------------------------------- */
.shop-fields { display: grid; gap: 16px; }
.shop-row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.shop-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.shop-field > label, .shop-field > .shop-label { font-size: .92rem; font-weight: 600; color: var(--lp-ink); }
.shop-field .shop-opt { font-weight: 500; color: var(--lp-ink-3); }
.shop-field input, .shop-field select, .shop-field textarea {
  box-sizing: border-box; width: 100%; min-height: 48px; padding: 11px 14px; margin: 0;
  border: 1px solid #c9d2e3; border-radius: 12px; background: var(--lp-surface); color: var(--lp-ink);
  font: inherit; font-size: 1rem; line-height: 1.4; transition: border-color .15s ease, box-shadow .15s ease; }
body.dark-mode .shop-field input, body.dark-mode .shop-field select, body.dark-mode .shop-field textarea {
  border-color: #4a4f60; background-color: var(--lp-surface-2); color-scheme: dark; }
.shop-field textarea { min-height: 88px; resize: vertical; }
.shop-field select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.shop-field input:focus, .shop-field select:focus, .shop-field textarea:focus {
  outline: none; border-color: var(--vypa-blue); box-shadow: var(--focus-ring-light); }
body.dark-mode .shop-field input:focus, body.dark-mode .shop-field select:focus, body.dark-mode .shop-field textarea:focus {
  border-color: var(--vypa-blue-soft); }
.shop-field [aria-invalid="true"] { border-color: var(--shop-bad); }
.shop-field .shop-err { margin: 0; }
.shop-err { display: flex; gap: 6px; align-items: baseline; margin: 8px 0 0; font-size: .87rem; line-height: 1.45; color: var(--shop-bad); }
.shop-err[hidden] { display: none; }

/* The fixed country: shown, not editable. */
.shop-country { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; box-sizing: border-box;
  border: 1px dashed var(--lp-rule); border-radius: 12px; background: var(--lp-surface-2); color: var(--lp-ink); font-weight: 600; }
.shop-country img { width: 24px; height: auto; border-radius: 3px; }
.shop-country small { margin-left: auto; font-weight: 500; color: var(--lp-ink-3); font-size: .82rem; }

/* Honeypot: out of sight and out of the tab order; people never fill it. */
.shop-hp { position: absolute !important; left: -10000px !important; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* -- Pay ----------------------------------------------------------------- */
.shop-paybox { display: grid; gap: 12px; }
.shop-alert { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 14px 16px; border-radius: 12px;
  background: var(--shop-bad-bg); color: var(--shop-bad); font-size: .95rem; line-height: 1.5; }
.shop-alert[hidden] { display: none; }
.shop-alert i { margin-top: 3px; }
.shop-pay { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 54px;
  padding: 0 24px; font: inherit; font-size: 1.05rem; font-weight: 700; cursor: pointer;
  background: var(--lemon); color: var(--ink); border: 2px solid var(--ink); border-radius: var(--radius-pill);
  transition: background-color .2s ease, transform .2s ease; }
.shop-pay:hover:not(:disabled) { background: var(--lemon-hover); transform: translateY(-1px); }
.shop-pay:focus-visible { outline: none; box-shadow: var(--focus-ring-light); }
.shop-pay:disabled { opacity: .55; cursor: not-allowed; transform: none; }
body.dark-mode .shop-pay { border-color: var(--lemon); }
body.dark-mode .shop-pay:focus-visible { box-shadow: var(--focus-ring); }
.shop-trust { margin: 0; font-size: .88rem; line-height: 1.55; color: var(--lp-ink-2); text-align: center; }
.shop-trust i { color: var(--lp-blue); margin-right: 4px; }
body.dark-mode .shop-trust i { color: var(--lemon); }
.shop-trust small { display: block; margin-top: 4px; color: var(--lp-ink-3); font-size: .82rem; }

.shop-spin { display: inline-block; width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: shop-spin .8s linear infinite; vertical-align: -2px; }
@keyframes shop-spin { to { transform: rotate(360deg); } }

/* Page-level problem (no product, catalogue unreachable). */
.shop-fatal { max-width: 620px; padding: 28px; background: var(--lp-surface); border: 1px solid var(--lp-rule);
  border-radius: var(--radius-card); }
.shop-fatal p { margin: 0 0 16px; color: var(--lp-ink-2); line-height: 1.6; }

/* -- Order complete ------------------------------------------------------ */
.shop-status { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 0 18px; align-items: start; margin-bottom: 24px; }
.shop-status-ico { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
  background: var(--lp-blue-soft); color: var(--lp-blue); font-size: 1.4rem; }
.shop-status-ico.is-ok { background: var(--lemon); color: var(--ink); }
.shop-status-ico.is-bad { background: var(--shop-bad-bg); color: var(--shop-bad); }
.shop-status .shop-h1 { margin-top: 4px; }
.shop-status .shop-lede { margin-bottom: 0; }
.shop-oid { display: inline-block; padding: 2px 10px; border-radius: 8px; background: var(--lp-surface-2);
  border: 1px solid var(--lp-rule); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .95em;
  color: var(--lp-ink); letter-spacing: .02em; }
.shop-next { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; counter-reset: shop-next; }
.shop-next li { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 0 14px; counter-increment: shop-next; }
.shop-next li::before { content: counter(shop-next); display: grid; place-items: center; width: 36px; height: 36px;
  border-radius: 50%; background: var(--vypa-blue); color: #fff; font-weight: 700; grid-row: span 2; }
body.dark-mode .shop-next li::before { background: var(--vypa-blue-soft); color: var(--ink); }
.shop-next b { color: var(--lp-ink); }
.shop-next p { margin: 2px 0 0; font-size: .93rem; line-height: 1.55; color: var(--lp-ink-2); }
.shop-next a { color: var(--lp-blue); font-weight: 600; }
body.dark-mode .shop-next a { color: var(--lemon); }
.shop-contact { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 0; padding: 0; list-style: none; }
.shop-contact a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border: 1px solid var(--lp-rule); border-radius: var(--radius-pill); background: var(--lp-surface);
  color: var(--lp-ink); font-weight: 600; text-decoration: none; }
.shop-contact a:hover { border-color: var(--lp-blue); }
.shop-contact a:focus-visible { outline: none; box-shadow: var(--focus-ring-light); }
.shop-contact i { color: var(--lp-blue); }
body.dark-mode .shop-contact i { color: var(--lemon); }
.shop-stack { display: grid; gap: 20px; }

@media (prefers-reduced-motion: reduce) {
  .shop-card, .shop-pay, .shop-field input, .shop-field select, .shop-field textarea { transition: none; }
  .shop-spin, .shop-lines[aria-busy="true"] dd { animation-duration: 3s; }
}

/* -- Tablet -------------------------------------------------------------- */
@media (max-width: 900px) {
  .shop-checkout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "summary" "form"; }
  .shop-summary { position: static; }
}

/* -- Phone --------------------------------------------------------------- */
@media (max-width: 600px) {
  .shop-page { padding-bottom: 56px; }
  .shop-panel { padding: 18px 16px; }
  .shop-row2 { grid-template-columns: minmax(0, 1fr); }
  .shop-item { grid-template-columns: 76px minmax(0, 1fr); }
  .shop-item-media { width: 76px; height: 64px; }
  .shop-status { grid-template-columns: 44px minmax(0, 1fr); gap: 0 14px; }
  .shop-status-ico { width: 44px; height: 44px; font-size: 1.1rem; }
  .shop-card-body { padding: 18px 18px 20px; }
  .shop-card-media { aspect-ratio: 16 / 10; padding: 16px 24px; }
}
