/* Merch shop (activity_platform's ActivityPlatform::Merch::*Controller): shop, product cards, cart, checkout form,
   order and withdrawal pages. The engine ships plain semantic classes (.page-title, .card, .btn, .field, .facts,
   .num, .flash ...) that base.css and application.css already style; this file adds the shop's own parts in the
   look "Seekarte" and scopes everything to the shop wrappers, so no other page is affected. Loaded only on shop
   pages (layouts/application). Readability like the rest of the app: 17 px text, 48 px touch targets, tokens only. */

.merch-shop, .merch-cart, .merch-order, .merch-withdrawal { max-width: 1060px; margin: 0 auto; overflow-wrap: break-word; }
.merch-shop .page-title, .merch-cart .page-title, .merch-order .page-title, .merch-withdrawal .page-title { letter-spacing: -.01em; margin-top: var(--space-1); }
.merch-order .lede, .merch-withdrawal .lede { color: var(--ink); }

/* Product grid: a card is a small chart sheet with a rope line on top */
.merch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: var(--space-4);
  margin: var(--space-5) 0; padding: 0; list-style: none; }
.merch-card { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2);
  border-top: 4px solid var(--c-rope); background: var(--surface); }
.merch-card h2 { font-size: var(--fs-lg); line-height: 1.2; margin: 0; }
.merch-card .num { font-size: var(--fs-xl); margin: 0; color: var(--ink); }
.merch-card form { width: 100%; margin-top: auto; }
.merch-card .btn { width: 100%; }
.merch-card__pic { position: relative; width: 100%; aspect-ratio: 1; overflow: hidden; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line2); background-color: var(--sunk);
  background-image: linear-gradient(to right, color-mix(in srgb, var(--course) 10%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--course) 10%, transparent) 1px, transparent 1px);
  background-size: 28px 28px; }
.merch-card__pic img { display: block; width: 100%; height: 100%; object-fit: contain; }
.merch-card__pic .merch-card__back { position: absolute; right: var(--space-2); bottom: var(--space-2); width: 36%; height: auto;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }

/* Fields inside the shop: size select, quantity, shipping zone, withdrawal reason */
.merch-shop .field, .merch-cart .field, .merch-withdrawal .field { margin: 0; }
.merch-cart input[type="number"] { width: 5.5rem; text-align: center; font-family: var(--f-mono); font-weight: 700; }
.merch-withdrawal textarea { min-height: 8rem; }
.merch-zone fieldset { border: 1.5px dashed var(--line2); border-radius: var(--radius-md); background: var(--sunk); padding: var(--space-3) var(--space-4); margin: 0; }
.merch-zone legend { padding: 0 var(--space-2); font-weight: 700; font-size: var(--fs-sm); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.merch-zone label { display: flex; align-items: center; gap: var(--space-2); min-height: 48px; font-weight: 400; font-size: var(--fs-md); }
.merch-zone input[type="radio"] { width: 24px; height: 24px; accent-color: var(--accent); flex: none; }

/* Cart lines and order lines */
.merch-lines { display: grid; gap: var(--space-3); margin: var(--space-4) 0; padding: 0; list-style: none; }
.merch-line { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-3);
  border-style: solid; border-width: 1px 1px 1px 4px; border-left-color: var(--course); }
.merch-line h2 { margin: 0; font-size: var(--fs-lg); }
.merch-line p { margin: var(--space-1) 0 0; }
.merch-line .actions { margin: 0; align-items: center; }
.merch-line .actions form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0; }
.merch-line .btn.small { min-height: 48px; }

/* Totals: a ledger, the total line in display type */
.merch-totals { margin: var(--space-4) 0; }
.merch-totals dl { margin: 0; display: grid; gap: var(--space-2); }
.merch-totals dl > div { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3);
  padding-bottom: var(--space-2); border-bottom: 1px dashed var(--line2); }
.merch-totals dl > div:last-child { border-bottom: 0; padding-bottom: 0; }
.merch-totals dd { margin: 0; }
.merch-totals dl > div:last-child dd { font-family: var(--f-display); font-size: var(--fs-2xl); }
.merch-cart form > .btn.primary { width: 100%; max-width: 420px; justify-self: start; }

/* Order confirmation */
.merch-order address { font-style: normal; line-height: 1.6; padding-left: var(--space-3); border-left: 3px solid var(--course); margin: var(--space-2) 0 var(--space-4); }
.merch-order h2 { font-size: var(--fs-xl); margin: var(--space-5) 0 var(--space-2); }

/* Legal links and the disclaimer */
.merch-legal { margin-top: var(--space-4); }
.merch-legal a { color: inherit; text-underline-offset: 3px; }
.merch-shop .note, .merch-cart .note { margin: var(--space-4) 0; }

@media (max-width: 640px) {
  .merch-line { align-items: flex-start; }
  .merch-line .actions { width: 100%; }
}
