/* FlexRepairs shop (/shop) — builds on /style.css and builder.css tokens. */

.pcb-shop-page { padding-bottom: 0; }
.pcb-shop-hero { padding: 56px 0 28px; }
.pcb-shop-hero h1 { margin: 0 0 16px; font-size: clamp(36px, 4.4vw, 64px); font-weight: 800; line-height: 1; letter-spacing: -0.045em; }
.pcb-shop-hero p.pcb-muted { max-width: 640px; margin: 0; font-size: 15px; line-height: 1.6; }
.pcb-shop-hero a { color: var(--accent-lime); }

.pcb-shop { padding-bottom: 90px; }
.pcb-shop-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.pcb-shop-toolbar .pcb-chips:empty { display: none; }
.pcb-shop-toolbar input {
  flex: 0 1 280px;
  min-width: 0;
  margin-left: auto;
  padding: 11px 14px;
  border: 1px solid var(--pcb-line-strong);
  border-radius: var(--radius-sm);
  background: #0c0f11;
  color: var(--text-primary);
  font: inherit;
  font-size: 14px;
}
.pcb-shop-toolbar input:focus { outline: none; border-color: var(--border-focus); }
.pcb-shop-count { margin: 14px 0; font-size: 13px; }

.pcb-shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.pcb-shop-grid > .pcb-empty { grid-column: 1 / -1; }
.pcb-shop-grid > .pcb-skeleton { height: 380px; border-radius: var(--radius-md); }

.pcb-shop-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--pcb-line);
  border-radius: var(--radius-md);
  background: var(--pcb-panel);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.pcb-shop-card:hover { border-color: var(--pcb-line-strong); transform: translateY(-2px); }
/* Photos are pinned to all four edges of their box instead of sized with height: 100%.
   iOS Safari mis-sizes percentage heights inside an aspect-ratio grid, which pushed
   product photos off-centre and out of the card. */
.pcb-shop-media { position: relative; display: grid; place-items: center; overflow: hidden; aspect-ratio: 4 / 3; background: radial-gradient(#262d33, #101315); }
.pcb-shop-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center; padding: 16px; }
.pcb-shop-noimg { color: rgba(255, 255, 255, 0.14); font-family: 'Orbitron', var(--font-mono); font-size: 18px; font-weight: 800; letter-spacing: 0.08em; }
.pcb-shop-noimg b { color: rgba(201, 237, 79, 0.25); }
.pcb-shop-stock {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--pcb-lime-soft);
  color: var(--accent-lime);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}
.pcb-shop-stock.is-low, .pcb-shop-stock.is-backorder { background: var(--pcb-warn-soft); color: var(--pcb-warn); }
.pcb-shop-stock.is-out { background: var(--pcb-error-soft); color: var(--pcb-error); }
.pcb-shop-card.is-out .pcb-shop-media img { opacity: 0.5; filter: grayscale(0.6); }

a.pcb-shop-media { color: inherit; }
a.pcb-shop-media img { transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
.pcb-shop-card:hover a.pcb-shop-media img { transform: scale(1.04); }
.pcb-shop-photos-count {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: rgba(10, 12, 13, 0.75);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  backdrop-filter: blur(8px);
}
.pcb-shop-body h2 a { color: inherit; }
.pcb-shop-body h2 a:hover { color: var(--accent-lime); }
.pcb-shop-body h2 a::after { content: ' →'; color: var(--accent-lime); opacity: 0; transition: opacity 0.2s ease; }
.pcb-shop-card:hover .pcb-shop-body h2 a::after { opacity: 1; }

.pcb-shop-body { display: flex; flex: 1; flex-direction: column; padding: 18px; }
.pcb-shop-body .pcb-kicker { margin-bottom: 8px; font-size: 10px; }
.pcb-shop-body h2 { margin: 0 0 8px; font-size: 18px; line-height: 1.25; letter-spacing: -0.02em; }
.pcb-shop-desc {
  display: -webkit-box;
  margin: 0 0 16px;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.55;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.pcb-shop-price { margin-top: auto; font-size: 22px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.pcb-shop-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pcb-shop-actions > * { flex: 1 1 auto; justify-content: center; padding: 10px 16px; font-size: 13px; white-space: nowrap; }

/* How to pay, under the shop intro. */
.pcb-shop-pay { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.pcb-shop-pay li {
  padding: 6px 12px;
  border: 1px solid var(--pcb-line-strong);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.pcb-shop-pay li:not(:last-child) { border-color: rgba(201, 237, 79, 0.35); color: var(--accent-lime); }
.pcb-shop-hero .pcb-shop-text { margin-top: 18px; color: var(--text-primary); }

/* Product page (/shop?item=<id>). */
.pcb-product { padding: 32px 0 90px; }
.pcb-product[hidden], .pcb-shop-hero[hidden], .pcb-shop[hidden] { display: none; }
.pcb-product-back { display: inline-flex; margin-bottom: 22px; color: var(--text-secondary); font-size: 14px; font-weight: 600; }
.pcb-product-back:hover { color: var(--accent-lime); }
.pcb-product-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.pcb-product-media { display: grid; gap: 12px; min-width: 0; }
.pcb-product-info { display: grid; gap: 14px; align-content: start; }
.pcb-product-info .pcb-kicker { margin: 0; }
.pcb-product-info h1 { margin: 0; font-size: clamp(30px, 3.4vw, 46px); font-weight: 800; line-height: 1.05; letter-spacing: -0.035em; }
.pcb-product-price { font-size: 30px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.pcb-product-desc { margin: 0; color: var(--text-secondary); font-size: 15px; line-height: 1.7; white-space: pre-line; }
.pcb-product-info .pcb-shop-actions { margin-top: 6px; }
.pcb-product-info .pcb-shop-actions > * { min-height: 48px; font-size: 14px; }
.pcb-product-info .pcb-shop-pay { margin-top: 4px; }
.pcb-product-info .pcb-footnote { margin: 0; }

/* Photo carousel: native swipe with scroll-snap, Motion glides for the controls. */
.pcb-gallery {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--pcb-line);
  border-radius: var(--radius-lg, 22px);
  background: radial-gradient(#262d33, #101315);
}
.pcb-gallery:focus-visible { outline: 2px solid var(--accent-lime); outline-offset: 3px; }
.pcb-gallery-track {
  position: relative;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.pcb-gallery-track::-webkit-scrollbar { display: none; }
.pcb-gallery-track.is-gliding { scroll-snap-type: none; }
.pcb-gallery-slide { position: relative; display: grid; flex: 0 0 100%; place-items: center; overflow: hidden; margin: 0; aspect-ratio: 1 / 1; max-height: min(560px, 64vh); scroll-snap-align: start; }
.pcb-gallery-slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center; padding: 18px; }
.pcb-gallery.is-out .pcb-gallery-slide img { opacity: 0.55; filter: grayscale(0.6); }
.pcb-gallery-arrow {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  color: #fff;
  background: rgba(10, 12, 13, 0.7);
  font-size: 18px;
  cursor: pointer;
  transform: translateY(-50%);
  backdrop-filter: blur(8px);
  transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}
.pcb-gallery-arrow:hover:not(:disabled) { color: #000; background: var(--accent-lime); border-color: var(--accent-lime); }
.pcb-gallery-arrow:disabled { opacity: 0.3; cursor: default; }
.pcb-gallery-arrow.is-prev { left: 12px; }
.pcb-gallery-arrow.is-next { right: 12px; }
.pcb-gallery-dots { position: absolute; bottom: 14px; left: 50%; display: flex; gap: 6px; transform: translateX(-50%); }
.pcb-gallery-dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 99px; background: rgba(255, 255, 255, 0.35); cursor: pointer; transition: width 0.3s ease, background 0.3s ease; }
.pcb-gallery-dots button.is-active { width: 24px; background: var(--accent-lime); }
.pcb-gallery-thumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pcb-gallery-thumbs button {
  position: relative;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--pcb-line);
  border-radius: var(--radius-md);
  background: radial-gradient(#262d33, #101315);
  aspect-ratio: 4 / 3;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s ease, border-color 0.2s ease;
}
.pcb-gallery-thumbs button:hover, .pcb-gallery-thumbs button.is-active { opacity: 1; border-color: var(--accent-lime); }
.pcb-gallery-thumbs img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 6px; }

/* Reserve dialog. */
.pcb-reserve-form .pcb-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pcb-pay-choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; border: 0; min-width: 0; }
.pcb-pay-choice legend { margin-bottom: 8px; padding: 0; color: var(--text-secondary); font-size: 13px; font-weight: 500; }
.pcb-form .pcb-pay-choice label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--pcb-line-strong);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.pcb-form .pcb-pay-choice input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; padding: 0; accent-color: var(--accent-lime); }
.pcb-pay-choice span { display: grid; gap: 3px; }
.pcb-pay-choice strong { color: var(--text-primary); font-size: 14px; }
.pcb-pay-choice small { color: var(--text-tertiary); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.pcb-form .pcb-pay-choice label:has(input:checked) { border-color: var(--accent-lime); background: rgba(201, 237, 79, 0.06); }
.pcb-reserve-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--pcb-line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-size: 14px;
}
.pcb-reserve-total strong { color: var(--text-primary); font-size: 22px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.pcb-reserve-form .pcb-footnote { margin: 0; }
.pcb-reserve-done { display: grid; gap: 4px; color: var(--text-secondary); font-size: 15px; line-height: 1.6; }
.pcb-reserve-done strong { color: var(--text-primary); }
.pcb-reserve-done .pcb-reserve-total { margin-bottom: 10px; }

@media (max-width: 640px) {
  .pcb-shop-hero { padding-top: 36px; }
  .pcb-shop-toolbar input { flex-basis: 100%; margin-left: 0; }
  .pcb-shop-toolbar .pcb-chips { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 4px; }
  .pcb-shop-toolbar .pcb-chips button { flex: none; }
  .pcb-shop-grid { grid-template-columns: minmax(0, 1fr); }
  .pcb-reserve-form .pcb-grid-2,
  .pcb-pay-choice { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .pcb-product { padding-top: 20px; }
  .pcb-product-grid { grid-template-columns: minmax(0, 1fr); }
  /* On phones people swipe; the dots show where they are. */
  .pcb-gallery-arrow { width: 38px; height: 38px; font-size: 16px; }
  .pcb-gallery-thumbs { display: none; }
}
