/* Store: basket in the nav, card actions, map pages with gallery, basket drawer, lightbox.
   Uses the tokens and the 45 degree cut from site.css. */
:root {
  --stage: #07090D;
  --danger: #FF7A7A;
  --scrim: rgba(5, 7, 10, .62);
  --chamfer: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}

.nav__actions { display: flex; align-items: center; gap: 10px; }
.nav__links + .nav__actions { margin-left: 0; }
.basket-btn {
  --cut: 8px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 14px 0 16px;
  border: 0;
  background: rgba(245, 247, 250, .09);
  color: var(--fg);
  font: 650 14px/1 var(--body);
  font-stretch: 112%;
  letter-spacing: .03em;
  cursor: pointer;
  clip-path: var(--chamfer);
  transition: background .2s;
}
.basket-btn:hover { background: rgba(245, 247, 250, .16); }
.basket-btn .count {
  min-width: 22px;
  padding: 4px 6px;
  background: var(--accent);
  font: 500 12px/1 var(--mono);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 760px) { .nav .btn { display: none; } .nav__actions { margin-left: auto; } }

.price { font: 750 18px/1 var(--display); font-stretch: 112%; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--fg); }
.price s { margin-right: .35em; font-size: .75em; color: var(--faint); }
.price.big { font-size: 34px; }

.card__title a, .card__media { color: inherit; text-decoration: none; }
.card__title a:hover { color: var(--accent-text); }
.card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: auto;
  padding-top: 10px;
}
.card__actions .price { margin-right: auto; }
.card__actions .card__link { align-self: center; margin-top: 0; padding-top: 0; }

/* Map page */
.product-page { padding-top: calc(72px + env(safe-area-inset-top, 0px)); }
.crumbs {
  display: flex;
  gap: 10px;
  padding-block: 28px 4px;
  font: 500 12px/1.4 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
}
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--fg); }
.product {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
  padding-block: 22px clamp(48px, 6vw, 80px);
}
.p-media { min-width: 0; }
.p-buy { display: grid; gap: 14px; align-content: start; position: sticky; top: calc(88px + env(safe-area-inset-top, 0px)); }
.p-buy h1 {
  margin: 0;
  font: 800 clamp(32px, 4vw, 52px)/1.02 var(--display);
  font-stretch: 125%;
  text-transform: uppercase;
  text-wrap: balance;
}
.p-place { margin: 0; color: var(--accent-text); font-size: 15px; font-weight: 550; }
.p-buy .lede { font-size: 16px; }
.p-buy .stats { margin: 4px 0 0; }
.buyrow { display: grid; gap: 14px; padding-block: 16px; border-bottom: 1px solid var(--line); }
.buy-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.fine { margin: 0; font-size: 13px; line-height: 1.55; color: var(--faint); }
.fine a { color: var(--muted); }
.install { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font: 500 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
.install code { padding: 8px 12px; background: var(--surface); color: var(--fg); font: 500 13px/1 var(--mono); letter-spacing: 0; text-transform: none; }

.details {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
  padding-block: clamp(44px, 5vw, 64px) clamp(64px, 8vw, 110px);
  border-top: 1px solid var(--line);
}
.prose { display: grid; gap: clamp(28px, 3.4vw, 40px); }
.prose section { display: grid; gap: 10px; }
.prose h2 { font-size: clamp(20px, 2.2vw, 26px); }
.prose p { margin: 0; max-width: 64ch; color: var(--muted); }
.glance {
  display: grid;
  gap: 16px;
  padding: 24px;
  background: var(--surface);
  clip-path: var(--chamfer);
}
.glance h2 { font-size: 15px; letter-spacing: .08em; }
.glance dl { display: grid; margin: 0; }
.glance dl > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.glance dt { font: 500 11px/1.5 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.glance dd { margin: 0; font-size: 14px; color: var(--fg); }
.btn.full { width: 100%; }

@media (max-width: 900px) {
  .product, .details { grid-template-columns: minmax(0, 1fr); }
  .p-buy { position: static; }
}

/* Gallery: trailer first, then screenshots; images keep their own shape inside the stage */
.gallery { display: grid; gap: 10px; min-width: 0; }
.g-still { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: contain; background: var(--stage); clip-path: var(--chamfer); }
.stage { position: relative; min-width: 0; aspect-ratio: 16 / 10; overflow: hidden; background: var(--stage); clip-path: var(--chamfer); }
.g-track { display: flex; height: 100%; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.g-track::-webkit-scrollbar { display: none; }
.g-track:focus-visible { outline-offset: -3px; }
.g-slide { position: relative; flex: 0 0 100%; height: 100%; min-width: 0; scroll-snap-align: center; scroll-snap-stop: always; --pad: clamp(10px, 2vw, 20px); }
.g-img { position: absolute; inset: var(--pad); margin: auto; max-width: calc(100% - 2 * var(--pad)); max-height: calc(100% - 2 * var(--pad)); object-fit: contain; }
.g-open { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.g-video { position: absolute; inset: 0; display: block; background: var(--stage); color: var(--fg); }
.g-cover { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.g-video:not(.playing)::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, .66)); pointer-events: none; }
.g-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.g-play {
  --cut: 10px;
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  translate: -50% -50%;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px 16px 20px;
  border: 0;
  background: var(--accent);
  color: var(--fg);
  font: 650 16px/1 var(--body);
  font-stretch: 112%;
  white-space: nowrap;
  cursor: pointer;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  transition: filter .2s, scale .2s;
}
.g-play:hover { filter: brightness(1.12); scale: 1.03; }
.tri { flex: none; width: 0; height: 0; border-left: .62em solid currentColor; border-top: .38em solid transparent; border-bottom: .38em solid transparent; }
.g-vnote { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; margin: 0; padding: 12px 18px; font-size: 12px; text-align: center; color: var(--fg-soft); }
.g-vnote a { color: inherit; font-weight: 650; }
.g-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  translate: 0 -50%;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  background: var(--bg-glass);
  color: var(--fg);
  font-size: 18px;
  cursor: pointer;
  transition: background .2s, opacity .2s;
}
.g-nav:hover { background: var(--accent); }
.g-prev { left: 12px; }
.g-next { right: 12px; }
.g-nav[disabled] { opacity: 0; pointer-events: none; }
.stage .g-count { position: absolute; top: 14px; right: 26px; z-index: 2; }
.g-count { padding: 6px 10px; background: var(--bg-glass); color: var(--fg); font: 500 12px/1 var(--mono); font-variant-numeric: tabular-nums; }
.g-count i { font-style: normal; }
.g-thumbs { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.g-thumb { position: relative; flex: 0 0 auto; width: 92px; height: 58px; padding: 0; overflow: hidden; border: 0; background: var(--stage); opacity: .55; cursor: pointer; transition: opacity .2s; }
.g-thumb:hover { opacity: .9; }
.g-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.g-thumb[aria-current="true"] { opacity: 1; outline: 2px solid var(--accent); outline-offset: -2px; }
.g-thumb .mini { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .3); }
.g-thumb .mini > span { display: grid; place-items: center; width: 26px; height: 26px; padding-left: 2px; background: var(--accent); color: var(--fg); font-size: 12px; }
@media (max-width: 700px) {
  .g-thumbs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .g-thumbs::-webkit-scrollbar { display: none; }
  .g-nav { width: 38px; height: 38px; }
}

.lightbox { position: fixed; inset: 0; z-index: 70; display: grid; grid-template-rows: auto minmax(0, 1fr); background: #05070A; }
.lb-bar { display: flex; align-items: center; gap: 12px; padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px; color: var(--fg); }
.lb-title { flex: 1; min-width: 0; overflow: hidden; font: 750 15px/1.2 var(--display); font-stretch: 118%; text-transform: uppercase; white-space: nowrap; text-overflow: ellipsis; }
.lightbox .stage { height: 100%; aspect-ratio: auto; background: transparent; clip-path: none; }
.lightbox .g-slide { --pad: clamp(8px, 3vw, 40px); }

/* Basket drawer */
.scrim { position: fixed; inset: 0; z-index: 40; background: var(--scrim); }
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(440px, 100%);
  background: var(--bg-raised);
  border-left: 1px solid var(--line);
}
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(18px + env(safe-area-inset-top, 0px)) 22px 18px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 22px; }
.drawer-body { display: grid; align-content: start; gap: 18px; padding: 18px 22px; overflow: auto; }
.drawer-foot { display: grid; gap: 12px; padding: 18px 22px calc(18px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); }
.drawer-foot:empty { display: none; }
.x { padding: 9px 14px; border: 0; background: rgba(245, 247, 250, .09); color: var(--fg); font: 500 12px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; cursor: pointer; }
.x:hover { background: rgba(245, 247, 250, .16); }
.linkish { padding: 0; border: 0; background: none; color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.linkish:hover { color: var(--fg); }
.acct { display: grid; gap: 10px; padding: 16px; background: var(--surface); clip-path: var(--chamfer); }
.acct p { margin: 0; font-size: 14px; }
.acct-title { font-weight: 700; color: var(--fg); }
.acct.ok { background: rgba(43, 127, 255, .1); }
.acct b { color: var(--fg); }
.lines { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.line { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; align-items: center; gap: 14px; font-size: 14px; line-height: 1.5; }
.line img { width: 72px; height: 52px; object-fit: cover; background: var(--surface); }
.line-name { color: var(--fg); font: 750 14px/1.25 var(--display); font-stretch: 112%; text-decoration: none; text-transform: uppercase; }
.line .resname { font: 400 12px/1.4 var(--mono); color: var(--faint); }
.line .price { font-size: 15px; }
.empty { display: grid; justify-items: start; gap: 12px; padding-block: 8px; }
.empty p { margin: 0; color: var(--muted); }
.coupon { display: grid; gap: 8px; }
.coupon label { font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.coupon .row { display: flex; gap: 8px; }
.coupon input { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font: 500 14px/1 var(--mono); }
.coupon input:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.coupon .btn { min-height: 40px; padding: 0 16px; }
.applied { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; }
.applied b { font-family: var(--mono); color: var(--fg); }
.total { display: flex; justify-content: space-between; align-items: baseline; font-weight: 650; }
.total b { font: 800 26px/1 var(--display); font-stretch: 118%; font-variant-numeric: tabular-nums; }
.total small { margin-left: 6px; font: 500 12px/1 var(--body); color: var(--faint); }
.error { margin: 0; color: var(--danger); font-size: 14px; font-weight: 600; line-height: 1.45; }

/* Thanks page */
.note-page { padding-block: calc(140px + env(safe-area-inset-top, 0px)) 120px; }
.note-page .wrap { display: grid; gap: 18px; justify-items: start; max-width: calc(760px + 2 * var(--gutter)); }
.note-page h1 { margin: 0; font: 800 clamp(30px, 4.4vw, 52px)/1.04 var(--display); font-stretch: 125%; text-transform: uppercase; text-wrap: balance; }
.note-page ol { display: grid; gap: 8px; margin: 0; padding-left: 20px; color: var(--muted); }
.note-page p { margin: 0; color: var(--muted); }
.note-page a:not(.btn) { color: var(--accent-text); }
.note-page code, .note-page .mono { font-family: var(--mono); font-size: .92em; color: var(--fg); }

.footer__legal { margin: 0; max-width: 72ch; font-size: 12.5px; line-height: 1.6; color: var(--faint); }
.footer__legal a { color: var(--muted); }
