/* Shop page, product page and the cart drawer. Uses the variables from styles.css. */

/* ---------- header cart button ---------- */
.cart-btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 0; background: var(--text); color: var(--bg); border-radius: 999px;
  padding: 8px 16px; font-weight: 800; font-size: 14px;
}
.cart-btn:hover { filter: brightness(.92); }
.cart-count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 800;
  display: inline-grid; place-items: center;
}
.cart-count[hidden] { display: none; }
.nav a[aria-current="page"] { color: var(--text); }

/* ---------- Merch button next to Jordan (index.html) ---------- */
.merch-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1.5px solid var(--accent); color: var(--accent); background: rgba(0,0,0,.55); backdrop-filter: blur(6px);
  border-radius: 12px; padding: 11px 18px;
  font-family: var(--display); font-size: 17px; text-transform: uppercase; letter-spacing: .5px; white-space: nowrap;
}
.merch-btn:hover { background: var(--accent); color: var(--accent-ink); }

/* ---------- shop page ---------- */
.sp { width: min(1240px, 100%); margin: 0 auto; padding: 32px 28px 64px; flex: 1; }
.sp-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.sp-head h1 { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: 56px; line-height: 1; margin: 0; }
.sp-3d, .pp-3d { color: var(--accent); font-weight: 800; font-size: 14px; }
.sp-3d:hover, .pp-3d:hover { text-decoration: underline; }
.sp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.sp-card { background: var(--surface); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .15s; }
.sp-card:hover { transform: translateY(-3px); }
.sp-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sp-photo { position: relative; aspect-ratio: 1; background: var(--thumb); overflow: hidden; }
.sp-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .25s; }
.sp-photo .sp-alt { opacity: 0; }
@media (hover: hover) { .sp-card:hover .sp-alt { opacity: 1; } }
.sp-photo .badge { position: absolute; top: 10px; left: 10px; }
.badge.sold { background: var(--surface-2); color: var(--text); }
.sp-meta { padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.sp-meta h3 { margin: 0; font-size: 16px; font-weight: 800; }
.sp-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sp-line b { font-family: var(--display); font-weight: 400; font-size: 20px; }
.sp-dots { display: flex; gap: 5px; }

/* ---------- product page ---------- */
.pp { width: min(1240px, 100%); margin: 0 auto; padding: 18px 28px 64px; flex: 1; }
.pp-crumbs { color: var(--muted); font-size: 13px; font-weight: 700; margin-bottom: 14px; }
.pp-crumbs a:hover { color: var(--text); }
.pp-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, 1fr); gap: 36px; align-items: start; }
.pp:not(.ready) .pp-grid { opacity: .5; }
.pp-gallery { position: relative; }
.pp-main { position: relative; aspect-ratio: 1; background: var(--thumb); border-radius: 18px; overflow: hidden; touch-action: pan-y; user-select: none; }
.pp-main img { width: 100%; height: 100%; object-fit: cover; display: block; -webkit-user-drag: none; }
.pp-gallery .pd-nav { top: calc(50% - 60px); }
.pp-thumbs { display: flex; gap: 10px; padding-top: 12px; overflow-x: auto; scrollbar-width: thin; }
.pp-thumb { flex: none; width: 84px; padding: 0; border: 2px solid transparent; border-radius: 12px; overflow: hidden; background: var(--thumb); }
.pp-thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.pp-thumb[aria-current="true"] { border-color: var(--accent); }
.pp-info { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 14px; }
.pp-info h1 { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: 48px; line-height: 1.02; margin: 0; }
.pp-price { font-family: var(--display); font-size: 30px; }
.pp-price s { color: var(--muted); font-size: 20px; margin-left: 6px; }
.pp-label { font-size: 12px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.pp-label span { color: var(--text); letter-spacing: .3px; text-transform: none; font-size: 14px; margin-left: 6px; }
.swatches, .sizes { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  width: 40px; height: 40px; border-radius: 50%; padding: 0; background: var(--c);
  border: 2px solid rgba(255,255,255,.25); box-shadow: 0 0 0 3px var(--bg);
}
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent); }
.size {
  min-width: 56px; padding: 11px 12px; border-radius: 10px;
  border: 1.5px solid var(--line); background: var(--surface); font-weight: 800; font-size: 14px;
}
.size:hover:not(:disabled) { border-color: var(--text); }
.size[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.size:disabled { opacity: .35; text-decoration: line-through; cursor: not-allowed; }
.pp-add { padding: 17px; font-size: 20px; margin-top: 4px; }
.pp-ship { margin: -4px 0 0; color: var(--muted); font-size: 13px; }
.pp-desc { margin: 6px 0 0; color: var(--muted); font-size: 15px; line-height: 1.6; white-space: pre-line; }
.pp-missing { text-align: center; padding: 80px 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pp-missing h1 { font-family: var(--display); font-weight: 400; font-size: 56px; margin: 0; text-transform: uppercase; }

/* ---------- cart drawer ---------- */
body.cart-open { overflow: hidden; }
.cart { position: fixed; inset: 0; z-index: 50; }
.cart[hidden] { display: none; }
.cart-scrim { position: absolute; inset: 0; background: rgba(0,0,0,.65); opacity: 0; transition: opacity .2s; }
.cart-box {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 100%);
  background: var(--bg); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; transform: translateX(100%); transition: transform .22s ease;
}
.cart.in .cart-scrim { opacity: 1; }
.cart.in .cart-box { transform: none; }
.cart-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.cart-head h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 30px; text-transform: uppercase; }
.cart-x { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--surface-2); font-size: 15px; }
.cart-x:hover { background: var(--text); color: var(--bg); }
.cart-body { flex: 1; overflow-y: auto; padding: 8px 20px; }
.cart-empty { padding: 40px 0; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; color: var(--muted); }
.cart-empty p { margin: 0; line-height: 1.5; }
.cart-line { display: grid; grid-template-columns: 84px 1fr; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-img { width: 84px; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--thumb); }
.cart-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cart-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cart-name { font-weight: 800; font-size: 15px; }
.cart-name:hover { text-decoration: underline; }
.cart-opts { color: var(--muted); font-size: 13px; }
.cart-row { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.qty button { width: 34px; height: 32px; border: 0; background: var(--surface); font-size: 17px; font-weight: 800; }
.qty button:hover:not(:disabled) { background: var(--surface-2); }
.qty button:disabled { opacity: .35; cursor: not-allowed; }
.qty span { min-width: 34px; text-align: center; font-weight: 800; font-size: 14px; }
.cart-remove { align-self: flex-start; border: 0; background: none; padding: 2px 0; color: var(--muted); font-size: 12px; font-weight: 700; text-decoration: underline; }
.cart-remove:hover { color: var(--text); }
.cart-foot { padding: 16px 20px calc(18px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.cart-foot:empty { display: none; }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; font-weight: 800; }
.cart-total b { font-family: var(--display); font-weight: 400; font-size: 26px; }
.cart-note { margin: 0; color: var(--muted); font-size: 13px; }
.buy.checkout { padding: 16px; font-size: 20px; margin-top: 4px; }
body.cart-busy .cart-box { cursor: progress; }
body.cart-busy .cart-body, body.cart-busy .cart-foot { opacity: .6; pointer-events: none; }

@media (max-width: 900px) {
  .sp, .pp { padding-left: 16px; padding-right: 16px; }
  .sp { padding-top: 22px; }
  .sp-head h1 { font-size: 42px; }
  .sp-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .sp-meta { padding: 10px 10px 12px; }
  .sp-meta h3 { font-size: 14px; }
  .sp-line b { font-size: 17px; }
  .pp-grid { grid-template-columns: 1fr; gap: 18px; }
  .pp-main { border-radius: 14px; }
  .pp-info { position: static; }
  .pp-info h1 { font-size: 36px; }
  .pp-thumb { width: 66px; }
  .cart-btn { padding: 7px 13px; }
  .merch-btn { padding: 11px 14px; }
}
@media (max-width: 380px) {
  .sp-grid { grid-template-columns: 1fr; }
}

/* index.html: the worn shirt's buy button sits next to the Merch button */
.stage-buy-slot { display: contents; }
/* Desktop: Merch sits under "Show back" so it's visible without scrolling. Phones: next to Buy. */
.merch-top { position: absolute; top: 72px; right: 22px; z-index: 2; }
@media (min-width: 901px) { .stage-buy .merch-btn { display: none; } }
@media (max-width: 900px) { .merch-top { display: none; } }
