/* Public storefront pages (/s/<slug>) and the directory (/explore): plain, fast, readable. The merchant's accent arrives as --accent (and
   --on-accent, a readable text colour for it) from /s/<slug>/theme.css. Theme, font and layout are chosen by classes on <html>, from closed lists
   validated when the store is saved: presentation is a choice, never merchant-supplied CSS. */
:root { --bg: #fbfaf7; --surface: #ffffff; --text: #23201a; --muted: #6a6459; --border: #e4ded1; --accent: #6fe3c0; --on-accent: #0b0f0c; --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color-scheme: light dark; }
@media (prefers-color-scheme: dark) { :root.t-auto { --bg: #14120f; --surface: #1d1a15; --text: #efe8d8; --muted: #a39c8d; --border: #332e25; } }
/* Fixed looks. `t-auto` (the default) follows the visitor's own light/dark setting, above. */
html.t-light { --bg: #fbfaf7; --surface: #ffffff; --text: #23201a; --muted: #6a6459; --border: #e4ded1; color-scheme: light; }
html.t-dark { --bg: #14120f; --surface: #1d1a15; --text: #efe8d8; --muted: #a39c8d; --border: #332e25; color-scheme: dark; }
html.t-paper { --bg: #f4ecd8; --surface: #fbf5e6; --text: #3b3226; --muted: #7a6c56; --border: #d9cba8; color-scheme: light; }
html.t-noir { --bg: #0a0a0b; --surface: #141416; --text: #f2f2f0; --muted: #9a9aa0; --border: #2a2a2e; color-scheme: dark; }
html.t-ocean { --bg: #eef5f9; --surface: #ffffff; --text: #12303f; --muted: #52717f; --border: #cfe0e9; color-scheme: light; }
html.t-forest { --bg: #f0f4ee; --surface: #fbfdf9; --text: #1f3222; --muted: #5b7060; --border: #d3decf; color-scheme: light; }
html.t-blush { --bg: #fbf1f0; --surface: #fffafa; --text: #3d2325; --muted: #8a6367; --border: #ecd3d1; color-scheme: light; }
html.f-serif { --font: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif; }
html.f-mono { --font: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
html.f-rounded { --font: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, sans-serif; }

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); }
a { color: inherit; }
img { max-width: 100%; }

.announce { background: var(--accent); color: var(--on-accent); text-align: center; padding: 0.5rem 1rem; font-size: 0.9rem; font-weight: 600; }
.banner img { display: block; width: 100%; max-height: 260px; object-fit: cover; }
.store-head { max-width: 960px; margin: 0 auto; padding: 2.2rem 1.2rem 0.5rem; border-top: 6px solid var(--accent); }
.store-head.slim { padding-top: 1.2rem; }
.banner + .store-head, .announce + .store-head { border-top: 0; }
.brand { display: flex; align-items: center; gap: 0.8rem; }
.logo { width: 56px; height: 56px; object-fit: cover; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.store-head h1 { margin: 0; font-size: 2rem; line-height: 1.2; }
.store-head h1 a { text-decoration: none; }
.tagline { margin: 0.4rem 0 0; color: var(--muted); font-size: 1.05rem; }
.socials { margin: 0.6rem 0 0; font-size: 0.9rem; color: var(--muted); }
.socials a { color: var(--text); }
.crumb { margin: 0; font-size: 0.9rem; color: var(--muted); }
.store-main { max-width: 960px; margin: 0 auto; padding: 1rem 1.2rem 2rem; }
.about p { max-width: 65ch; }
.section-title { margin: 1.4rem 0 0; font-size: 1.3rem; }

/* browse bar: search, collection chips, sort */
.store-nav { margin-top: 1.2rem; display: flex; flex-direction: column; gap: 0.7rem; }
.search { display: flex; gap: 0.4rem; max-width: 420px; }
.search input { flex: 1; font: inherit; padding: 0.45rem 0.8rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); }
.search button { font: inherit; padding: 0.45rem 0.9rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip { display: inline-block; padding: 0.25rem 0.8rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); text-decoration: none; font-size: 0.88rem; }
.chip.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 600; }
.chip .n { color: var(--muted); font-size: 0.8em; }
.chip.on .n { color: inherit; }
.sort { margin: 0; font-size: 0.85rem; color: var(--muted); }
.sort a { text-decoration: none; margin-right: 0.5rem; }
.sort a.on { color: var(--text); font-weight: 700; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }

/* products */
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.2rem; margin-top: 1.5rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.card .media { position: relative; display: block; }
.card .media.plain { min-height: 2rem; }
.card .media.ph { aspect-ratio: 4 / 3; border-radius: 8px; background: var(--border); display: flex; align-items: center; justify-content: center; text-decoration: none; }
.card .media.ph span.initial { font-size: 3rem; font-weight: 700; color: var(--accent); opacity: 0.9; }
.card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: var(--border); display: block; }
.card-body { display: flex; flex-direction: column; gap: 0.35rem; flex: 1; }
.card h3 { margin: 0.2rem 0 0; font-size: 1.05rem; }
.card h3 a { text-decoration: none; }
.card.is-sold img { filter: grayscale(0.8); opacity: 0.8; }
.badge { position: absolute; top: 0.5rem; left: 0.5rem; background: var(--accent); color: var(--on-accent); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; padding: 0.15rem 0.55rem; border-radius: 999px; }
.badge.sold { background: #23201a; color: #fff; }
.product-info > .badge { position: static; display: inline-block; margin-bottom: 0.4rem; }
.price { margin: 0; font-weight: 700; }
.price .was { color: var(--muted); font-weight: 400; margin-right: 0.25rem; }
.price .save { color: var(--on-accent); background: var(--accent); font-size: 0.72rem; padding: 0.1rem 0.45rem; border-radius: 999px; margin-left: 0.25rem; }
.blurb { margin: 0; color: var(--muted); font-size: 0.92rem; flex: 1; }
.buy { display: inline-block; text-align: center; background: var(--accent); color: var(--on-accent); padding: 0.6rem 1rem; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 0.92rem; border: 0; cursor: pointer; }
.buy:hover { filter: brightness(0.95); }
.buy.sold { background: var(--border); color: var(--muted); cursor: default; }
.buy.sold:hover { filter: none; }

/* layouts: grid (default), list (one per row), compact (denser) */
html.l-list .products { grid-template-columns: 1fr; }
html.l-list .card { flex-direction: row; align-items: stretch; }
html.l-list .card .media { flex: 0 0 200px; }
html.l-list .card img { height: 100%; aspect-ratio: auto; }
html.l-compact .products { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.8rem; }
html.l-compact .card { padding: 0.6rem; }
html.l-compact .blurb { display: none; }
@media (max-width: 560px) { html.l-list .card { flex-direction: column; } html.l-list .card .media { flex-basis: auto; } html.l-list .card img { aspect-ratio: 4 / 3; height: auto; } }

/* product page */
.product-page { max-width: 760px; }
.gallery { margin-bottom: 1rem; }
.hero-img { width: 100%; max-height: 460px; object-fit: cover; border-radius: 12px; display: block; }
.thumbs { display: flex; gap: 0.5rem; margin-top: 0.5rem; flex-wrap: wrap; }
.thumbs img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.product-info h1 { margin: 0 0 0.3rem; }
.product-info .buy { margin-top: 0.8rem; }
.fineprint { color: var(--muted); font-size: 0.85rem; }
.related { margin-top: 2.2rem; }
.related h2 { font-size: 1.15rem; }

/* policies and FAQ (native <details>: no script) */
.policies, .faq { margin-top: 1.8rem; max-width: 65ch; }
.faq h2 { font-size: 1.15rem; margin: 0 0 0.5rem; }
details.info { border-bottom: 1px solid var(--border); padding: 0.5rem 0; }
details.info summary { cursor: pointer; font-weight: 600; }
details.info p { margin: 0.4rem 0 0.2rem; color: var(--muted); }

.empty, .contact { color: var(--muted); }
.store-foot { max-width: 960px; margin: 0 auto; padding: 2rem 1.2rem 3rem; font-size: 0.82rem; color: var(--muted); text-align: center; }
.report-form { display: flex; flex-direction: column; gap: 0.8rem; max-width: 520px; }
.report-form label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.9rem; }
.report-form textarea, .report-form input { font: inherit; padding: 0.5rem 0.7rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.hp { position: absolute; left: -9999px; height: 0; width: 0; opacity: 0; }

/* directory (/explore) */
.stores-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.2rem; margin-top: 1.4rem; }
.store-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 0.8rem; display: flex; flex-direction: column; gap: 0.3rem; }
.store-card .thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.3rem; margin: 0; min-height: 84px; }
.store-card .thumbs img { width: 100%; height: 84px; border-radius: 6px; }
.store-card .noimg { grid-column: 1 / -1; align-self: center; text-align: center; color: var(--muted); font-size: 0.85rem; }
.store-card h3 { margin: 0.3rem 0 0; font-size: 1.05rem; }
.store-card h3 a { text-decoration: none; }
.store-card .cat { margin: 0; font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
html.l-list .buy { align-self: flex-start; }
