/*
 * Public vendor pages ([keystone_vendor_storefront], [keystone_vendor_directory], [keystone_vendor_apply])
 * — layout only (0.21.0, UX brief Phase 4). The pages are wrapped by `PublicUi::wrap($branding, $html, 'ks-mp-page')`
 * and built from the shared kit (cards, buttons, pills, fields, pager, empty states); this file only arranges them.
 * It carries no colours, fonts or tokens of its own, apart from the dark scrim over a banner photo.
 */
.ks-mp-page .ks-card { margin: 0; }
.ks-mp-page .ks-notice { margin-bottom: var(--ks-space-4); }
.ks-mp-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ks-mp-apply-form { max-width: 760px; margin: 0 auto; }
.ks-mp-apply-form .ks-form-section { margin-bottom: var(--ks-space-4); }

.ks-mp-search { display: flex; gap: var(--ks-space-2); margin-bottom: var(--ks-space-5); }
.ks-mp-search .ks-input { flex: 1; min-width: 0; max-width: 320px; }
/* 0.22.3: the theme's own input/button rules (box-sizing, margin, padding, line-height) made the field and the
   button different heights; pin both to the same box so they line up. */
.ks-public .ks-mp-search input.ks-input,
.ks-public .ks-mp-search button.ks-btn { box-sizing: border-box; height: var(--ks-control-h); min-height: 0; margin: 0; padding-top: 0; padding-bottom: 0; line-height: 1; vertical-align: top; }
.ks-public .ks-mp-search { align-items: center; }

/* ---- product / vendor card grid (the `columns` attribute is a class: ks-mp-cols-1 … 8) ---- */
.ks-mp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--ks-space-5); margin: var(--ks-space-5) 0; }
@media (min-width: 1024px) {
  .ks-mp-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); } .ks-mp-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ks-mp-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .ks-mp-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ks-mp-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } .ks-mp-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .ks-mp-cols-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); } .ks-mp-cols-8 { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}
/* The storefront's grid shares its row with the sidebar, so it needs more page width before it uses the fixed count. */
.ks-mp-storefront-main .ks-mp-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
@media (min-width: 1240px) {
  .ks-mp-storefront-main .ks-mp-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); } .ks-mp-storefront-main .ks-mp-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ks-mp-storefront-main .ks-mp-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .ks-mp-storefront-main .ks-mp-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ks-mp-storefront-main .ks-mp-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } .ks-mp-storefront-main .ks-mp-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .ks-mp-storefront-main .ks-mp-cols-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); } .ks-mp-storefront-main .ks-mp-cols-8 { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}

.ks-mp-page .ks-mp-card { display: flex; flex-direction: column; min-width: 0; padding: 0; overflow: hidden; }
/* A fixed square image box filled by the photo whatever its shape — the kit's `.ks-public img { height: auto }` must not stretch it. */
.ks-mp-page .ks-mp-card__img { position: relative; display: block; aspect-ratio: 1 / 1; overflow: hidden; background: var(--ks-surface-2); }
.ks-mp-page .ks-mp-card__img img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.ks-mp-card__body { display: flex; flex-direction: column; align-items: flex-start; gap: var(--ks-space-2); padding: var(--ks-space-3); flex: 1; }
.ks-mp-card__title { margin: 0; font-size: 1em; line-height: 1.3; overflow-wrap: anywhere; }
.ks-public.ks-mp-page .ks-mp-card .ks-mp-card__body .ks-mp-card__title a { color: inherit; text-decoration: none; }
.ks-public.ks-mp-page .ks-mp-card .ks-mp-card__body .ks-mp-card__title a:hover { color: var(--ks-accent); }
.ks-mp-card__body .ks-hint, .ks-mp-card__price { margin: 0; }
.ks-mp-card__more { margin-top: auto; font-weight: 600; text-decoration: none; }
.ks-mp-card__cta { margin-top: auto; }
.ks-mp-page .ks-pager { margin: var(--ks-space-5) 0; text-align: center; }

/* ---- storefront hero: full-bleed (breaks out of the theme's content column); banner photo fills it ---- */
.ks-mp-storefront-hero {
  position: relative; left: 50%; width: 100vw; margin-left: -50vw; margin-right: -50vw;
  min-height: 220px; display: flex; align-items: center; overflow: hidden; background: var(--ks-sidebar-bg);
}
.ks-mp-page .ks-mp-storefront-hero__bg { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.ks-mp-storefront-hero-overlay { position: relative; background: rgba(15, 20, 28, .55); padding: 54px var(--ks-space-6); width: 100%; }
.ks-mp-storefront-hero-inner { max-width: 1440px; width: 100%; margin: 0 auto; display: flex; align-items: center; gap: var(--ks-space-4); flex-wrap: wrap; }
.ks-mp-page .ks-mp-storefront-logo { height: 126px; width: 126px; max-width: none; object-fit: cover; border-radius: var(--ks-radius); background: #fff; padding: 4px; flex: 0 0 auto; }
.ks-mp-storefront-hero-text h1 { margin: 0; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.ks-mp-storefront-meta { margin: var(--ks-space-1) 0 0; color: #fff; opacity: .9; }

.ks-mp-storefront-body { max-width: 1440px; margin: 0 auto; padding: var(--ks-space-5) var(--ks-space-5) 0; }
.ks-mp-storefront-layout { display: flex; flex-wrap: wrap; gap: var(--ks-space-6); align-items: flex-start; }
.ks-mp-storefront-sidebar { flex: 1 1 220px; max-width: 260px; }
.ks-mp-storefront-sidebar .ks-mp-search { max-width: none; }
.ks-mp-storefront-main { flex: 3 1 600px; min-width: 0; }
.ks-mp-storefront-socials { margin-bottom: var(--ks-space-3); }
.ks-mp-storefront-terms { margin-top: var(--ks-space-4); }

/* ---- category list ---- */
.ks-mp-cats__list { list-style: none; margin: 0; padding: 0; }
.ks-mp-cats__list li { margin: 0 0 var(--ks-space-1); }
.ks-public.ks-mp-page .ks-mp-cats .ks-mp-cats__list .ks-mp-cats__link { display: block; padding: var(--ks-space-1) var(--ks-space-2); border-radius: var(--ks-radius-sm); color: inherit; text-decoration: none; }
.ks-public.ks-mp-page .ks-mp-cats .ks-mp-cats__list .ks-mp-cats__link:hover { background: var(--ks-surface-2); }
.ks-mp-cats__list li.is-active .ks-mp-cats__link { background: var(--ks-accent-soft); font-weight: 600; }
.ks-mp-cats .ks-hint { margin: 0; }

/* The 100vw hero is as wide as the viewport INCLUDING a classic scrollbar, which would add a sideways scrollbar: clip it on storefront pages only. */
html:has(.ks-mp-storefront-hero), body:has(.ks-mp-storefront-hero) { overflow-x: clip; }
