/* SLÄP! collage pieces: collection page, piece cards, shop promo, product page strip. Tokens only, so light and dark both work. */

.st-shop--slap .slap-hero { margin: 8px 0 24px; border-radius: var(--st-media); overflow: hidden; background: var(--st-tile); }
.st-shop--slap .slap-hero img { display: block; width: 100%; height: auto; max-height: 460px; object-fit: cover; }

.slap-toolbar { margin-bottom: 20px; }
.slap-toolbar .filters { flex: 1 1 auto; }
.slap-toolbar .pill { display: inline-flex; align-items: center; text-decoration: none; }
.pill[aria-current="true"] { background: var(--st-ink); color: var(--wp--preset--color--canvas); border-color: var(--st-ink); }
.slap-toggle[aria-current="true"]::before { content: "\2713"; margin-right: 6px; }
.slap-toolbar .count { margin-left: auto; }
@media (max-width: 599px) { .slap-toolbar .slap-toggle { order: 3; } .slap-toolbar .count { order: 4; margin-left: 0; flex-basis: 100%; } }

/* Piece card: the shop card, plus a state label. Sold pieces stay visible, quieter. */
.slap-card .pcard__media img { transition: transform 300ms ease, filter var(--st-ease); }
.outofstock .slap-card:not(.slap-card--sold) .pcard__media img { opacity: 1; } /* the product page body carries .outofstock for a sold piece; the shop rule must not dim the strip */
/* Sold: a card keeps its photo in colour under a light veil, with a filled "Müüdud" label; on the product page the photo is greyed and the viewer opens the clean original. */
.slap-card--sold .pcard__media, .gallery__main--sold { position: relative; }
.gallery__main--sold[data-idx="0"] img { filter: grayscale(1); }
.slap-veil { position: absolute; inset: 0; background: rgba(246, 246, 247, 0.62); display: grid; place-items: center; pointer-events: none; transition: opacity var(--st-ease); }
.slap-veil > span { padding: 8px 18px; border-radius: var(--st-pill); background: var(--wp--preset--color--ink); color: var(--wp--preset--color--canvas); font-weight: 700; font-size: var(--wp--preset--font-size--small); }
.slap-card .slap-veil { background: color-mix(in srgb, var(--wp--preset--color--canvas) 36%, transparent); } /* on a card the piece keeps its own colours, only a light veil in the card's own ground (the picture tile is gone, so a fixed light veil would show as a grey square in dark) */
.gallery__main--sold:not([data-idx="0"]) .slap-veil { display: none; }
@media (hover: hover) {
	.slap-card--sold:hover .slap-veil { opacity: 0; }
}
/* The labels keep fixed colours in both themes: a quiet grey pill for sold, a white pill with a green dot for available. */
.slap-card .badge--sold { background: #fff; color: #6e6e73; border-color: #e5e5ea; font-weight: 600; }
.slap-card .badge--ok { background: #fff; color: #111; border-color: #d2d2d7; }
.badge--ok { display: inline-flex; align-items: center; gap: 6px; }
.badge--ok::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--wp--preset--color--success); }

/* Shop index: the SLÄP! collection section above the product grid */
.slap-shopsec { margin: 8px 0 clamp(28px, 4vw, 44px); padding: clamp(16px, 3vw, 28px); border: 1px solid var(--st-hairline); border-radius: var(--st-card); background: var(--st-subtle); }
.slap-shopsec__head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 8px 24px; margin: 0 0 18px; }
.slap-shopsec__head h2 { font-size: clamp(1.5rem, 3vw + .5rem, 2.25rem); letter-spacing: -0.025em; line-height: 1.1; margin: 0 0 6px; }
.slap-shopsec__head p { margin: 0; max-width: 40rem; color: var(--st-ink-2); }
.slap-shopsec__all { font-weight: 600; color: var(--st-ink); white-space: nowrap; }
.slap-shopsec .pgrid { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) { .slap-shopsec .pgrid { grid-template-columns: repeat(4, 1fr); } }
.slap-tile__link { display: flex; flex-direction: column; flex: 1; min-width: 0; border: 1px solid var(--st-hairline); border-radius: var(--st-card); overflow: hidden; background: var(--st-canvas); color: var(--st-ink); text-decoration: none; transition: border-color var(--st-ease); }
.slap-tile__link:hover { border-color: var(--st-ink); text-decoration: none; }
.slap-tile__media { aspect-ratio: 1; background: var(--st-tile); display: block; overflow: hidden; }
.slap-tile__media img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 0; }
.slap-tile__text { display: grid; gap: 2px; padding: 14px; }
.slap-tile__text > span { font-size: var(--wp--preset--font-size--small); color: var(--st-ink-2); }
.slap-tile__text strong { font-size: var(--wp--preset--font-size--small); }
.slap-tile__go { color: var(--st-ink) !important; font-weight: 700; }
.slap-shopsec__staff { margin: 14px 0 0; font-size: var(--wp--preset--font-size--xs); color: var(--st-ink-3); }

/* Product page */
.slap-sold { margin: 12px 0 0; font-size: var(--wp--preset--font-size--small); color: var(--st-ink-2); }
.slap-sold a { color: var(--st-ink); font-weight: 600; }
.slap-more { padding-top: clamp(32px, 5vw, 56px); border-top: 1px solid var(--st-hairline); margin-top: 24px; }
.slap-more h2 { font-size: var(--wp--preset--font-size--h-2); margin: 0 0 24px; }
.slap-more p { margin: 24px 0 0; }
.slap-more__all { font-weight: 600; color: var(--st-ink); }

/* Story block on the collection page */
.slap-story { margin: clamp(28px, 5vw, 56px) 0; display: grid; gap: 20px; }
.slap-story h2, .slap-pieces h2 { font-size: var(--wp--preset--font-size--h-2); margin: 0; }
.slap-facts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.slap-facts li { display: grid; gap: 4px; padding: 16px; border: 1px solid var(--st-hairline); border-radius: var(--st-card); background: var(--st-subtle); }
.slap-facts b { font-family: var(--st-mono); font-size: clamp(1.25rem, 3.4vw, 2rem); letter-spacing: -0.02em; line-height: 1.1; }
.slap-facts span { font-size: var(--wp--preset--font-size--xs); color: var(--st-ink-2); }
.slap-story__body { display: grid; gap: 20px; align-items: start; }
@media (min-width: 900px) { .slap-story__body { grid-template-columns: minmax(0, 1fr) 420px; gap: 48px; } }
.slap-story__text { max-width: 40rem; }
.slap-story__text p { margin: 0 0 14px; font-size: 1.0625rem; line-height: 1.55; }
.slap-story__photo { margin: 0; background: var(--st-tile); border-radius: var(--st-media); overflow: hidden; }
.slap-story__photo img { display: block; width: 100%; height: auto; }
.slap-pieces { margin: 0 0 20px; display: grid; gap: 8px; }
.slap-pieces p { margin: 0; max-width: 40rem; color: var(--st-ink-2); }
.slap-support { margin: 40px 0 0; color: var(--st-ink-2); font-size: var(--wp--preset--font-size--small); }

/* Piece switcher on the product page */
.slap-switch { display: grid; gap: 12px; margin: 0 0 20px; padding: 14px; border: 1px solid var(--st-hairline); border-radius: var(--st-card); background: var(--st-subtle); }
.slap-switch__row { display: flex; gap: 10px 12px; align-items: center; flex-wrap: wrap; }
.slap-switch__label { flex: 0 0 52px; font-size: var(--wp--preset--font-size--xs); font-weight: 600; color: var(--st-ink-2); }
.slap-switch__items { display: flex; gap: 5px; flex-wrap: wrap; flex: 1 1 0; min-width: 0; }
.slap-switch .pill { display: inline-flex; align-items: center; text-decoration: none; }
.slap-chip { display: inline-grid; place-items: center; min-width: 32px; height: 36px; padding: 0 6px; border: 1px solid var(--st-hairline-dark); border-radius: 10px; background: var(--st-canvas); color: var(--st-ink); font: 600 var(--wp--preset--font-size--small)/1 var(--st-mono); text-decoration: none; }
.slap-chip:hover { border-color: var(--st-ink); }
.slap-chip[data-state="sold"] { color: var(--st-ink-2); text-decoration: line-through; }
.slap-chip[aria-current="page"] { background: var(--st-ink); color: var(--wp--preset--color--canvas); border-color: var(--st-ink); text-decoration: none; }
.slap-switch__step { display: flex; justify-content: space-between; gap: 12px; font-size: var(--wp--preset--font-size--small); font-weight: 600; }
.slap-switch__step a { color: var(--st-ink); text-decoration: none; }
.slap-switch__step a:hover { text-decoration: underline; }
.slap-switch__step .is-off { color: var(--st-ink-3); }
.playout.is-loading { opacity: .55; transition: opacity 120ms ease; pointer-events: none; }

/* Collection grouped by size */
.slap-sizes { display: grid; gap: clamp(32px, 5vw, 56px); }
.slap-size[hidden] { display: none; }
.slap-size__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; padding: 0 0 12px; margin: 0 0 18px; border-bottom: 1px solid var(--st-hairline); }
.slap-size__head h3 { font-size: clamp(1.5rem, 3vw + .5rem, 2.25rem); letter-spacing: -0.025em; line-height: 1.1; margin: 0; }
.slap-size__head p { margin: 0; font-family: var(--st-mono); font-weight: 600; color: var(--st-ink); }
.slap-size__head .slap-size__count { margin-left: auto; font-size: var(--wp--preset--font-size--small); color: var(--st-ink-2); }

.slap-cert { margin: 12px 0 0; max-width: 420px; border-radius: var(--st-media); overflow: hidden; }
.slap-cert img { display: block; width: 100%; height: auto; }
/* Desktop: certificate left, heading and text right. Only when a certificate exists, so the text never leaves an empty left column. */
@media (min-width: 900px) {
	.slap-pieces:has(> .slap-cert) { grid-template-columns: 420px minmax(0, 1fr); grid-template-rows: auto auto 1fr; column-gap: 48px; align-items: start; }
	.slap-pieces:has(> .slap-cert) > .slap-cert { grid-column: 1; grid-row: 1 / span 3; margin: 0; }
	.slap-pieces:has(> .slap-cert) > h2 { grid-column: 2; grid-row: 1; }
	.slap-pieces:has(> .slap-cert) > p { grid-column: 2; grid-row: 2; }
}
