/* =====================================================================
   SOTIB shop — synced product grid (scripts/update_merch.py → shop.html)
   Classes are bdm-* on purpose: style.css already owns legacy .merch-card rules.

   LOOK: mirrors the SOTIB collection page on bestdamnmerch.com —
   black full-bleed catalog, 4-up grid of chromeless 2:3 product photos,
   light Poppins title + "from $25" price underneath, nothing else.
   Tokens (--black, --cream, --pink, --max-w, --gutter, --space-*) come
   from style.css; only the Poppins face is new, and it is scoped here.
   Hover keeps the second-photo swap; no lift, no shadow, no border.
   ===================================================================== */

/* ── Catalog section: full-bleed black band (hero → cream strip → black) ── */
main.shop-container {
  --bdm-fg: #fafafa;                     /* BDM's near-white text */
  --bdm-fg-mute: rgba(250, 250, 250, .62);
  --bdm-rule: rgba(250, 250, 250, .16);
  --bdm-gap: 12px;                       /* BDM column gap is 11px */
  --f-bdm: 'Poppins', 'Cabin', system-ui, sans-serif;

  max-width: none;
  margin: 0;
  background: var(--black);
  color: var(--bdm-fg);
  padding: clamp(40px, 5vw, 64px) var(--gutter) clamp(72px, 10vw, 120px);
}
/* children keep the site's content width inside the full-bleed band */
.shop-container > * { max-width: var(--max-w); margin-left: auto; margin-right: auto; }

.shop-container .shop-section-head { border-bottom-color: var(--bdm-rule); }
.shop-container .eyebrow,
.shop-container .display,
.shop-container .shop-section-meta { color: var(--bdm-fg); }
.shop-container .eyebrow .dot { color: var(--pink); }
.shop-container .shop-section-meta { color: var(--bdm-fg-mute); }

/* ── Grid: 4-up like BDM, tight columns, roomy rows ── */
.bdm-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--bdm-gap);
  row-gap: clamp(36px, 4vw, 56px);
}

/* ── Card: no chrome — photo, title, price ── */
.bdm-card {
  position: relative;
  display: flex;
  flex-direction: column;
  color: var(--bdm-fg);
  text-decoration: none;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.bdm-card:focus-visible { outline: 2px solid var(--bdm-fg); outline-offset: 4px; }

/* BDM crops every product photo to a 2:3 portrait, edge to edge */
.bdm-card__art {
  position: relative;
  aspect-ratio: 2 / 3;
  background: #111;
  overflow: hidden;
}
.bdm-card__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity .45s var(--ease);
}
.bdm-card__img--alt { opacity: 0; }
.bdm-card:hover .bdm-card__img--alt,
.bdm-card:focus-visible .bdm-card__img--alt { opacity: 1; }
.bdm-card__noimg {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: var(--f-bdm);
  font-weight: 300;
  font-size: 13px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--bdm-fg-mute);
}

/* Badges (sold out / sale): quiet white-on-black labels in the BDM key */
.bdm-card__badge {
  position: absolute;
  top: 12px; left: 12px;
  font-family: var(--f-bdm);
  font-weight: 400;
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  padding: 6px 10px;
  background: var(--black); color: var(--bdm-fg);
  z-index: 2;
}
.bdm-card__badge--sale { background: var(--bdm-fg); color: var(--black); }

/* ── Text under the photo: title (Poppins 300 ~20px) then price (~17px) ── */
.bdm-card__body {
  display: flex; flex-direction: column;
  gap: 0;
  padding: 16px 0 0;           /* BDM: 16px from photo to title */
}
.bdm-card__name {
  font-family: var(--f-bdm);
  font-weight: 300;
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.5;
  letter-spacing: 0;
  margin: 0 0 4px;             /* BDM: 4px title → price */
  color: var(--bdm-fg);
  font-variation-settings: normal;
}
.bdm-card__blurb { display: none; }            /* BDM shows no description in the grid */
/* The script emits "<price> · <sizes>" with a bare " · " text node between them.
   Sizes are hidden (they live on the BDM product page), so the wrapper is
   zeroed and only the price span gets a size — that swallows the stray dot. */
.bdm-card__meta {
  display: block;
  margin: 0;
  font-size: 0; line-height: 0;
  letter-spacing: 0; text-transform: none;
  color: var(--bdm-fg);
}
.bdm-card__sizes { display: none; }
.bdm-card__price {
  display: inline-block;
  font-family: var(--f-bdm);
  font-weight: 300;
  font-size: clamp(15px, 1.35vw, 17px);
  line-height: 1.5;
  letter-spacing: 0;
  color: var(--bdm-fg);
}
.bdm-card__price--sale s { color: var(--bdm-fg-mute); margin-right: 6px; }

/* The Buy pill is markup the sync script emits for every card; BDM's grid
   has no button, so it is hidden here. The whole card is the link. */
.bdm-card__cta { display: none; }

/* Sold out: photo goes quiet */
.bdm-card--out .bdm-card__img { filter: grayscale(.7); opacity: .6; }
.bdm-card--out .bdm-card__name,
.bdm-card--out .bdm-card__price { color: var(--bdm-fg-mute); }

/* ── Footnote under the grid ── */
.bdm-foot {
  margin-top: var(--space-lg);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--bdm-rule);
  font-family: var(--f-body);
  font-size: 14px; line-height: 1.6;
  color: var(--bdm-fg-mute);
  width: min(72ch, 100%);
  /* sit flush with the grid's left edge, even when the band is wider than --max-w */
  margin-left: max(0px, calc((100% - var(--max-w)) / 2));
}
.bdm-foot a { color: var(--bdm-fg); text-decoration: underline; text-underline-offset: 3px; }
.bdm-foot a:hover { color: var(--pink); }

/* ── Breakpoints: BDM is 4-up on desktop and 2-up on phones ── */
@media (max-width: 1100px) {
  .bdm-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .bdm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 10px; row-gap: 32px; }
  .bdm-card__name { font-size: 16px; }
  .bdm-card__price { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .bdm-card__img { transition: none; }
}

/* =====================================================================
   HOME PAGE — product carousel (index.html, inside #listen)
   Full-bleed black strip that pans left on its own; the whole strip is
   one link to the Best Damn Merch collection. Tiles are generated by
   scripts/update_merch.py (each product twice, second set aria-hidden)
   so a translateX(-50%) loop has no seam. Pauses on hover.
   ===================================================================== */
#listen { overflow: hidden; }                /* clips the full-bleed strip */
.merch-strip {
  --strip-w: 240px; --strip-gap: 12px; --strip-dur: 52s;
  display: block;
  /* first thing in #listen: pull up through the section's top padding so the strip
     sits flush under the hero, then leave room before "Listen anywhere." */
  margin: calc(-1 * clamp(96px, 12vw, 160px)) calc(50% - 50vw) clamp(56px, 7vw, 96px);
  border-top: 1px solid rgba(255,255,255,0.14);
  padding: 20px 0;
  background: var(--black);
  color: var(--cream);
  text-decoration: none;
  overflow: hidden;
}
.merch-strip__head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 0 var(--gutter) 16px;
  font-family: var(--f-util);
  font-size: 11px; letter-spacing: .24em; text-transform: uppercase;
  color: var(--lime);
}
.merch-strip__head .dot { color: var(--pink); margin: 0 6px; }
.merch-strip__cta { color: var(--cream); white-space: nowrap; }
.merch-strip:hover .merch-strip__cta { color: var(--pink); }
.merch-strip__track {
  display: flex; gap: var(--strip-gap);
  width: max-content;
  animation: merchStrip var(--strip-dur) linear infinite;
  will-change: transform;
}
.merch-strip:hover .merch-strip__track,
.merch-strip:focus-visible .merch-strip__track { animation-play-state: paused; }
.merch-strip:focus-visible { outline: 2px solid var(--lime); outline-offset: -2px; }
@keyframes merchStrip { to { transform: translateX(calc(-50% - var(--strip-gap) / 2)); } }

.merch-strip__item { flex: none; width: var(--strip-w); margin: 0; }
.merch-strip__img,
.merch-strip__noimg {
  display: block; width: 100%; height: auto;   /* height:auto lets aspect-ratio beat the height= attribute */
  aspect-ratio: 4 / 5;
  object-fit: cover; background: #111;
}
.merch-strip__cap {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 10px 2px 0;
  font-family: var(--f-util);
  font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--cream);
  white-space: nowrap;
}
.merch-strip__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.merch-strip__price { color: var(--lime); flex: none; }

@media (max-width: 760px) {
  .merch-strip { --strip-w: 150px; --strip-gap: 10px; --strip-dur: 36s; padding: 14px 0; }
  .merch-strip__cap { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .merch-strip__track { animation: none; }
  .merch-strip { overflow-x: auto; }        /* still browsable by hand */
}
