/* ═══════════════════════════════════════════════════════════════════
   MERCH ADD-ON BAND — mounts under the pricing grid on ticket pages
   (on-camera-intensive, the-on-camera-acting-intensive). Self-contained
   tokens so it sits cleanly on either page's stylesheet.
   ═══════════════════════════════════════════════════════════════════ */
.mad {
  color-scheme: dark;
  container-type: inline-size;
  --mad-bg: #17171E;
  --mad-line: rgba(255, 255, 255, 0.1);
  --mad-ink: #F4F2EE;
  --mad-ink-2: #ABABB4;
  --mad-ink-3: #6E6E78;
  --mad-accent: #A375FF;
  --mad-display: 'Anton', Impact, sans-serif;
  --mad-mono: 'Martian Mono', ui-monospace, Menlo, monospace;
  position: relative; margin: 2.5rem auto 0; max-width: 1100px;
  border: 1px solid var(--mad-line); border-radius: 14px; background: var(--mad-bg); overflow: hidden;
  color: var(--mad-ink); text-align: left;
}
.mad::before { content: ''; position: absolute; inset: 0; background: radial-gradient(60% 80% at 100% 0%, rgba(163, 117, 255, 0.16), transparent 60%); pointer-events: none; }
.mad__head { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; padding: 1.4rem 1.5rem 0.75rem; flex-wrap: wrap; }
.mad__kicker { margin: 0 0 0.35rem; font-family: var(--mad-mono); font-size: 0.66rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--mad-accent); font-weight: 600; }
.mad__title { margin: 0; font-family: var(--mad-display); font-weight: 400; text-transform: uppercase; font-size: clamp(1.6rem, 3.2vw, 2.3rem); line-height: 0.95; letter-spacing: 0.01em; }
.mad__sub { margin: 0.4rem 0 0; color: var(--mad-ink-2); font-size: 0.9rem; max-width: 52ch; }
.mad__link { font-family: var(--mad-mono); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mad-ink-2); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.mad__link:hover { color: var(--mad-ink); }
/* Four pieces sit two by two; one column under 900px (viewport or container, below). */
.mad__grid { position: relative; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--mad-line); border-top: 1px solid var(--mad-line); }
.mad__item { background: var(--mad-bg); padding: 1.1rem 1.25rem 1.25rem; display: grid; grid-template-columns: 96px 1fr; gap: 0.9rem 1rem; align-items: start; transition: background 0.25s, grid-template-columns 0.45s cubic-bezier(0.16, 1, 0.3, 1); }
.mad__item.is-on { background: #1E1E27; box-shadow: inset 0 0 0 1px rgba(163, 117, 255, 0.55); }
/* Mini stage: the garment frame plus one dot per angle (front and back). Hover (or a tap on
   touch) adds .is-zoom on the item: the image column widens (grid-template-columns animates)
   so the garment grows to about twice the size and turns front / back without covering
   the name, price, swatches or the Add button. */
.mad__stage { position: relative; width: 96px; aspect-ratio: 96 / 116; height: auto; grid-row: span 3; cursor: zoom-in; transition: width 0.45s cubic-bezier(0.16, 1, 0.3, 1); }
.mad__thumb { width: 100%; height: 100%; object-fit: contain; display: block; filter: drop-shadow(0 14px 20px rgba(0, 0, 0, 0.5)); transition: filter 0.4s; }
.mad__dots { position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%); display: flex; gap: 7px; padding: 4px 6px; border-radius: 999px; background: rgba(10, 10, 14, 0.55); opacity: 0; transition: opacity 0.25s; }
.mad__dots i { display: block; width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, 0.4); cursor: pointer; transition: background 0.2s, transform 0.2s; }
.mad__dots i.is-on { background: var(--mad-accent); transform: scale(1.25); }
/* The zoom column is capped at about half the card so the text column survives in narrow hosts (the
   bonus-upgrade page mounts the band in a 640px container). */
.mad__item.is-zoom { grid-template-columns: clamp(96px, 58%, 200px) 1fr; }
.mad__item.is-zoom .mad__stage { width: 100%; cursor: zoom-out; }
.mad__item.is-zoom .mad__thumb { filter: drop-shadow(0 22px 30px rgba(0, 0, 0, 0.6)); }
.mad__item.is-zoom .mad__dots, .mad__stage:hover .mad__dots { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .mad__item, .mad__stage, .mad__thumb { transition: none; }
}
.mad__name { margin: 0; font-family: var(--mad-display); font-weight: 400; text-transform: uppercase; font-size: 1.15rem; line-height: 1; letter-spacing: 0.02em; }
.mad__price { margin: 0.2rem 0 0; font-family: var(--mad-mono); font-size: 0.85rem; color: var(--mad-ink-2); }
.mad__price b { color: var(--mad-ink); font-weight: 600; }
.mad__opts { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.mad__sw { display: inline-flex; flex-wrap: wrap; gap: 0.4rem; max-width: 100%; }
.mad__sw button { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.2); padding: 0; position: relative; cursor: pointer; }
.mad__sw button.is-on::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid var(--mad-accent); }
/* One rule per catalog colour key. The dark stop is PODpartner's own hex for the blank
   (MERCH_COLOR_HEX in _shared/merch-catalog.ts); the light stop is that hex mixed 22% toward white. */
.mad__sw [data-color="dark-pink"] { background: linear-gradient(145deg, #ff6c9a, #ff427e); }
.mad__sw [data-color="shadow-blue"] { background: linear-gradient(145deg, #81adc8, #5e96b9); }
.mad__sw [data-color="cactus-green"] { background: linear-gradient(145deg, #74957f, #4d775b); }
.mad__sw [data-color="brown"] { background: linear-gradient(145deg, #8c7a6c, #6b5543); }
.mad__sw [data-color="khaki"] { background: linear-gradient(145deg, #cfbeae, #c2ac97); }
.mad__sw [data-color="dark-byzantine-blue"] { background: linear-gradient(145deg, #525464, #212438); }
.mad__sw [data-color="smoky-black"] { background: linear-gradient(145deg, #525050, #211f1f); }
.mad__sw [data-color="mineral-green"] { background: linear-gradient(145deg, #47625a, #13362c); }
.mad__sw [data-color="dark-gray"] { background: linear-gradient(145deg, #626262, #363636); }
.mad__sw [data-color="rifle-green"] { background: linear-gradient(145deg, #7c8275, #575f4e); }
.mad__sw [data-color="pastel-blue"] { background: linear-gradient(145deg, #97c7dd, #7ab7d4); }
.mad__sw [data-color="dark-lavender"] { background: linear-gradient(145deg, #a484b6, #8a61a1); }
.mad__sw [data-color="watermelon-pink"] { background: linear-gradient(145deg, #e07e8e, #d7596e); }
.mad__size { appearance: none; -webkit-appearance: none; background: transparent; border: 1px solid rgba(255, 255, 255, 0.2); color: var(--mad-ink); border-radius: 4px; padding: 0.35rem 1.7rem 0.35rem 0.6rem; font-family: var(--mad-mono); font-size: 0.72rem; letter-spacing: 0.06em; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%23A0A0A8' stroke-width='1.5'/></svg>"); background-repeat: no-repeat; background-position: right 0.55rem center; }
.mad__size.is-missing { border-color: var(--mad-accent); }
.mad__size option { color: var(--mad-ink); background: var(--mad-bg); }
.mad__stage:focus-visible { outline: 2px solid var(--mad-accent); outline-offset: 4px; border-radius: 6px; }
.mad--modal.is-busy .mad__grid { pointer-events: none; opacity: 0.75; }
.mad__add { grid-column: 2; justify-self: start; display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.6rem 0.95rem; border-radius: 4px; border: 1px solid rgba(255, 255, 255, 0.22); background: transparent; color: var(--mad-ink); font-family: var(--mad-mono); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; cursor: pointer; transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.3s; }
.mad__add:hover { border-color: var(--mad-ink); transform: translateY(-1px); }
.mad__item.is-on .mad__add { background: var(--mad-ink); color: #0A0A0C; border-color: var(--mad-ink); }
.mad__item.is-on .mad__add::before { content: '✓'; }
.mad__foot { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.9rem 1.5rem; border-top: 1px solid var(--mad-line); font-family: var(--mad-mono); font-size: 0.7rem; letter-spacing: 0.08em; color: var(--mad-ink-2); flex-wrap: wrap; }
.mad__foot b { color: var(--mad-ink); font-weight: 600; }
.mad__foot .mad__set { color: #D9B8FF; }
@media (max-width: 900px) {
  .mad__grid { grid-template-columns: 1fr; }
  .mad__item.is-zoom { grid-template-columns: clamp(96px, 58%, 200px) 1fr; }
}
@media (max-width: 560px) {
  .mad__item { grid-template-columns: 76px 1fr; }
  .mad__stage { width: 76px; }
  .mad__item.is-zoom { grid-template-columns: clamp(76px, 58%, 128px) 1fr; }
}


/* ── Modal variant: the same band inside the ticket page's .pro-upsell shell ──
   Opens right before Stripe (after the Pro Track decision and the bonus-class step). */
.pro-upsell--merch { opacity: 0; transition: opacity 0.22s ease-out; }
.pro-upsell--merch.is-in { opacity: 1; }
.pro-upsell--merch .mad-modal__card { max-width: 980px; background: #12121A; color: #F4F2EE; border-radius: 18px; overflow: visible; transform: translateY(24px) scale(0.98); transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1); box-shadow: 0 40px 120px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.08); }
.pro-upsell--merch.is-in .mad-modal__card { transform: none; }
.mad-modal__close { position: absolute; top: 12px; right: 12px; z-index: 6; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(18, 18, 26, 0.9); color: #F4F2EE; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: border-color 0.15s, background 0.15s; }
.mad-modal__close:hover { border-color: #F4F2EE; background: #1E1E27; }
.mad-modal__body { max-height: calc(94vh - 118px); overflow-y: auto; border-radius: 18px 18px 0 0; }
.mad.mad--modal { margin: 0; border: 0; border-radius: 18px 18px 0 0; max-width: none; background: transparent; overflow: visible; }
.mad--modal .mad__head { padding-right: 64px; }
.mad--modal .mad__link { display: none; }
.mad-modal__actions { display: flex; flex-direction: column; align-items: stretch; gap: 10px; padding: 14px 20px 18px; border-top: 1px solid rgba(255, 255, 255, 0.1); background: #12121A; border-radius: 0 0 18px 18px; }
.mad-modal__error { display: none; margin: 0; padding: 8px 12px; border-radius: 6px; background: rgba(255, 90, 90, 0.12); color: #ffb4b4; font-family: var(--mad-mono, ui-monospace, monospace); font-size: 0.78rem; }
.mad-modal__go { width: 100%; border: 0; border-radius: 6px; padding: 16px 20px; background: #F4F2EE; color: #0A0A0C; font-family: 'Anton', Impact, sans-serif; font-weight: 400; font-size: clamp(17px, 4.5vw, 20px); letter-spacing: 0.04em; text-transform: uppercase; cursor: pointer; transition: transform 0.15s, filter 0.15s; }
.mad-modal__go:hover { filter: brightness(1.05); transform: translateY(-1px); }
.mad-modal__go:disabled, .mad-modal__skip:disabled { opacity: 0.6; cursor: default; transform: none; }
.mad-modal__skip { align-self: center; background: transparent; border: 0; color: #ABABB4; font-family: var(--mad-mono, ui-monospace, monospace); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; text-decoration: underline; text-underline-offset: 3px; padding: 6px 10px; cursor: pointer; }
.mad-modal__skip:hover { color: #F4F2EE; }
@media (max-width: 900px) {
  .pro-upsell--merch .mad-modal__card { max-width: 560px; }
}

/* The band's own width decides the layout when a host page mounts it in a narrow column
   (bonus-upgrade.html uses a 640px container). Same rules as the viewport queries above. */
@container (max-width: 900px) {
  .mad__grid { grid-template-columns: 1fr; }
  .mad__item.is-zoom { grid-template-columns: clamp(96px, 58%, 200px) 1fr; }
}
@container (max-width: 560px) {
  .mad__item { grid-template-columns: 76px 1fr; }
  .mad__stage { width: 76px; }
  .mad__item.is-zoom { grid-template-columns: clamp(76px, 58%, 128px) 1fr; }
}
