/*
 * ShopLeaf shop (/shop, /shop/slug). Fonts and text colour come from the site; surfaces are tints of
 * the text colour so light and dark templates both work. --ssh-accent sets the button colour.
 */
.ssh {
    --ssh-accent: var(--primary, #1b810d);
    --ssh-muted: #6b6f76;
    --ssh-line: rgba(128, 128, 128, 0.28);
    --ssh-card: rgba(128, 128, 128, 0.06);
    max-width: 1200px; margin: 0 auto; padding: calc(var(--sl-header-offset, 0px) + 36px) 20px 80px;
    box-sizing: border-box; color: inherit; text-align: left; font-size: 15px; line-height: 1.55;
}
@supports (color: color-mix(in srgb, red 50%, transparent)) {
    .ssh { --ssh-muted: color-mix(in srgb, currentColor 62%, transparent); --ssh-line: color-mix(in srgb, currentColor 16%, transparent); --ssh-card: color-mix(in srgb, currentColor 4%, transparent); }
}
.ssh * { box-sizing: border-box; }
.ssh a { color: inherit; }
.ssh h1 { font-size: 34px; line-height: 1.2; margin: 0 0 8px; padding: 0; border: 0; text-transform: none; font-weight: 800; }
.ssh h2 { text-transform: none; border: 0; padding: 0; }
.ssh button { all: unset; box-sizing: border-box; cursor: pointer; font: inherit; }
.ssh button:focus-visible { outline: 2px solid var(--ssh-accent); outline-offset: 2px; }
.ssh-empty { color: var(--ssh-muted); padding: 30px 0; }
.ssh-empty a { color: var(--ssh-accent); }
.ssh-flag { background: rgba(255, 179, 0, 0.16); border-radius: 8px; padding: 8px 12px; margin-bottom: 14px; font-size: 14px; }

/* List */
.ssh-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 14px; }
.ssh-search input { width: 260px; font: inherit; color: inherit; background: transparent; border: 1px solid var(--ssh-line); border-radius: 999px; padding: 9px 16px; height: auto; margin: 0; outline: none; }
.ssh-search input:focus { border-color: var(--ssh-accent); }
.ssh-cats { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.ssh-cats a { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--ssh-line); text-decoration: none; font-size: 14px; font-weight: 600; }
.ssh-cats a.on { background: var(--ssh-accent); border-color: var(--ssh-accent); color: #fff; }
.ssh-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; font-size: 14px; color: var(--ssh-muted); }
.ssh-bar select { font: inherit; font-size: 14px; color: inherit; background: transparent; border: 1px solid var(--ssh-line); border-radius: 8px; padding: 6px 10px; width: auto; height: auto; margin: 0; }
.ssh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 26px 18px; }
.ssh-card { display: block; text-decoration: none; }
.ssh-card img, .ssh-noimage { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 12px; background: var(--ssh-card); transition: transform 0.25s; }
.ssh-card:hover img { transform: translateY(-3px); }
.ssh-card h2 { font-size: 16px; font-weight: 700; margin: 10px 0 2px; line-height: 1.35; }
.ssh-price { font-weight: 700; }
.ssh-price s { color: var(--ssh-muted); font-weight: 400; margin-left: 6px; }
.ssh-out { font-size: 13px; color: var(--ssh-muted); }
.ssh-pages { display: flex; justify-content: space-between; margin-top: 30px; font-size: 14px; color: var(--ssh-muted); }
.ssh-pages a { color: var(--ssh-accent); }

/* Collections: a set number of columns, header image, intro, and the collections index */
.ssh-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ssh-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ssh-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ssh-grid.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 22px 14px; }
.ssh-hero { position: relative; border-radius: 16px; overflow: hidden; margin-bottom: 22px; background: var(--ssh-card); }
.ssh-hero img { display: block; width: 100%; height: clamp(180px, 32vw, 380px); object-fit: cover; }
.ssh-hero-text { position: absolute; inset: auto 0 0 0; padding: 60px 28px 22px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.55)); color: #fff; }
.ssh-hero-text h1 { color: #fff; margin: 0; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35); }
.ssh-intro { max-width: 760px; margin: 0 0 22px; line-height: 1.65; }
.ssh-intro p { margin: 0 0 10px; }
.ssh-collections { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.ssh-collection { display: block; text-decoration: none; border-radius: 14px; overflow: hidden; border: 1px solid var(--ssh-line); }
.ssh-collection img, .ssh-collection .ssh-noimage { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 0; background: var(--ssh-card); transition: transform 0.25s; }
.ssh-collection:hover img { transform: scale(1.03); }
.ssh-collection div { padding: 12px 16px 14px; }
.ssh-collection h2 { font-size: 18px; font-weight: 800; margin: 0 0 2px; }
.ssh-collection span { font-size: 13px; color: var(--ssh-muted); }

/* Brands: logo in the header, the owner's HTML above and below the listing, and the /brands index */
.ssh-brand-head { justify-content: flex-start; }
.ssh-brand-head img { max-height: 72px; max-width: 200px; object-fit: contain; }
.ssh-hero-logo { display: block; max-height: 64px; max-width: 220px; object-fit: contain; margin-bottom: 10px; filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.35)); }
.ssh-html { line-height: 1.65; overflow-wrap: break-word; }
.ssh-html-top { margin: 0 0 26px; }
.ssh-html-bottom { margin: 44px 0 0; padding-top: 30px; border-top: 1px solid var(--ssh-line); }
.ssh-html > :first-child { margin-top: 0; }
.ssh-html img, .ssh-html video, .ssh-html iframe { max-width: 100%; height: auto; }
.ssh-brands { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; }
.ssh-brand { display: block; text-decoration: none; text-align: center; border: 1px solid var(--ssh-line); border-radius: 14px; padding: 16px 14px 14px; transition: border-color 0.2s, transform 0.2s; }
.ssh-brand:hover { border-color: var(--ssh-accent); transform: translateY(-2px); }
.ssh-brand-logo { height: 90px; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.ssh-brand-logo img { max-width: 100%; max-height: 90px; object-fit: contain; }
.ssh-brand-logo b { width: 76px; height: 76px; border-radius: 50%; background: var(--ssh-card); border: 1px solid var(--ssh-line); display: flex; align-items: center; justify-content: center; font-size: 32px; font-weight: 800; }
.ssh-brand h2 { font-size: 16px; font-weight: 700; margin: 0 0 2px; }
.ssh-brand > span { font-size: 13px; color: var(--ssh-muted); }

/* Product */
.ssh-crumbs { font-size: 13px; color: var(--ssh-muted); margin-bottom: 14px; }
.ssh-crumbs a { color: var(--ssh-muted); text-decoration: none; }
.ssh-product { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 44px; align-items: start; }
.ssh-main-image img, .ssh-noimage.big { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 16px; display: block; background: var(--ssh-card); }
.ssh-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.ssh-thumbs button { width: 72px; height: 72px; border-radius: 10px; overflow: hidden; opacity: 0.6; border: 2px solid transparent; }
.ssh-thumbs button.on, .ssh-thumbs button:hover { opacity: 1; border-color: var(--ssh-accent); }
.ssh-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ssh-vendor { font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ssh-muted); }
.ssh-price.big { font-size: 24px; margin: 4px 0 6px; }
.ssh-note { font-size: 13px; color: var(--ssh-muted); margin-bottom: 8px; }
.ssh-option { margin: 16px 0 6px; }
.ssh-option label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; text-transform: none; color: inherit; width: auto; }
.ssh-choices { display: flex; gap: 6px; flex-wrap: wrap; }
.ssh-choices button { padding: 8px 14px; border-radius: 10px; border: 1px solid var(--ssh-line); font-size: 14px; font-weight: 600; }
.ssh-choices button.on { border-color: var(--ssh-accent); box-shadow: inset 0 0 0 1px var(--ssh-accent); }
.ssh-choices button.unavailable { opacity: 0.45; text-decoration: line-through; }
.ssh-stock { min-height: 22px; font-size: 14px; font-weight: 700; color: #c0392b; margin-top: 8px; }
.ssh .ssh-buy { display: flex; justify-content: center; width: 100%; padding: 14px 20px; border-radius: 999px; background: var(--ssh-accent); color: #fff; font-weight: 700; font-size: 16px; margin: 8px 0; }
.ssh .ssh-buy[disabled] { opacity: 0.5; cursor: not-allowed; }
.ssh-description { margin-top: 22px; }
.ssh-description p { margin: 0 0 10px; }
.ssh-fields { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--ssh-line); font-size: 14px; }
.ssh-fields dt { color: var(--ssh-muted); font-weight: 600; }
.ssh-fields dd { margin: 0; }

@media (max-width: 760px) {
    .ssh-product { grid-template-columns: 1fr; gap: 20px; }
    .ssh h1 { font-size: 26px; }
    .ssh-search input { width: 100%; }
    .ssh-grid, .ssh-grid.cols-3, .ssh-grid.cols-4, .ssh-grid.cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
    .ssh-hero-text { padding: 40px 18px 16px; }
}
@media (min-width: 761px) and (max-width: 1000px) {
    .ssh-grid.cols-4, .ssh-grid.cols-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
