/* Merch wall: /merch (public), /admin/merch, /admin/merch/qr. Mockups are inline SVG (Shared/Merch/MerchMockup.razor). */

.merch-page { --merch-purple: #4c1d95; }

.merch-local {
    display: flex; gap: .75rem; align-items: center;
    background: #f5f3ff; border: 1px solid #ddd6fe; border-radius: .75rem;
    padding: .75rem 1rem; margin: 0 0 1rem;
}
.merch-local img { flex: 0 0 auto; }
.merch-event {
    background: #fff7ed; border: 1px solid #fed7aa; border-radius: .75rem;
    padding: .6rem 1rem; margin-bottom: 1rem; font-weight: 600; color: #7c2d12;
}

.merch-jump { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .5rem; }
.merch-jump a {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 1rem;
    border-radius: 999px; border: 1px solid #c4b5fd; color: var(--merch-purple, #4c1d95);
    text-decoration: none; font-weight: 600;
}
.merch-jump a:hover { background: #ede9fe; }

.merch-section { margin-top: 1.75rem; scroll-margin-top: 80px; }
.merch-h2 { font-size: 1.35rem; font-weight: 800; color: #1f1147; margin-bottom: .75rem; }

/* /merch cards: one row, side by side on a wide screen (wraps to another row when more cards than fit).
   At 600px and under the old phone snap-scroller is a vertical grid: two columns when the row is wide
   enough (a 390px phone, after the page padding), one column when it is not (a 360px phone). */
.merch-grid-wrap { container-type: inline-size; container-name: merchpage; }
.merch-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 1rem; }
@media (max-width: 600px) {
    .merch-grid {
        grid-template-columns: minmax(0, 1fr); grid-auto-flow: row; grid-auto-columns: auto;
        overflow-x: visible; scroll-snap-type: none; padding-bottom: 0;
    }
    .merch-grid > .merch-card { min-width: 0; scroll-snap-align: none; }
    .merch-card-body { min-width: 0; }
    .merch-card-body .btn { max-width: 100%; white-space: normal; }
    .merch-card-title, .merch-card-desc { overflow-wrap: anywhere; }
    .merch-art-dots { min-width: 0; }
}
/* Two columns once the card row itself is at least 18.75rem (a 390px phone after page padding). Narrower stays one column. */
@container merchpage (min-width: 18.75rem) {
    @media (max-width: 600px) {
        .merch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    }
}
.merch-card {
    display: flex; flex-direction: column; background: #fff; border: 1px solid #e5e7eb;
    border-radius: .9rem; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.06);
    cursor: pointer; scroll-margin-top: 80px; transition: border-color .15s, box-shadow .15s;
}
/* the whole card opens the preview (MerchChooser) */
.merch-card:hover, .merch-card:focus-within { border-color: #c4b5fd; box-shadow: 0 4px 14px rgba(76, 29, 149, .14); }
.merch-card-kind { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #6d28d9; }
.merch-card-media { position: relative; }
.merch-card-pic {
    border: 0; padding: .75rem; background: #f3f4f6; display: block; width: 100%; cursor: pointer;
}
.merch-zoom-badge {
    position: absolute; right: .5rem; bottom: .5rem; width: 44px; height: 44px; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center; font-size: 1.25rem; line-height: 1;
    background: rgba(31, 17, 71, .78); color: #fff; border: 1px solid rgba(255, 255, 255, .5); box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.merch-zoom-badge { pointer-events: none; width: 36px; height: 36px; font-size: 1.05rem; left: .4rem; right: auto; bottom: 1.4rem; }
.merch-card-pic .mm { width: 100%; height: 240px; display: block; }
.merch-card-body { padding: .9rem 1rem 1rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.merch-card-body .btn { align-self: flex-start; min-height: 44px; margin-top: auto; }
.merch-card-title { font-size: 1.1rem; font-weight: 700; margin: 0; }
.merch-card-desc { font-size: .9rem; color: #4b5563; margin: 0; }
.merch-price { font-weight: 800; font-size: 1.1rem; color: var(--merch-purple, #4c1d95); }
.merch-price-coming { color: #92400e; font-weight: 700; }

.merch-art-dots { display: flex; gap: .35rem; flex-wrap: wrap; }
@media (max-width: 600px) {
    .merch-art-dots { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; min-width: 0; padding-bottom: .2rem; }
    .merch-art-dot { flex: 0 0 auto; }
}
.merch-art-dot { border: 2px solid #e5e7eb; border-radius: .4rem; padding: 0; width: 44px; height: 34px; overflow: hidden; background: #1f1147; }
.merch-art-dot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.merch-art-dot:hover { border-color: #8b5cf6; }

/* chooser modal */
.merch-chooser { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .merch-chooser { grid-template-columns: 1.1fr 1fr; } }
.merch-preview { position: relative; background: #f3f4f6; border-radius: .75rem; padding: .75rem; }
/* every preview picture is a button that opens the lightbox (MerchLightbox) */
.merch-zoomable { display: block; width: 100%; border: 0; padding: 0; background: transparent; color: inherit; font: inherit; cursor: zoom-in; position: relative; }
.merch-zoomable:focus-visible { outline: 3px solid #8b5cf6; outline-offset: 2px; border-radius: .5rem; }
.merch-preview-main .mm { width: 100%; max-height: 420px; display: block; }
/* the other shirt views sit in a row under the main back view (never over the artwork) */
.merch-preview-side { display: flex; justify-content: center; gap: .5rem; margin-top: .5rem; }
.merch-preview-front {
    flex: 0 1 140px; min-width: 0; background: #fff; border: 1px solid #e5e7eb; border-radius: .5rem; padding: .25rem;
}
.merch-preview-front:hover { border-color: #8b5cf6; }
.merch-preview-front .mm { width: 100%; height: 150px; display: block; }
.merch-preview-cap { display: block; font-size: .75rem; text-align: center; color: #6b7280; }

/* merch lightbox: the restoration-gallery look (.rs-lightbox, restoration-story.css) with the live SVG mockup instead of an img.
   --ar = width / height of the picture; it is sized to fit the screen, and "Zoom in" makes it 2.2x inside a scrolling stage. */
.merch-lightbox { --lbh: min(74vh, calc((100vw - 2rem) / var(--ar, 1))); }
.merch-lb-stage {
    max-width: 100%; max-height: 74vh; overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
    border-radius: .5rem; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); background: #f3f4f6;
}
.merch-lb-pic { display: block; border: 0; padding: 0; margin: 0; background: transparent; cursor: zoom-in; }
.merch-lb-pic .mm { display: block; height: var(--lbh); width: calc(var(--lbh) * var(--ar, 1)); }
.merch-lb-stage.zoomed .merch-lb-pic { cursor: zoom-out; }
.merch-lb-stage.zoomed .mm { height: calc(var(--lbh) * 2.2); width: calc(var(--lbh) * 2.2 * var(--ar, 1)); }
.merch-art-pick { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.merch-art-opt {
    border: 2px solid #e5e7eb; border-radius: .5rem; padding: .25rem; background: #fff;
    display: flex; flex-direction: column; gap: .2rem; align-items: stretch; min-height: 44px; font-size: .75rem; line-height: 1.15;
}
.merch-art-opt img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: .3rem; background: #1f1147; }
.merch-art-opt.active { border-color: #7c3aed; box-shadow: 0 0 0 2px #ddd6fe; }
.merch-swatch { display: inline-block; width: 32px; height: 32px; border-radius: 50%; border: 1px solid rgba(0,0,0,.25); flex: 0 0 auto; }
.merch-swatch-sm { width: 14px; height: 14px; vertical-align: -2px; margin-right: .25rem; }
.merch-price-line { font-size: 1.05rem; }
.merch-modal .form-select, .merch-modal .form-control { min-height: 44px; }

/* admin */
.merch-admin-thumb { width: 150px; background: #f3f4f6; border-radius: .5rem; padding: .25rem; }
.merch-admin-thumb .mm { width: 100%; display: block; }
.merch-admin-thumb-sm { width: 110px; }
.merch-art-check {
    display: flex; flex-direction: column; align-items: center; gap: .2rem; width: 110px; font-size: .75rem; text-align: center;
    border: 2px solid #e5e7eb; border-radius: .5rem; padding: .3rem; cursor: pointer; line-height: 1.15;
}
.merch-art-check img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: .3rem; }
.merch-art-check.on { border-color: #16a34a; background: #f0fdf4; }
.merch-art-check.off { opacity: .6; }
.merch-art-admin { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.merch-art-admin-item { display: flex; flex-direction: column; gap: .3rem; }
.merch-art-admin-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: .4rem; }

/* QR sign (print) */
.merch-sign { max-width: 7in; margin: 0 auto; text-align: center; padding: .4in .3in; border: 3px solid #4c1d95; border-radius: 18px; }
.merch-sign-logo { max-width: 3.2in; max-height: 1.3in; object-fit: contain; }
.merch-sign-title { font-size: 34pt; font-weight: 900; color: #1f1147; margin: .1in 0 0; }
.merch-sign-kinds { font-size: 16pt; font-weight: 700; color: #4c1d95; }
.merch-sign-qr { width: 4.2in; height: 4.2in; image-rendering: pixelated; margin: .2in auto .1in; display: block; }
.merch-sign-url { font-size: 15pt; font-weight: 700; word-break: break-all; }
.merch-sign-cta { font-size: 18pt; font-weight: 800; margin-top: .05in; }
.merch-sign-local { font-size: 13pt; margin-top: .12in; }
.merch-sign-event { font-size: 13pt; font-weight: 700; color: #7c2d12; margin-top: .06in; }
@media print {
    .no-print { display: none !important; }
    .merch-sign { border-width: 2px; }
}

/* combo bundles: the included items' pictures side by side (MerchBundlePreview), per-item choices in the chooser */
.merch-bundle-pic { display: grid; grid-template-columns: repeat(2, 1fr); grid-auto-rows: 1fr; gap: .35rem; height: 240px; width: 100%; }
.merch-bundle-pic-item { position: relative; min-width: 0; background: #fff; border-radius: .4rem; overflow: hidden; }
.merch-card-pic .merch-bundle-pic-item .mm, .merch-bundle-pic-item .mm { width: 100%; height: 100%; display: block; }
.merch-bundle-qty { position: absolute; right: .3rem; top: .3rem; background: #4c1d95; color: #fff; border-radius: 999px; font-size: .75rem; padding: 0 .45rem; font-weight: 700; }
.merch-bundle-empty { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; color: #6b7280; }
.merch-admin-thumb .merch-bundle-pic { height: 110px; }
.merch-bundle-list { padding-left: 1.1rem; }
.merch-bundle-preview { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .5rem; }
.merch-bundle-preview .merch-preview-front .mm { height: 170px; }
.merch-bundle-item { border: 1px solid #e5e7eb; border-radius: .6rem; padding: .6rem .75rem .75rem; }
.merch-bundle-item legend { float: none; width: auto; padding: 0 .25rem; font-size: 1rem; }
