/* ============================================================
   STORE: hero, product grid and cards, product page (gallery,
   size picker, accordions, related row), cart pill and drawer.
   Shared by /store/ and the per-product pages rendered by
   functions/store/[handle].js.

   Type scale (store only): 12 eyebrow/badge/note, 13 meta, 15 body
   and card text, 18 block heads, 24 sub heads, clamp(32-48) product
   title, clamp(56-96) hero h1. Spacing in multiples of 8.
   Cache-bust the ?v= on both pages when editing this file.
   ============================================================ */

/* ---- HERO: full-bleed photo, copy bottom-left, fade into the page ---- */
.store-hero {
  position: relative;
  min-height: 72vh;
  max-height: 820px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--bg-primary);
}
.store-hero-photo,
.store-hero-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 45%;
  display: block;
}
.store-hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 8, 8, 0.35) 0%, rgba(8, 8, 8, 0.05) 30%, rgba(8, 8, 8, 0.7) 72%, var(--bg-primary) 100%);
  pointer-events: none;
}
.store-hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
  padding-top: 160px;
  padding-bottom: 56px;
}
.store-hero-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--cta);
}
.store-hero h1 {
  margin: 0;
  font-size: clamp(56px, 9vw, 96px);
  color: var(--text-primary);
  text-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
}
.store-hero-intro {
  max-width: 480px;
  margin: 0;
  font-size: 18px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.86);
}
.store-hero-content .btn { margin-top: 8px; }
.store-strip {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-section);
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* ---- GRID AND CARDS: image, title, price; the card is the link ---- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px 24px;
  align-items: start;
}
.product-grid[data-state="loading"] { min-height: 320px; }
.product-card {
  display: block;
  color: inherit;
  text-decoration: none;
}
.product-media {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-card);
  transition: transform 0.35s ease;
}
.product-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.25s ease;
}
.product-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.04);
  pointer-events: none;
}
.product-img-hover { opacity: 0; }
@media (hover: hover) {
  /* Cross-fade: the main image goes out as the hover image comes in, so two
     photos are never visible at once (matters for dimmed sold-out cards). */
  .product-card:hover .product-img-hover { opacity: 1; }
  .product-card:hover .product-img-hover + .product-img,
  .product-card:hover .product-media:has(.product-img-hover) .product-img { opacity: 0; }
  .product-card:hover .product-media { transform: translateY(-2px); }
  .product-card:hover .product-name { color: var(--accent); }
}
.product-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.product-badge {
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  line-height: 1;
  text-transform: uppercase;
  border-radius: 50px;
  background: var(--cta);
  color: #0a0a0a;
}
.product-badge.badge-bundle {
  background: var(--accent);
  color: #ffffff;
}
.product-badge.badge-preorder {
  background: var(--bg-primary);
  color: var(--cta);
  box-shadow: inset 0 0 0 1px var(--cta);
}
/* Automatic Shopify discount (js/store-core.js mapProbe): a smaller pill
   in brand blue under the Pre-order pill. */
.product-badge.badge-sale {
  padding: 4px 8px;
  font-size: 10px;
  background: var(--accent);
  color: #ffffff;
}
.product-info { padding: 12px 2px 0; }
.product-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}
.product-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.product-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--text-primary);
  transition: color 0.2s ease;
}
.product-price {
  flex-shrink: 0;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--text-secondary);
}
.product-price.is-struck {
  text-decoration: line-through;
  color: var(--text-muted);
}
.price-from {
  margin-right: 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  line-height: 1;
  text-transform: uppercase;
  color: var(--text-muted);
}
.price-compare {
  margin-left: 6px;
  font-weight: 400;
  color: var(--text-muted);
}
.price-sale {
  font-weight: 700;
  color: var(--cta);
}
/* Two prices do not fit beside a title on a two-column phone grid, so a
   discounted card stacks the sale price over the struck one. */
.product-card .product-price.has-sale {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.product-card .product-price.has-sale .price-compare {
  margin-left: 0;
  font-size: 12px;
}
.price-save {
  display: inline-block;
  margin-left: 8px;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255, 58, 58, 0.14);
  color: var(--danger-light);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1.2;
  text-transform: uppercase;
  vertical-align: middle;
}
.product-promo-note {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--cta);
}
.product-meta {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.3;
  color: var(--text-muted);
}
/* Sold out is said by the struck price and the meta line; the photo stays
   full strength so a mostly sold-out grid does not read as broken. */
.product-card.is-sold-out .product-name { color: var(--text-secondary); }
.store-status {
  max-width: 520px;
  margin: 0 auto;
  padding: 48px 16px;
  text-align: center;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* ---- PRODUCT PAGE ---- */
.product-section { padding: 0; }
.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  padding: 128px 0 64px;
}
.product-detail-media .product-image {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.product-detail-media .product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}
.product-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.product-thumbs::-webkit-scrollbar { display: none; }
.product-thumb {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-card);
  opacity: 0.55;
  cursor: pointer;
  transition: opacity 0.2s ease, border-color 0.2s ease;
}
.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.product-thumb:hover { opacity: 0.85; }
.product-thumb.active {
  opacity: 1;
  border-color: var(--accent);
}
.product-detail-info {
  position: sticky;
  top: 112px;
}
.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--text-muted);
}
.crumbs a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}
.crumbs a:hover { color: var(--accent); }
.crumbs [aria-current] {
  min-width: 0;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.product-detail-title {
  margin: 0 0 8px;
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 0.95;
  text-transform: uppercase;
  color: var(--text-primary);
}
.product-detail-info .product-price {
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}
.product-detail-info .price-compare { font-size: 15px; }
.stock-badge {
  display: inline-block;
  margin-bottom: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(255, 58, 58, 0.12);
  color: var(--danger-light);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1.2;
  text-transform: uppercase;
}
/* ---- OPTION AXES (a product with both sizes and colourways) ---- */
.option-group { margin-bottom: 16px; }
.option-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--text-muted);
}
.option-chosen {
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-primary);
}
.option-chosen:empty { display: none; }
.option-values {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.swatch-row { gap: 12px; }
.option-value.swatch {
  width: 32px;
  height: 32px;
  min-width: 0;
  padding: 0;
  border-radius: 50%;
  background: var(--swatch);
  border: 1px solid rgba(255, 255, 255, 0.28);
  cursor: pointer;
  transition: box-shadow 0.2s ease, opacity 0.2s ease;
}
.option-value.swatch:hover { box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 3px rgba(255, 255, 255, 0.4); }
.option-value.swatch.active { box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 4px var(--cta); }
.option-value.swatch.out-of-stock {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.size-label {
  margin: 24px 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--text-muted);
}
.size-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.option-value,
.size-option {
  min-width: 48px;
  min-height: 44px;
  padding: 0 14px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1;
  text-transform: uppercase;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.option-value:not(.swatch):hover,
.size-option:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}
.option-value:not(.swatch).active,
.size-option.active {
  border-color: var(--cta);
  color: var(--cta);
  box-shadow: inset 0 0 0 1px var(--cta);
}
.option-value:not(.swatch).out-of-stock,
.size-option.out-of-stock {
  color: var(--text-muted);
  text-decoration: line-through;
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
.product-detail-info .product-btn {
  display: block;
  width: 100%;
  margin-top: 8px;
  text-align: center;
}
.product-btn.sold-out,
.product-btn.add-to-cart:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
/* No size chosen yet: looks inactive but stays tappable, so a tap can point
   at the sizes (promptForSize in js/store.js). */
.product-btn.add-to-cart.needs-size {
  opacity: 0.45;
  cursor: pointer;
}
.size-selector.size-required .size-option:not(.out-of-stock) {
  border-color: var(--danger);
  color: var(--danger-light);
  box-shadow: inset 0 0 0 1px var(--danger);
}
.size-selector.size-required { animation: size-nudge 0.4s ease; }
@keyframes size-nudge {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
@media (prefers-reduced-motion: reduce) {
  .size-selector.size-required { animation: none; }
}
.size-required-msg {
  margin: -12px 0 16px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--danger-light);
}
.product-preorder-note {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(100, 255, 233, 0.08);
  box-shadow: inset 0 0 0 1px rgba(100, 255, 233, 0.25);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--cta);
}
.product-preorder-note + .product-trust { margin-top: 12px; }
.product-trust {
  margin: 16px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.card-message {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--danger-light);
}
.product-detail-status {
  padding: 160px 16px 80px;
  text-align: center;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.product-detail-status a { color: var(--accent); }

/* ---- COMPLETE THE SET (pair cards under the buy button) ---- */
.product-pairs {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}
.product-pairs-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--text-muted);
}
.pair-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.pair-img img {
  display: block;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg-section);
}
.pair-title {
  display: block;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
  text-decoration: none;
}
.pair-title:hover { color: var(--accent); }
.pair-price {
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.3;
  color: var(--text-secondary);
}
.pair-price .price-compare { font-size: 12px; }
.pair-sizes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.pair-size {
  min-height: 32px;
  padding: 0 10px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1;
  text-transform: uppercase;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  cursor: pointer;
}
.pair-size.active {
  border-color: var(--cta);
  color: var(--cta);
  box-shadow: inset 0 0 0 1px var(--cta);
}
.pair-size.out-of-stock {
  opacity: 0.4;
  text-decoration: line-through;
  cursor: not-allowed;
}
.pair-sizes.size-required .pair-size:not(.out-of-stock) {
  border-color: var(--danger);
  color: var(--danger-light);
}
.pair-add {
  min-height: 40px;
  padding: 0 16px;
  border: none;
  border-radius: 10px;
  background: var(--cta);
  color: #0a0a0a;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.pair-add:hover { background: var(--cta-light); }
.pair-add:disabled { opacity: 0.6; cursor: default; }

/* ---- ACCORDIONS (own classes: the global FAQ handler binds at load
   and closes siblings, neither of which suits a product page) ---- */
.acc {
  margin-top: 32px;
  border-top: 1px solid var(--border);
}
.acc-item { border-bottom: 1px solid var(--border); }
.acc-q {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 20px 0;
  background: none;
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: color 0.2s ease;
}
.acc-q:hover { color: var(--accent); }
.acc-icon {
  position: relative;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-left: 16px;
}
.acc-icon::before,
.acc-icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  background: var(--text-muted);
  transform: translate(-50%, -50%);
  transition: transform 0.3s ease;
}
.acc-icon::before { width: 14px; height: 1.5px; }
.acc-icon::after { width: 1.5px; height: 14px; }
.acc-item.is-open .acc-icon::after { transform: translate(-50%, -50%) rotate(90deg); }
.acc-a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease;
}
.acc-a > * { overflow: hidden; }
.acc-item.is-open .acc-a { grid-template-rows: 1fr; }
.acc-a-inner {
  max-width: 60ch;
  padding-bottom: 24px;
  font-size: 15px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.86);
}
.acc-item:not(.is-open) .acc-a-inner { padding-bottom: 0; }
.acc-a-inner p { margin: 0 0 12px; }
.acc-a-inner p:last-child { margin-bottom: 0; }
.acc-a-inner ul,
.acc-a-inner ol { margin: 0 0 12px 18px; }
.acc-a-inner a { color: var(--accent); }
.acc-a-inner .table-scroll {
  margin-bottom: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.acc-a-inner table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.acc-a-inner th,
.acc-a-inner td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
/* Measurements read as a chart when the numbers line up on the right, with
   the label column free to wrap so it fits without scrolling where it can. */
.acc-a-inner th:not(:first-child),
.acc-a-inner td:not(:first-child) { text-align: right; }
.acc-a-inner th:first-child,
.acc-a-inner td:first-child {
  white-space: normal;
  min-width: 84px;
  color: var(--text-secondary);
}
.acc-a-inner th {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ---- RELATED ROW ---- */
.product-related { padding-top: 0; }
/* No scroll-reveal in the row: the slide-up fired as each card swiped in
   from the side, moving cards vertically, and the cards still waiting to
   reveal sat 40px low and gave the row a vertical scroll of its own. */
.product-grid--related .product-card.reveal {
  opacity: 1;
  transform: none;
  transition: none;
}
.product-related .section-heading { margin-bottom: 32px; }

/* ---- LIGHTBOX ---- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.92);
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 92vw;
  max-height: 86vh;
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}
.lightbox-btn {
  position: absolute;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease;
}
.lightbox-btn:hover { background: rgba(255, 255, 255, 0.2); }
.lightbox-close { top: 20px; right: 24px; }
.lightbox-prev { left: 24px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 24px; top: 50%; transform: translateY(-50%); }

/* ---- STORE NAV: no app button on store pages (the store templates drop
   it); keep the desktop links centred without it ---- */
@media (min-width: 769px) {
  .store-page .sticky-nav .nav-links {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }
}

/* ---- ADDED-TO-CART TOAST ---- */
.cart-toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  z-index: 1001;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(440px, calc(100% - 32px));
  padding: 12px 12px 12px 14px;
  border-radius: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.cart-toast[hidden] { display: none; }
.cart-toast { flex-wrap: wrap; }
/* The paired product, offered right after adding the main one. */
.cart-toast-offer {
  flex: 1 0 100%;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.cart-toast-offer[hidden] { display: none; }
.cart-toast-offer-label {
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--text-muted);
}
.cart-toast-offer-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cart-toast-price {
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.3;
  color: var(--text-secondary);
}
.cart-toast-price .price-compare { font-size: 12px; }
.cart-toast-offer-add { flex-shrink: 0; white-space: nowrap; }
.cart-toast.is-shown {
  opacity: 1;
  transform: translate(-50%, 0);
}
.cart-toast-img {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg-section);
}
.cart-toast-img[hidden] { display: none; }
.cart-toast-body { flex: 1; min-width: 0; }
.cart-toast-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--cta);
}
.cart-toast-title {
  margin-top: 2px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-toast-view { flex-shrink: 0; white-space: nowrap; }
.cart-toast-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.cart-toast-close:hover { color: var(--text-primary); }
@media (prefers-reduced-motion: reduce) {
  .cart-toast { transition: none; }
}

/* ---- CART PILL (sits left of back-to-top) ---- */
.cart-pill {
  position: fixed;
  bottom: 32px;
  right: 88px;
  z-index: 999;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 16px 0 14px;
  background: var(--cta);
  color: #0a0a0a;
  border: none;
  border-radius: 50px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease, background 0.2s ease;
}
.cart-pill[hidden] { display: none; }
.cart-pill:hover { background: var(--cta-light); transform: translateY(-2px); }
.cart-pill svg { width: 18px; height: 18px; }
.cart-pill-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: #0a0a0a;
  color: var(--cta);
  font-size: 11px;
  line-height: 20px;
  text-align: center;
}

/* ---- CART DRAWER ---- */
.cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
}
.cart-drawer[aria-hidden="false"] { display: block; }
.cart-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}
.cart-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(440px, 100%);
  display: flex;
  flex-direction: column;
  background: var(--bg-section);
  border-left: 1px solid var(--border);
  box-shadow: -24px 0 64px rgba(0, 0, 0, 0.5);
  transform: translateX(100%);
  animation: cart-slide 0.25s ease forwards;
  padding-bottom: env(safe-area-inset-bottom);
}
@keyframes cart-slide { to { transform: translateX(0); } }
.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.cart-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-transform: uppercase;
  color: var(--text-primary);
}
.cart-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-primary);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.cart-close:hover { border-color: var(--accent); }
.cart-error {
  margin: 16px 24px 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255, 58, 58, 0.1);
  border: 1px solid rgba(255, 58, 58, 0.3);
  color: var(--danger-light);
  font-size: 13px;
  line-height: 1.4;
}
.cart-empty {
  padding: 40px 24px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}
.cart-lines {
  list-style: none;
  margin: 0;
  padding: 8px 24px;
  overflow-y: auto;
  flex: 1;
}
.cart-line {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 14px;
  align-items: start;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.cart-line.busy { opacity: 0.5; pointer-events: none; }
.cart-line-img {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.cart-line-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--text-primary);
}
.cart-line-variant {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-muted);
}
.cart-line-qty {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}
.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.qty-btn:hover { border-color: var(--accent); }
.qty-value {
  min-width: 24px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}
.cart-line-remove {
  margin-left: 8px;
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: underline;
  cursor: pointer;
}
.cart-line-remove:hover { color: var(--danger-light); }
.cart-line-total {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  text-align: right;
}
.cart-line-was {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
}
.cart-line-discount {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--cta);
}
.cart-saving-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--cta);
}
.cart-saving-row[hidden] { display: none; }
.cart-discount {
  display: flex;
  gap: 8px;
  padding: 12px 24px 0;
}
.cart-discount input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  text-transform: uppercase;
}
.cart-discount input:focus { outline: none; border-color: var(--accent); }
.cart-discount-msg {
  padding: 6px 24px 0;
  min-height: 18px;
  font-size: 12px;
  color: var(--text-secondary);
}
.cart-foot {
  padding: 16px 24px 24px;
  border-top: 1px solid var(--border);
}
/* Items subtotal and order-level discount rows (renderCartBreakdown). */
.cart-breakdown {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}
.cart-breakdown[hidden] { display: none; }
.cart-breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  line-height: 1.3;
  color: var(--text-secondary);
}
.cart-breakdown-row.is-discount {
  font-weight: 700;
  color: var(--cta);
}
.cart-subtotal-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 14px;
  color: var(--text-secondary);
}
.cart-subtotal-row strong {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.cart-shipping {
  margin-top: 6px;
  min-height: 18px;
  font-size: 12px;
  color: var(--cta);
}
.cart-checkout {
  display: block;
  width: 100%;
  margin-top: 14px;
  text-align: center;
}
.cart-checkout[aria-disabled="true"] {
  opacity: 0.4;
  pointer-events: none;
}
.cart-keep-shopping {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  border: none;
  background: transparent;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: underline;
  cursor: pointer;
}
.cart-keep-shopping:hover { color: var(--text-primary); }
.cart-note {
  margin: 12px 0 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-muted);
  text-align: center;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 1023px) {
  .product-detail-info { position: static; }
}
@media (max-width: 900px) {
  .product-detail {
    /* minmax(0, ...) or a long thumbnail row or size list widens the column
       past the screen and the whole page drifts sideways on a phone. */
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
    padding: 112px 0 48px;
  }
}
@media (max-width: 768px) {
  .store-hero { min-height: 78vh; }
  .store-hero-content {
    padding-top: 140px;
    padding-bottom: 32px;
  }
  .store-hero h1 { font-size: clamp(48px, 16vw, 72px); }
  .store-hero-intro { font-size: 15px; }
  .product-grid {
    /* minmax(0, ...) so a long title or price can never stretch a column */
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 12px;
  }
  .product-info { padding-top: 10px; }
  .product-name,
  .product-price { font-size: 13px; }
  .product-grid--related {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    /* Sideways only: overflow-x: auto would otherwise make the row scroll
       vertically too, and a horizontal swipe must not drag the page. */
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .product-grid--related::-webkit-scrollbar { display: none; }
  .product-grid--related .product-card {
    flex: 0 0 62%;
    scroll-snap-align: start;
  }
  .product-thumb { width: 56px; height: 56px; }
  .lightbox-prev { left: 12px; }
  .lightbox-next { right: 12px; }
  .cart-pill { bottom: 24px; right: 76px; }
}
@media (max-width: 480px) {
  .product-meta { display: none; }
  .product-card.is-sold-out .product-meta { display: block; }
  .product-badge {
    padding: 5px 8px;
    font-size: 10px;
  }
  .product-badge.badge-sale {
    padding: 4px 7px;
    font-size: 9px;
  }
  .product-detail-title { font-size: 32px; }
  .store-strip {
    font-size: 11px;
    letter-spacing: 1px;
  }
}
