/* =========================================================
   MCR MERCH - minimalist, sharp-cornered, light + dark
   ========================================================= */
:root {
  --bg: #ffffff;
  --fg: #0a0a0a;
  --muted: #6b6b6b;
  --line: #e4e4e4;
  --line-strong: #0a0a0a;
  --surface: #f5f5f5;
  --inverse-bg: #0a0a0a;
  --inverse-fg: #ffffff;
  --danger: #c4161c;
  --success: #12733a;
  --overlay: rgba(0, 0, 0, .45);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --wrap: 1240px;
  --header-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0a0a; --fg: #f2f2f2; --muted: #8c8c8c; --line: #262626; --line-strong: #f2f2f2;
    --surface: #141414; --inverse-bg: #f2f2f2; --inverse-fg: #0a0a0a;
    --danger: #ff5a5f; --success: #3ccf7a; --overlay: rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0a0a; --fg: #f2f2f2; --muted: #8c8c8c; --line: #262626; --line-strong: #f2f2f2;
  --surface: #141414; --inverse-bg: #f2f2f2; --inverse-fg: #0a0a0a;
  --danger: #ff5a5f; --success: #3ccf7a; --overlay: rgba(0, 0, 0, .7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; border-radius: 0 !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font);
  font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .wrap { padding: 0 32px; } }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }

/* ---------- Header / footer ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30; background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.header-inner { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; }
.logo { font-weight: 700; letter-spacing: .2em; text-transform: uppercase; text-decoration: none; font-size: 15px; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 1px solid transparent; cursor: pointer;
}
.icon-btn:hover { border-color: var(--line); }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .i-sun { display: none; }
  :root:not([data-theme]) .i-moon { display: block; }
}
.bag-btn {
  height: 40px; padding: 0 14px; display: inline-flex; align-items: center; gap: 10px;
  background: none; border: 1px solid var(--line-strong); cursor: pointer;
  font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
}
.bag-btn:hover { background: var(--inverse-bg); color: var(--inverse-fg); }
.bag-count { font-family: var(--mono); min-width: 18px; text-align: center; }
.bag-count.bump { animation: bump .35s ease; }
@keyframes bump { 50% { transform: scale(1.4); } }

.site-footer { border-top: 1px solid var(--line); margin-top: 64px; }
.footer-inner {
  padding: 24px 16px; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between;
  font-size: 12px; color: var(--muted); letter-spacing: .04em;
}

/* ---------- Buttons / forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 22px; border: 1px solid var(--line-strong); background: none;
  font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  cursor: pointer; text-decoration: none; transition: opacity .15s, background .15s, color .15s;
}
.btn:hover { background: var(--inverse-bg); color: var(--inverse-fg); }
.btn-primary { background: var(--inverse-bg); color: var(--inverse-fg); }
.btn-primary:hover { opacity: .85; }
.btn-block { width: 100%; }
.btn-lg { height: 54px; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 11px; }
.btn-danger { border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .35; cursor: not-allowed; pointer-events: none; }
.link-sm {
  background: none; border: 0; padding: 0; cursor: pointer; font-size: 12px; letter-spacing: .06em;
  text-decoration: underline; text-underline-offset: 3px; color: var(--fg);
}
.label, .field > span, legend {
  display: block; font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  margin-bottom: 8px;
}
.field { display: block; margin-bottom: 16px; }
.field em { font-style: normal; color: var(--muted); text-transform: none; letter-spacing: 0; font-weight: 400; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=password],
input[type=search], input[type=url], select, textarea {
  width: 100%; height: 46px; padding: 0 14px; background: var(--bg); border: 1px solid var(--line);
  outline: none; transition: border-color .15s; appearance: none;
}
textarea { height: auto; padding: 12px 14px; resize: vertical; min-height: 90px; }
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--fg) 50%), linear-gradient(135deg, var(--fg) 50%, transparent 50%);
  background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px;
  background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px;
}
input:focus, select:focus, textarea:focus { border-color: var(--line-strong); }
.has-error input, .has-error select { border-color: var(--danger); }
.field-error { display: block; color: var(--danger); font-size: 12px; margin-top: 6px; }
fieldset { border: 0; padding: 0; margin: 0 0 28px; min-width: 0; }
legend { padding: 0; margin-bottom: 16px; font-size: 12px; }
.row-2, .row-3 { display: grid; gap: 0 16px; }
@media (min-width: 600px) {
  .row-2 { grid-template-columns: 1fr 1fr; }
  .row-3 { grid-template-columns: 1fr 1.4fr 1.4fr; }
}
.alert { border: 1px solid var(--line-strong); padding: 12px 16px; margin: 16px 0; font-size: 14px; }
.alert-error { border-color: var(--danger); color: var(--danger); }
.alert-success { border-color: var(--success); color: var(--success); }
.hint { min-height: 20px; margin: 8px 0 16px; font-size: 13px; color: var(--muted); }
.hint.error { color: var(--danger); }
.badge {
  display: inline-block; padding: 3px 8px; font-size: 11px; font-weight: 600; letter-spacing: .12em;
  border: 1px solid var(--line-strong); text-transform: uppercase; white-space: nowrap;
}

/* ---------- Product page ---------- */
.product { display: grid; gap: 32px; padding-top: 24px; }
@media (min-width: 900px) {
  .product { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 56px; padding-top: 40px; align-items: start; }
  .product-info { position: sticky; top: calc(var(--header-h) + 32px); }
}
.gallery-main { position: relative; aspect-ratio: 4 / 5; background: var(--surface); overflow: hidden; touch-action: pan-y; }
.gallery-main img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .35s ease;
}
.gallery-main img.active { opacity: 1; }
.img-placeholder {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
}
.gallery-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  background: var(--bg); border: 1px solid var(--line); opacity: .9;
}
.gallery-nav:hover { border-color: var(--line-strong); opacity: 1; }
.gallery-nav.prev { left: 12px; }
.gallery-nav.next { right: 12px; }
.gallery-counter {
  position: absolute; bottom: 12px; right: 12px; background: var(--bg); padding: 2px 8px; font-size: 12px;
}
.gallery-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; margin-top: 8px; }
.thumb { padding: 0; border: 1px solid transparent; background: var(--surface); cursor: pointer; aspect-ratio: 4/5; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; opacity: .6; transition: opacity .15s; }
.thumb:hover img, .thumb.active img { opacity: 1; }
.thumb.active { border-color: var(--line-strong); }

.product-name { font-size: 28px; line-height: 1.15; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
@media (min-width: 900px) { .product-name { font-size: 34px; } }
.product-price { font-size: 18px; margin: 12px 0 28px; }
.preorder-note { border: 1px solid var(--line); padding: 12px 14px; margin: -12px 0 28px; font-size: 13px; }
.preorder-note p { margin: 8px 0 0; color: var(--muted); }
.ship-note { font-size: 12px; color: var(--muted); margin: -8px 0 16px; }
@media (max-width: 600px) { .logo { font-size: 11px; letter-spacing: .14em; max-width: 60vw; line-height: 1.3; } }
.field-head { display: flex; justify-content: space-between; align-items: baseline; }
.size-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.size-opt { position: relative; cursor: pointer; }
.size-opt input { position: absolute; opacity: 0; pointer-events: none; }
.size-opt span {
  display: flex; align-items: center; justify-content: center; height: 46px; border: 1px solid var(--line);
  font-size: 13px; font-weight: 500; letter-spacing: .06em; transition: border-color .15s, background .15s;
}
.size-opt:hover span { border-color: var(--line-strong); }
.size-opt input:checked + span { background: var(--inverse-bg); color: var(--inverse-fg); border-color: var(--line-strong); }
.size-opt input:focus-visible + span { outline: 2px solid var(--fg); outline-offset: 2px; }
.size-opt.is-out { cursor: not-allowed; }
.size-opt.is-out span {
  color: var(--muted); border-style: dashed;
  background: linear-gradient(to top right, transparent calc(50% - .5px), var(--line) 50%, transparent calc(50% + .5px));
}
.qty { display: inline-flex; border: 1px solid var(--line); margin-bottom: 24px; }
.qty button { width: 44px; height: 44px; border: 0; background: none; cursor: pointer; font-size: 18px; }
.qty button:hover { background: var(--surface); }
.qty input {
  width: 52px; height: 44px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  text-align: center; padding: 0; font-family: var(--mono); -moz-appearance: textfield;
}
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty.sm button, .qty.sm input { height: 32px; }
.qty.sm button { width: 32px; font-size: 15px; }
.qty.sm input { width: 38px; font-size: 13px; }
.qty.sm { margin: 0; }
.perks { list-style: none; padding: 0; margin: 8px 0 28px; font-size: 13px; color: var(--muted); }
.perks li { padding: 6px 0 6px 20px; position: relative; }
.perks li::before { content: ""; position: absolute; left: 0; top: 14px; width: 8px; height: 1px; background: var(--fg); }
.accordion { border-top: 1px solid var(--line); }
.accordion:last-of-type { border-bottom: 1px solid var(--line); }
.accordion summary {
  list-style: none; cursor: pointer; padding: 18px 0; font-size: 12px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; display: flex; justify-content: space-between;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: "+"; font-family: var(--mono); font-size: 16px; line-height: 1; }
.accordion[open] summary::after { content: "\2212"; }
.accordion-body { padding-bottom: 20px; font-size: 14px; }
.accordion-body p { margin: 0 0 12px; }
.size-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 12px; }
.size-table th, .size-table td { border-bottom: 1px solid var(--line); padding: 10px 6px; text-align: left; }
@media (max-width: 400px) { .size-table { font-size: 12px; } .size-table th { letter-spacing: .06em; } }
.size-table th { font-family: var(--font); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; }
.unit-toggle { display: inline-flex; border: 1px solid var(--line); margin-bottom: 12px; }
.unit-toggle button { background: none; border: 0; padding: 6px 12px; cursor: pointer; font-size: 11px; letter-spacing: .12em; }
.unit-toggle button.active { background: var(--inverse-bg); color: var(--inverse-fg); }

/* ---------- Bag drawer ---------- */
.drawer-overlay { position: fixed; inset: 0; background: var(--overlay); z-index: 40; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: var(--bg);
  border-left: 1px solid var(--line); z-index: 50; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .3s cubic-bezier(.2, .7, .2, 1); visibility: hidden;
}
.drawer.open { transform: none; visibility: visible; }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between; padding: 0 16px 0 20px;
  height: var(--header-h); border-bottom: 1px solid var(--line);
}
.drawer-head h2, .summary-head h2 { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; }
.drawer-body { flex: 1; overflow-y: auto; padding: 4px 20px; }
.drawer-foot { border-top: 1px solid var(--line); padding: 16px 20px 20px; }
.bag-empty { padding: 48px 0; text-align: center; color: var(--muted); font-size: 14px; }
.bag-line { display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.bag-line img, .bag-line .thumb-ph { width: 72px; aspect-ratio: 4/5; object-fit: cover; background: var(--surface); }
.bag-line .name { font-size: 14px; font-weight: 500; }
.bag-line .meta { font-size: 12px; color: var(--muted); margin: 2px 0 10px; }
.bag-line .right { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; }
.bag-line .remove { background: none; border: 0; padding: 0; cursor: pointer; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.bag-line .remove:hover { color: var(--fg); }
.totals { margin: 0 0 16px; font-size: 14px; }
.totals div { display: flex; justify-content: space-between; padding: 4px 0; }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; font-family: var(--mono); }
.totals .grand { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; font-weight: 600; font-size: 16px; }
.totals .grand dt { color: var(--fg); }
body.drawer-locked { overflow: hidden; }

/* ---------- Checkout ---------- */
.checkout { padding-top: 24px; }
.checkout-head { margin-bottom: 24px; }
.checkout-head h1 { font-size: 28px; text-transform: uppercase; letter-spacing: .02em; margin-top: 12px; }
.checkout-grid { display: grid; gap: 32px; }
@media (min-width: 900px) {
  .checkout-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 56px; align-items: start; }
  .summary { position: sticky; top: calc(var(--header-h) + 24px); order: 2; }
}
@media (max-width: 899px) { .summary { order: -1; } }
.summary { border: 1px solid var(--line); padding: 20px; background: var(--surface); }
.summary-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.summary-items { list-style: none; margin: 0 0 16px; padding: 0; }
.summary-items li { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.summary-items img, .summary-items .thumb-ph { width: 52px; aspect-ratio: 4/5; object-fit: cover; background: var(--bg); }
.summary-items strong { display: block; font-weight: 500; }
.delivery-opts { display: grid; gap: 8px; margin-bottom: 12px; }
@media (min-width: 600px) { .delivery-opts { grid-template-columns: 1fr 1fr; } }
.delivery-opt { position: relative; cursor: pointer; }
.delivery-opt input { position: absolute; opacity: 0; pointer-events: none; }
.delivery-opt span { display: block; border: 1px solid var(--line); padding: 14px 16px; height: 100%; transition: border-color .15s; }
.delivery-opt strong { display: block; font-size: 14px; font-weight: 600; }
.delivery-opt em { display: block; font-style: normal; font-size: 12px; color: var(--muted); margin-top: 2px; }
.delivery-opt:hover span { border-color: var(--line-strong); }
.delivery-opt input:checked + span { border-color: var(--line-strong); box-shadow: inset 0 0 0 1px var(--line-strong); }
.delivery-opt input:focus-visible + span { outline: 2px solid var(--fg); outline-offset: 2px; }
.pay-method { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line-strong); padding: 14px 16px; font-size: 13px; margin-bottom: 16px; }

/* ---------- Result pages ---------- */
.page-msg { padding: 72px 16px; max-width: 640px; }
.page-msg h1 { font-size: 30px; text-transform: uppercase; letter-spacing: .02em; margin-bottom: 12px; }
.result-box { border: 1px solid var(--line-strong); padding: 20px; margin: 28px 0; }
.result-box .order-no { font-family: var(--mono); font-size: 18px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0;
  background: var(--inverse-bg); color: var(--inverse-fg); padding: 12px 18px; font-size: 13px;
  z-index: 60; transition: all .25s ease; max-width: calc(100% - 32px); pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
