/* ============================================================
   CRAZY RARI — live store (grid, product view, bag)
   Loaded only by store.html, after styles.css.

   Two references, on purpose:
   - SSENSE: white page, small quiet type, category list down the left,
     borderless product grid, black rectangular buttons.
   - Official anime merch pages: a loud art band up top with a torn edge,
     the title on a black ink slab, pill tags on products.
   The band is the one loud thing. Everything under it stays quiet.
   ============================================================ */

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
body.is-locked { overflow: hidden; }

/* ---------- light theme, only once the store is live ---------- */
body.store-live { background: var(--paper-page); }
body.store-live .footer { background: #08080a; }
body.store-live .nav { position: absolute; }
@media (min-width: 821px) {
  body.store-live .nav__links a { color: rgba(255,255,255,.82); }
  body.store-live .nav__links a:hover,
  body.store-live .nav__links a.is-active { color: #fff; }
}
body.store-live .nav__burger span { background: #fff; }

.shop, .pdp, .bag {
  --s-ink: #000;
  --s-paper: var(--paper-page);
  --s-rule: var(--rule-page);
  --s-mute: #757575;
  --s-red: #f40d30;
  --s-gut: clamp(1rem, 2.6vw, 2.5rem);
  font-family: var(--font-body); font-size: .78rem; line-height: 1.5; color: var(--s-ink);
}
.shop { background: var(--s-paper); min-height: 100vh; padding-bottom: 6rem; }
:where(.shop, .pdp, .bag) button { font: inherit; color: inherit; }
.shop button:focus-visible, .shop a:focus-visible, .pdp button:focus-visible, .pdp a:focus-visible, .pdp summary:focus-visible, .bag button:focus-visible {
  outline: 2px solid var(--s-red); outline-offset: 2px;
}

/* ---------- the band ---------- */
.band { position: relative; height: clamp(210px, 30vw, 360px); background: var(--s-red); margin-bottom: clamp(2.2rem, 5vw, 4rem); }
.band__art { position: absolute; inset: 0; overflow: hidden;
  background: url("assets/ep2.jpg") center 32% / cover no-repeat;
  filter: grayscale(1) contrast(1.35); mix-blend-mode: multiply; }
.band::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0,0,0,.78) 0%, rgba(0,0,0,.25) 42%, rgba(0,0,0,0) 70%),
    radial-gradient(rgba(0,0,0,.5) 1.1px, transparent 1.6px) 0 0 / 6px 6px; }
.band__tear { position: absolute; left: 0; right: 0; bottom: -1px; z-index: 2; width: 100%; height: clamp(22px, 4vw, 56px); display: block; }
.band__tear path { fill: var(--s-paper); }
.band__title { position: absolute; z-index: 3; left: var(--s-gut); bottom: clamp(-1.6rem, -2.4vw, -.9rem); transform: rotate(-3deg); transform-origin: left bottom; }
.band__title span {
  display: block; background: #000; color: #fff;
  font-family: var(--font-display); font-weight: 900; text-transform: uppercase; line-height: .9;
  font-size: clamp(2.8rem, 8.4vw, 6.6rem); letter-spacing: -.01em;
  padding: .16em .42em .1em .34em;
  /* rough ink slab */
  clip-path: polygon(1% 9%, 12% 2%, 27% 7%, 44% 0, 61% 6%, 79% 1%, 93% 7%, 100% 3%, 98% 38%, 100% 71%, 96% 96%, 82% 91%, 66% 100%, 49% 93%, 31% 99%, 15% 92%, 3% 98%, 0 63%, 2% 34%);
}

/* ---------- sticky bar: count + bag ---------- */
.shop__bar { position: sticky; top: 0; z-index: 60; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .85rem var(--s-gut); background: var(--s-paper); border-bottom: 1px solid var(--s-rule);
  text-transform: uppercase; letter-spacing: .04em; }
.shop__count { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; color: var(--s-mute); }
.bag-btn { white-space: nowrap; flex: none; background: none; border: 0; padding: .3rem 0; text-transform: uppercase; letter-spacing: .04em; font-weight: 500; }
.bag-btn:hover { text-decoration: underline; text-underline-offset: 4px; }
.bag-btn.has-items { font-weight: 700; color: var(--s-red); }

/* ---------- pill tags ---------- */
.tag { display: inline-block; font-family: "Big Shoulders Display", var(--font-ui); font-weight: 800; font-size: .72rem; line-height: 1;
  text-transform: uppercase; letter-spacing: .06em; color: #fff; background: #000; border: 1.5px solid #000;
  padding: .28em .7em .24em; border-radius: 20px; }
.tag--hot { background: var(--s-red); border-color: var(--s-red); }
.tag--line { background: transparent; color: #000; }

/* ---------- body: category rail + grid ---------- */
.shop__body { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: var(--s-gut); padding: clamp(1.4rem, 3vw, 2.6rem) var(--s-gut) 0; }
.shop__rail[hidden] + .shop__main { grid-column: 1 / -1; }
.shop__rail { position: sticky; top: 4.2rem; align-self: start; }
.rail__h { font-size: inherit; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-bottom: .5rem; }
.shop__filters { display: flex; flex-direction: column; align-items: flex-start; }
.cat { background: none; border: 0; padding: .16rem 0; text-transform: uppercase; letter-spacing: .02em; text-align: left; }
.cat:hover, .cat[aria-pressed="true"] { text-decoration: underline; text-underline-offset: 4px; }
.cat[aria-pressed="true"] { font-weight: 600; }
.shop__note { color: var(--s-mute); text-transform: uppercase; padding: 3rem 0; }

.shop__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(2.2rem, 4vw, 3.6rem) clamp(.9rem, 2.2vw, 2rem); }
.pcard { display: block; color: inherit; }
.pcard__media { position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: transparent;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease); }
.pcard__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .25s; }
.pcard__img--alt { opacity: 0; }
/* the pop-out */
.pcard:hover .pcard__media, .pcard:focus-visible .pcard__media { transform: translate(-5px, -5px); box-shadow: 0 0 0 1.5px #000, 9px 9px 0 var(--s-red); }
.pcard:hover .pcard__img--alt { opacity: 1; }
.pcard:focus-visible { outline: none; }
.pcard__meta { padding-top: .75rem; }
.pcard__name { font-size: inherit; font-weight: 500; line-height: 1.4; }
.pcard__price { font-variant-numeric: tabular-nums; }
.pcard__from { color: var(--s-mute); }
.pcard__price s, .pdp__price s { color: var(--s-mute); margin-left: .5em; }
.pcard__tags { display: flex; gap: .3rem; margin-top: .45rem; }
.pcard.is-out .pcard__img { filter: grayscale(1); opacity: .4; }
.pcard.is-out .pcard__name, .pcard.is-out .pcard__price { color: var(--s-mute); }
.pcard--ghost { aspect-ratio: 1 / 1.18; background: linear-gradient(100deg, #f3f3f3 30%, #fafafa 50%, #f3f3f3 70%); background-size: 300% 100%; animation: ghost 1.3s linear infinite; }
@keyframes ghost { to { background-position: -150% 0; } }

/* ---------- shared controls ---------- */
.sbtn { display: flex; align-items: center; justify-content: center; width: 100%; height: 48px; padding: 0 1.2rem;
  background: #000; color: #fff; border: 0; border-radius: 0;
  text-transform: uppercase; letter-spacing: .08em; font-weight: 600; transition: background .15s; }
.sbtn:hover { background: var(--s-red); }
.sbtn:disabled { background: #d0d0d0; color: #6b6b6b; }
.pdp__close { width: 40px; height: 40px; flex: none; display: grid; place-items: center; font-size: 1.5rem; line-height: 1;
  background: #fff; color: #000; border: 1px solid #000; border-radius: 50%; transition: background .15s, color .15s; }
.pdp__close:hover { background: #000; color: #fff; }
.qty { display: inline-flex; align-items: center; border: 1px solid #c9c9c9; height: 48px; }
.qty__btn { width: 40px; height: 100%; background: none; border: 0; font-size: 1rem; }
.qty__btn:hover { background: #f1f1f1; }
.qty__val { min-width: 1.8rem; text-align: center; font-variant-numeric: tabular-nums; }
.qty.is-off { opacity: .35; pointer-events: none; }
.qty--sm { height: 32px; }
.qty--sm .qty__btn { width: 30px; }

/* ---------- product view ---------- */
.pdp { position: fixed; inset: 0; z-index: 200; overflow-y: auto; overscroll-behavior: contain; background: var(--paper-page); opacity: 0; transition: opacity .2s; }
.pdp.is-open { opacity: 1; }
.pdp__panel { max-width: 1500px; margin: 0 auto; }
.pdp__panel > .pdp__close { position: fixed; top: 1rem; right: max(1rem, calc((100vw - 1500px) / 2 + 1rem)); z-index: 3; }
.pdp__grid { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(0, 1.55fr) minmax(250px, 1fr);
  gap: clamp(1.5rem, 4vw, 4.5rem); padding: clamp(4.5rem, 9vh, 7rem) var(--s-gut) 5rem; }
.pdp__about, .pdp__buybox { position: sticky; top: clamp(4.5rem, 9vh, 7rem); align-self: start; }
.pdp__brand { text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.pdp__title { font-family: var(--font-display); font-weight: 900; text-transform: uppercase; font-size: clamp(1.9rem, 2.7vw, 2.9rem); line-height: .95; margin-top: .5rem; overflow-wrap: anywhere; }
.pdp__desc { margin-top: 1.5rem; max-width: 46ch; }
.pdp__desc > * + * { margin-top: .7em; }
.pdp__desc ul, .pdp__desc ol { padding-left: 1.1rem; }
.pdp__desc a { text-decoration: underline; text-underline-offset: 3px; }
.pdp__desc h3, .pdp__desc h4, .pdp__desc h5, .pdp__desc h6 { font-size: inherit; text-transform: uppercase; letter-spacing: .04em; }
.pdp__more { border-top: 1px solid var(--s-rule); margin-top: 1.4rem; max-width: 46ch; }
.pdp__more + .pdp__more { margin-top: 0; }
.pdp__more:last-child { border-bottom: 1px solid var(--s-rule); }
.pdp__more summary { display: flex; justify-content: space-between; padding: .8rem 0; list-style: none; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.pdp__more summary::-webkit-details-marker { display: none; }
.pdp__more summary::after { content: "+"; }
.pdp__more[open] summary::after { content: "\2212"; }
.pdp__more .pdp__desc { margin: 0; padding-bottom: 1rem; }

.pdp__stage { aspect-ratio: 1 / 1; background: transparent; overflow: hidden; display: grid; place-items: center; }
.pdp__img { width: 100%; height: 100%; object-fit: cover; }
.pdp__noimg { font-family: var(--font-display); font-size: 5rem; color: #e6e6e6; }
.pdp__thumbs { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.pdp__thumb { width: 64px; height: 64px; padding: 0 0 4px; background: none; border: 0; border-bottom: 2px solid transparent; opacity: .55; transition: opacity .15s; }
.pdp__thumb img { width: 100%; height: 100%; object-fit: cover; }
.pdp__thumb:hover, .pdp__thumb.is-on { opacity: 1; }
.pdp__thumb.is-on { border-bottom-color: #000; }

.pdp__price { font-size: 1rem; font-weight: 600; font-variant-numeric: tabular-nums; min-height: 1.5em; }
.pdp__opts { margin-top: 1.3rem; display: grid; gap: 1.2rem; }
.opt__label { text-transform: uppercase; letter-spacing: .04em; color: var(--s-mute); margin-bottom: .5rem; }
.opt__label span { color: #000; margin-left: .5rem; }
.opt__row { display: flex; flex-wrap: wrap; gap: .4rem; }
.opt__btn { min-width: 46px; height: 40px; padding: 0 .8rem; background: #fff; border: 1px solid #c9c9c9; transition: border-color .15s; }
.opt__btn:hover { border-color: #000; }
.opt__btn[aria-pressed="true"] { background: #000; color: #fff; border-color: #000; }
.opt__btn.is-na { color: #a9a9a9; text-decoration: line-through; }
.opt__btn.is-na[aria-pressed="true"] { background: #ededed; border-color: #a9a9a9; }
.opt__btn:disabled { opacity: .4; }
.opt__swatch { width: 28px; height: 28px; padding: 0; border-radius: 50%; background: var(--sw, #888); border: 1px solid #b5b5b5; margin: 4px; }
.opt__swatch[aria-pressed="true"] { outline: 1.5px solid #000; outline-offset: 3px; }
.pdp__buy { display: flex; gap: .5rem; margin-top: 1.6rem; }
.pdp__add { flex: 1; width: auto; }
.pdp__hint { color: var(--s-mute); margin-top: .8rem; min-height: 1.5em; }
.pdp__hint.is-err { color: var(--s-red); }

/* ---------- bag drawer ---------- */
.bag { position: fixed; inset: 0; z-index: 210; background: rgba(0,0,0,0); transition: background .25s; }
.bag.is-open { background: rgba(0,0,0,.28); }
.bag__panel { position: absolute; inset: 0 0 0 auto; width: min(100%, 420px); display: flex; flex-direction: column;
  background: var(--paper-page); border-left: 1px solid #000; transform: translateX(100%); transition: transform .28s var(--ease); }
.bag.is-open .bag__panel { transform: none; }
.bag__head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.3rem; border-bottom: 1px solid var(--s-rule); }
.bag__title { font-size: inherit; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.bag__list { list-style: none; flex: 1; overflow-y: auto; padding: 0 1.3rem; transition: opacity .2s; }
.bag.is-busy .bag__list { opacity: .45; pointer-events: none; }
.bag__empty { text-align: center; color: var(--s-mute); padding: 4rem 0; }
.bag__empty-big { font-family: var(--font-display); font-weight: 900; text-transform: uppercase; font-size: 3rem; color: #e9e9e9; line-height: 1; margin-bottom: .5rem; }
.line { display: grid; grid-template-columns: 80px minmax(0, 1fr) auto; gap: 1rem; padding: 1.1rem 0; border-bottom: 1px solid var(--s-rule); }
.line__img { width: 80px; height: 80px; background: #f6f6f6; overflow: hidden; }
.line__img img { width: 100%; height: 100%; object-fit: cover; }
.line__name { font-weight: 500; line-height: 1.4; }
.line__sub { color: var(--s-mute); }
.line__mid .qty { margin-top: .6rem; }
.line__end { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; }
.line__price { font-variant-numeric: tabular-nums; }
.line__rm, .bag__keep { background: none; border: 0; color: var(--s-mute); text-decoration: underline; text-underline-offset: 3px; padding: .3rem 0; }
.line__rm:hover, .bag__keep:hover { color: #000; }
.bag__foot { padding: 1.2rem 1.3rem 1.4rem; border-top: 1px solid #000; }
.bag__row { display: flex; justify-content: space-between; align-items: baseline; text-transform: uppercase; letter-spacing: .04em; }
.bag__row strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.bag__fine { color: var(--s-mute); margin-top: .2rem; }
.bag__msg { color: var(--s-red); min-height: 1.2em; margin-top: .4rem; }
.bag__go { margin-top: .5rem; height: 52px; }
.bag__keep { display: block; margin: .8rem auto 0; }

/* ---------- narrower screens ---------- */
@media (max-width: 1250px) { .shop__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .shop__body { grid-template-columns: minmax(0, 1fr); }
  .shop__rail { position: static; }
  .rail__h { display: none; }
  .shop__filters { flex-direction: row; flex-wrap: wrap; gap: .4rem; }
  .cat { border: 1.5px solid #000; border-radius: 20px; padding: .35rem .85rem; }
  .cat:hover, .cat[aria-pressed="true"] { text-decoration: none; }
  .cat[aria-pressed="true"] { background: #000; color: #fff; }
  .shop__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pcard:hover .pcard__media { transform: translate(-3px, -3px); box-shadow: 0 0 0 1.5px #000, 6px 6px 0 var(--s-red); }

  .pdp__grid { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0 var(--s-gut) 4rem; }
  .pdp__about { display: contents; }
  .pdp__gallery { order: 1; margin: 0 calc(var(--s-gut) * -1); }
  .pdp__thumbs { padding: 0 var(--s-gut); }
  .pdp__head { order: 2; margin-top: 1.4rem; }
  .pdp__buybox { order: 3; position: static; margin-top: 1rem; }
  .pdp__about > .pdp__desc { order: 4; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--s-rule); max-width: none; }
  .pdp__more { order: 5; max-width: none; }
  .bag__panel { border-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .pcard--ghost { animation: none; }
  .pcard__media, .pcard__img, .pdp, .bag, .bag__panel { transition: none; }
}
