/* Ecommerce Portal (Multiple Vendor), phase 7: storefront, store bar with the mega menu and the search box, home blocks,
 * result cards with seller counts, filters, admin theme editor and page builder (phone first: 390 px and up; ported from
 * the Single Vendor product's shop.css). */
.sf-products { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sf-gap, .75rem); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .sf-products { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .sf-products { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.sf-card a { display: flex; flex-direction: column; gap: .35rem; height: 100%; padding: .5rem; border: 1px solid var(--sf-card-border, var(--border)); box-shadow: var(--sf-card-shadow, none); border-radius: var(--radius-lg, .75rem); background: var(--surface); color: var(--text); text-decoration: none; }
.sf-card img, .sf-noimg { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: .5rem; background: var(--bg-muted); }
.sf-noimg { display: grid; place-items: center; color: var(--text-subtle); }
.sf-card-title { font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.sf-card-price { color: var(--brand-text); font-weight: 700; }
.sf-card-price s { color: var(--text-subtle); font-weight: 400; font-size: .85em; margin-left: .25rem; }
.sf-card-sellers { font-size: .85rem; color: var(--text-muted); }
.sf-card .badge { align-self: flex-start; }
.sf-chips { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .5rem; margin: 0 0 1rem; list-style: none; padding-left: 0; }
.sf-chips a { flex: 0 0 auto; display: inline-block; padding: .4rem .8rem; border: 1px solid var(--border); border-radius: 999px; color: var(--text); text-decoration: none; white-space: nowrap; }
.sf-sort { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.sf-sort .select { width: auto; }
.sf-bar { border-bottom: 1px solid var(--border); background: var(--surface); }
.sf-bar-inner { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding-block: .5rem; }
.sf-all-cats { position: relative; }
.sf-all-cats > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: .35rem; min-height: 44px; padding: 0 .75rem; border: 1px solid var(--border); border-radius: var(--radius-btn, .5rem); font-weight: 600; }
.sf-all-cats > summary::-webkit-details-marker { display: none; }
.sf-all-cats-panel { position: absolute; z-index: 45; left: 0; top: calc(100% + .25rem); width: min(92vw, 22rem); max-height: 70vh; overflow-y: auto; padding: .5rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg, .75rem); box-shadow: var(--shadow-lg); }
.sf-all-cats-panel a { display: block; padding: .5rem; min-height: 40px; color: var(--text); text-decoration: none; }
.sf-all-cats-panel .sf-sub { padding-left: 1.5rem; font-size: .92em; }
@media (min-width: 64rem) { .sf-all-cats { display: none; } }
/* Phase 4: the storefront — theme tokens, mega menu, home blocks (phone first; panels only from 64rem) */
.sf-mega { display: none; }
.sf-mega-list { display: flex; flex-wrap: wrap; gap: .25rem; margin: 0; padding: 0; list-style: none; }
.sf-mega-item { position: relative; }
.sf-mega-highlight > a, .sf-mega-highlight summary { color: var(--sf-accent, var(--brand-text)); font-weight: 600; }
.sf-mega-details > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: .25rem; }
.sf-mega-details > summary::-webkit-details-marker { display: none; }
.sf-mega-panel { position: absolute; z-index: 40; left: 0; top: 100%; min-width: min(90vw, 40rem); padding: 1rem; background: var(--surface-raised, var(--surface)); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.sf-mega-columns { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); margin-top: .5rem; }
.sf-mega-col ul { margin: .25rem 0 0; padding: 0; list-style: none; display: grid; gap: .2rem; }
.sf-mega-col a, .sf-mega-all { color: var(--text); text-decoration: none; }
.sf-mega-head { font-weight: 600; }
.sf-mega-promo { display: block; padding: .75rem; border-radius: var(--radius); background: var(--brand-soft); color: var(--brand-text); font-weight: 600; text-decoration: none; }
@media (min-width: 64rem) { .sf-mega { display: block; flex: 1; } }
.sf-drawer-group > summary { cursor: pointer; }
.sf-drawer-sub { padding-left: 1.5rem; }
.sf-drawer-sub2 { padding-left: 2.5rem; font-size: .9em; }
.sf-preview-bar { padding: .5rem 1rem; background: var(--warning-soft, #fef3c7); color: var(--text); text-align: center; }
.sf-home-blocks { display: grid; gap: calc(var(--sf-gap, 1rem) * 2); padding-block: var(--sf-gap, 1rem); }
.sf-block-title { margin: 0 0 .75rem; font-family: var(--font-heading); }
.sf-hero { display: grid; gap: var(--sf-gap, 1rem); align-items: center; padding: calc(var(--sf-gap, 1rem) * 1.5); border-radius: var(--radius-xl); background: var(--brand-soft); }
.sf-hero h1, .sf-hero h2 { margin: 0 0 .5rem; font-family: var(--font-heading); }
.sf-hero-media img { width: 100%; height: auto; border-radius: var(--radius-lg); }
@media (min-width: 48rem) { .sf-hero-image { grid-template-columns: 1fr 1fr; } }
.sf-tiles { display: grid; gap: var(--sf-gap-sm, .75rem); grid-template-columns: repeat(auto-fill, minmax(min(100%, 9rem), 1fr)); margin: 0; padding: 0; list-style: none; }
.sf-tiles a, .sf-tiles span { display: block; padding: .9rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); text-align: center; text-decoration: none; font-weight: 600; }
.sf-image-text { display: grid; gap: var(--sf-gap, 1rem); align-items: center; }
.sf-image-text img { width: 100%; height: auto; border-radius: var(--radius-lg); }
@media (min-width: 48rem) { .sf-image-text { grid-template-columns: 1fr 1fr; } .sf-image-right > :first-child { order: 2; } }
.sf-faq details { padding: .75rem 0; border-bottom: 1px solid var(--border); }
.sf-faq summary { cursor: pointer; font-weight: 600; }
.sf-trust { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin: 0; padding: 0; list-style: none; }
.sf-countdown { font-weight: 600; color: var(--sf-accent, var(--brand-text)); }
@media (max-width: 47.99rem) { .sf-dev-desktop { display: none; } }
@media (min-width: 48rem) { .sf-dev-mobile { display: none; } }
/* Admin: theme editor and page builder */
.sf-theme-editor { display: grid; gap: 1rem; }
@media (min-width: 80rem) { .sf-theme-editor { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: start; } }
.sf-theme-cards { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.sf-theme-card { display: flex; gap: .5rem; padding: .75rem; border: 1px solid var(--border); border-radius: var(--radius-lg); cursor: pointer; }
.sf-theme-card > span { display: grid; gap: .2rem; }
.sf-colour { min-height: 2.5rem; padding: .2rem; }
.sf-code { font-family: var(--font-mono); font-size: .85rem; }
.sf-preview-head { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: space-between; align-items: center; }
.sf-preview-frame { overflow: auto; padding: .5rem; background: var(--bg-muted); }
.sf-preview-frame iframe { display: block; height: 40rem; max-width: none; margin-inline: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); }
.sf-frame-390 { width: 24.375rem; }
.sf-frame-768 { width: 48rem; }
.sf-frame-1280 { width: 80rem; }
.sf-builder-head { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: space-between; align-items: center; }
.sf-builder-add { display: flex; flex-wrap: wrap; gap: .4rem; }
.sf-menu-tree { margin: 0; padding-left: 1.1rem; }
/* Phase 5 — search box, suggestions, filters (R6.1, R6.4); phone first (390 px) */
.sf-search-form { position: relative; display: flex; gap: .5rem; flex: 1 1 18rem; min-width: 0; max-width: 44rem; margin-left: auto; }
.sf-search-input { flex: 1; min-width: 0; }
.sf-search-btn { flex: none; }
.sf-suggest { position: absolute; z-index: 40; top: calc(100% + .25rem); left: 0; right: 0; max-height: 70vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: .75rem; box-shadow: var(--shadow-md, 0 8px 24px rgb(0 0 0 / .12)); padding: .25rem 0; }
.sf-suggest-head { padding: .4rem .75rem .2rem; font-size: .75rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); }
.sf-suggest-item { display: flex; align-items: center; gap: .6rem; padding: .45rem .75rem; color: var(--text); text-decoration: none; min-height: 44px; }
.sf-suggest-item img { width: 40px; height: 40px; object-fit: cover; border-radius: .35rem; flex: none; }
.sf-suggest-item[aria-selected="true"], .sf-suggest-item:hover { background: var(--bg-muted); }
.sf-suggest-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.sf-suggest-price { font-weight: 700; color: var(--brand-text); white-space: nowrap; }
.sf-listing { display: grid; gap: 1rem; }
@media (min-width: 900px) { .sf-listing { grid-template-columns: 15rem minmax(0, 1fr); align-items: start; } }
.sf-listing-main { min-width: 0; }
.sf-facets-box { border: 1px solid var(--border); border-radius: .75rem; background: var(--surface); padding: .5rem .75rem; }
.sf-facets-head { cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: .4rem; min-height: 44px; }
.sf-facet { border: 0; margin: 0 0 .75rem; padding: 0; }
.sf-facet legend { font-weight: 600; margin-bottom: .25rem; }
.sf-facet-value { display: flex; align-items: center; gap: .4rem; min-height: 36px; }
.sf-facet-count { margin-left: auto; color: var(--text-muted); font-size: .85rem; }
.sf-facet-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.sf-corrected { margin: .25rem 0 0; }
.sf-card .badge { align-self: flex-start; }
.sf-store-strip a { display: grid; justify-items: center; gap: .35rem; }
.sf-store-strip img { width: 4rem; height: 4rem; object-fit: cover; border-radius: 50%; }
.sf-sell { display: grid; gap: .75rem; justify-items: start; padding: calc(var(--sf-gap, 1rem) * 1.25); border-radius: var(--radius-xl); background: var(--bg-subtle); border: 1px solid var(--border); }
.sf-store-search { display: flex; gap: .5rem; margin: 1rem 0; max-width: 32rem; }
.sf-store-search .input { flex: 1; min-width: 0; }
