/* Marketplace — 3-column directory layout: Filters | Cards | Map */
.marketplace-body {
  min-height: 100dvh;
  overflow-x: hidden;
}

.marketplace-page {
  background: #f6f8fb;
  padding-top: 0;
  height: calc(100dvh - 72px);
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ---- simple category row ---- */
.market-topbar { display: none; }
.market-tabs {
  padding: 12px max(18px, calc((100vw - 1300px) / 2));
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
  position: sticky; top: 0; z-index: 5; background: #fff;
  display: flex; align-items: center; gap: 22px;
  flex: 0 0 auto;
  overflow-x: auto; white-space: nowrap;
}
.market-tabs a,
.market-tabs button {
  border: 0; background: transparent; color: #475569;
  font: inherit; font-weight: 900; padding: 6px 0 8px;
  border-bottom: 3px solid transparent; border-radius: 0;
  cursor: pointer;
}
.market-tabs a.active, .market-tabs a:hover,
.market-tabs button.active, .market-tabs button:hover {
  background: transparent; color: var(--navy);
  border-bottom-color: var(--aqua);
}

/* ---- 3-column layout ---- */
.market-layout {
  display: grid;
  grid-template-columns: 240px minmax(320px, 420px) minmax(0, 1fr) !important;
  gap: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  height: 100%;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

/* === Column 1: Filters === */
.filter-sidebar {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: #fff;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  border-right: 1px solid rgba(15, 23, 42, 0.06);
}
.filter-sidebar .filter-heading {
  padding: 18px 16px 8px;
  flex: 0 0 auto;
}
.filter-heading .section-kicker { color: var(--aqua); font-weight: 900; }
.filter-heading h2 { font-size: 1.1rem; margin: 2px 0 0; }

.filter-sidebar .toolbar {
  padding: 0 16px 12px;
  flex: 0 0 auto;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.filter-field { margin-bottom: 10px; }
.filter-field label {
  font-weight: 800; color: var(--navy);
  font-size: 0.76rem; margin-bottom: 3px; display: block;
}
.filter-field select, .filter-field input {
  width: 100%; min-height: 34px; border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  padding: 0 8px; background: #fff;
  font-weight: 700; font-size: 0.82rem;
  box-sizing: border-box;
}

.filter-sidebar .summary {
  padding: 10px 16px;
  flex: 0 0 auto;
  font-size: 0.72rem;
  color: #64748b;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.summary-chip {
  background: rgba(15, 23, 42, 0.05);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
}

/* === Column 2: Card listings === */
.card-listings-column {
  background: #fff;
  border-right: 1px solid rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}
.card-listings-column .results-header {
  padding: 14px 18px 8px;
  flex: 0 0 auto;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}
.results-header .section-kicker {
  color: var(--aqua);
  font-weight: 900;
  font-size: 0.78rem;
}

/* Scrollable card area */
.listing-grid.marketplace-results {
  flex: 1 1 0;
  height: auto;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}
.listing-grid.marketplace-results::-webkit-scrollbar {
  width: 10px;
}
.listing-grid.marketplace-results::-webkit-scrollbar-track {
  background: rgba(116, 184, 158, 0.1);
  border-radius: 999px;
}
.listing-grid.marketplace-results::-webkit-scrollbar-thumb {
  background: rgba(7, 47, 73, 0.28);
  border-radius: 999px;
}

/* === Photo-dominant card === */
.listing-grid .card {
  display: flex;
  flex-direction: column;
  padding: 0;
  min-height: 0 !important;
  height: auto !important;
  align-self: stretch;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  background: #fff;
  cursor: pointer;
  transition: box-shadow 0.15s;
}
.listing-grid .card:hover {
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.12);
}

/* Photo area — takes up most of the card */
.card-photo-col {
  position: relative;
  width: 100%;
  min-width: unset;
  height: auto;
}
.card-photo-col::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 72px;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(7, 47, 73, 0.82), rgba(7, 47, 73, 0));
}
.card-photo-col .card-photo {
  width: 100%;
  height: 130px;
  min-height: 130px;
  margin: 0;
  border-radius: 0;
  background: #e2e8f0;
}
.card-photo-col .card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Overlay on photo */
.card-photo-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
}
.card-photo-overlay .card-name-overlay {
  color: #fff !important;
  background: rgba(7, 47, 73, 0.78);
  font-weight: 900;
  font-size: 0.96rem;
  text-shadow: 0 1px 3px rgba(0,0,0,0.45);
  line-height: 1.2;
  max-width: calc(100% - 8px);
  padding: 6px 9px;
  border-radius: 10px;
}
.card-photo-overlay .card-category-tag {
  background: rgba(23, 198, 189, 0.9);
  color: #fff;
  font-weight: 800;
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

/* Logo circle */
.card-logo-circle {
  display: none;
}
.card-logo-circle img {
  display: none;
}

/* Info below photo */
.card-info-col {
  padding: 10px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.card-info-col .badge,
.card-info-col .claimed-badge,
.card-info-col .unclaimed-badge { display: none; }

.listing-grid .card h3 {
  font-size: 0.95rem;
  margin: 0 0 2px;
  color: var(--navy);
  font-weight: 900;
}
.listing-grid .card .card-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.76rem;
  color: #64748b;
  font-weight: 700;
}
.listing-grid .card .meta-tag {
  color: var(--aqua);
  font-weight: 800;
}
.listing-grid .card .meta-loc {
  color: #475569;
}
.listing-grid .card .card-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.listing-grid .card .view-link {
  font-size: 0.7rem;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  border: 0;
  font-weight: 800;
  cursor: pointer;
}

/* Card action icons */
.card-action-icons {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}
.card-action-icons button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #fff;
  color: #64748b;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.card-action-icons button:hover {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

/* === Column 3: Map === */
.map-panel {
  display: block !important;
  height: 100%;
}
.map-panel .map-card {
  height: 100%;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0;
  display: flex;
  flex-direction: column;
  background: #e8ecf1;
}
.map-card .section-kicker { display: none; }
.map-card h2 { display: none; }

.map-placeholder {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  background: #e8ecf1;
  border: 0;
  color: #475569;
}
.map-placeholder .leaflet-tile-pane {
  filter: saturate(0.9) contrast(0.92) brightness(1.05);
}
.map-placeholder .leaflet-control-zoom {
  border: 0 !important;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(7, 47, 73, 0.16);
}
.map-placeholder .leaflet-control-zoom a {
  width: 38px;
  height: 38px;
  line-height: 36px;
  border: 0 !important;
  background: rgba(255, 255, 255, 0.94);
  color: #072f49;
  font-weight: 950;
}
.map-placeholder .leaflet-control-attribution {
  border-radius: 999px 0 0 0;
  background: rgba(255, 255, 255, 0.82);
  color: #64748b;
}
.map-logo-pin {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: #74b89e;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(7, 47, 73, 0.26);
  cursor: pointer;
}
.map-logo-pin img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.map-logo-pin--fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 950;
  font-size: 0.76rem;
}
.leaflet-popup-content-wrapper {
  border-radius: 16px;
  box-shadow: 0 14px 34px rgba(7, 47, 73, 0.18);
}
.map-popup {
  font-family: inherit;
  font-size: 0.88rem;
  padding: 4px 2px;
}
.map-popup strong {
  display: block;
  margin-bottom: 3px;
  color: #072f49;
  font-size: 0.95rem;
}
.map-popup span {
  display: block;
  margin-bottom: 8px;
  color: #1f7a5c;
  font-size: 0.76rem;
  font-weight: 900;
}
.map-popup a {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: #072f49;
  color: #fff;
  text-decoration: none;
  font-size: 0.74rem;
  font-weight: 900;
}
.map-placeholder span { font-weight: 900; font-size: 1.1rem; }
.map-placeholder small { color: #94a3b8; font-weight: 700; }

/* Hide detail panel on this page */
.detail-panel { display: none !important; }

/* Hide old results column */
.results-column { display: none; }

/* Card photo base */
.card-photo {
  overflow: hidden; background: #e2e8f0;
}
.card-photo img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}

/* ---- Mobile ---- */
@media (max-width: 860px) {
  body.marketplace-body {
    background: #eef2ee;
  }

  .marketplace-page {
    height: auto;
    min-height: calc(100dvh - 68px);
    overflow: visible;
    background:
      radial-gradient(circle at 12% 8%, rgba(116, 184, 158, 0.22), transparent 16rem),
      linear-gradient(180deg, #f8faf8 0%, #eef2ee 100%);
    padding-bottom: 18px;
  }

  .market-tabs {
    position: sticky;
    top: 68px;
    z-index: 12;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid rgba(7, 47, 73, 0.08);
    box-shadow: 0 10px 26px rgba(7, 47, 73, 0.08);
    -webkit-overflow-scrolling: touch;
  }

  .market-tabs a,
  .market-tabs button {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid rgba(7, 47, 73, 0.12);
    border-radius: 999px;
    background: #fff;
    color: #072f49;
    font-size: 0.78rem;
    letter-spacing: 0.03em;
    box-shadow: 0 6px 16px rgba(7, 47, 73, 0.06);
  }

  .market-tabs a.active,
  .market-tabs a:hover,
  .market-tabs button.active,
  .market-tabs button:hover {
    background: #072f49;
    color: #fff;
    border-color: #072f49;
  }

  .market-layout {
    grid-template-columns: 1fr !important;
    width: 100%;
    height: auto;
    min-height: 0;
    overflow: visible;
    gap: 12px;
    padding: 12px 14px 22px;
  }

  .filter-sidebar,
  .card-listings-column,
  .map-panel .map-card {
    border: 1px solid rgba(7, 47, 73, 0.1) !important;
    border-radius: 24px !important;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 14px 34px rgba(7, 47, 73, 0.1) !important;
  }

  .filter-sidebar {
    height: auto;
    max-height: none;
    overflow: visible;
    border-right: 1px solid rgba(7, 47, 73, 0.1) !important;
  }

  .filter-sidebar .filter-heading {
    padding: 16px 16px 4px;
  }

  .filter-heading h2 {
    font-size: 1.35rem;
  }

  .filter-sidebar .toolbar {
    display: grid;
    gap: 10px;
    padding: 8px 14px 14px;
    border-bottom: 0;
    background: transparent;
  }

  .filter-field {
    margin-bottom: 0;
  }

  .filter-field label,
  .filter-field .filter-label {
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .filter-field select,
  .filter-field input {
    min-height: 46px;
    border-radius: 16px;
    padding: 0 14px;
    font-size: 0.95rem;
    border-color: rgba(7, 47, 73, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  }

  .subcategory-checklist {
    flex-direction: row;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    border: 0;
    padding: 2px 0 4px;
    -webkit-overflow-scrolling: touch;
  }

  .subcategory-check {
    flex: 0 0 auto;
    min-height: 38px;
    border-radius: 999px;
    white-space: nowrap;
  }

  .card-listings-column {
    height: auto;
    max-height: none;
    min-height: 0;
    overflow: visible;
    border-right: 1px solid rgba(7, 47, 73, 0.1) !important;
  }

  .card-listings-column .results-header {
    padding: 16px 16px 0;
    border-bottom: 0;
  }

  .results-header .section-kicker {
    font-size: 0.76rem;
    letter-spacing: 0.1em;
  }

  .listing-grid.marketplace-results {
    max-height: none !important;
    height: auto;
    overflow: visible;
    padding: 12px;
    gap: 14px;
  }

  .listing-grid .card {
    border-radius: 22px;
    overflow: hidden;
    border-color: rgba(7, 47, 73, 0.1);
    box-shadow: 0 12px 28px rgba(7, 47, 73, 0.12);
  }

  .card-photo-col::before {
    inset: 0;
    height: 100%;
    background: linear-gradient(180deg, rgba(7, 47, 73, 0.08) 0%, rgba(7, 47, 73, 0.08) 42%, rgba(7, 47, 73, 0.88) 100%);
  }

  .card-photo-col .card-photo {
    height: 188px;
    min-height: 188px;
    background: linear-gradient(135deg, rgba(116, 184, 158, 0.2), rgba(7, 47, 73, 0.18));
  }

  .card-photo-overlay {
    inset: auto 0 0 0;
    padding: 44px 14px 14px;
    align-items: flex-end;
    background: linear-gradient(180deg, rgba(7, 47, 73, 0), rgba(7, 47, 73, 0.82));
  }

  .card-photo-overlay .card-name-overlay {
    max-width: 100%;
    color: #fff !important;
    background: rgba(7, 47, 73, 0.86);
    font-size: 1.08rem;
    line-height: 1.1;
    padding: 8px 10px;
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.26);
  }

  .card-photo-overlay .card-category-tag {
    display: none;
  }

  .card-info-col {
    padding: 13px 14px 14px;
    gap: 8px;
  }

  .listing-grid .card h3 {
    display: block;
    margin: 0;
    color: #072f49;
    font-size: 1.08rem;
    line-height: 1.12;
  }

  .listing-grid .card .card-meta {
    gap: 4px;
    font-size: 0.9rem;
  }

  .listing-grid .card .card-actions {
    margin-top: 4px;
  }

  .listing-grid .card .view-link {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    font-size: 0.9rem;
    padding: 0 14px;
    background: #072f49;
    color: #fff;
  }

  .map-panel {
    display: block !important;
    position: static;
    height: auto;
  }

  .map-panel .map-card {
    height: 360px;
    padding: 0;
    overflow: hidden;
    background: #e9f1ed;
  }

  .map-placeholder {
    min-height: 360px;
    height: 360px;
    border-radius: 24px;
  }
}

@media (max-width: 560px) {
  .market-tabs {
    top: 64px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .market-layout {
    padding: 10px 12px 18px;
  }

  .filter-sidebar,
  .card-listings-column,
  .map-panel .map-card {
    border-radius: 22px !important;
  }

  .card-photo-col .card-photo {
    height: 164px;
    min-height: 164px;
  }

  .card-photo-overlay .card-name-overlay {
    font-size: 1rem;
  }

  .map-panel .map-card,
  .map-placeholder {
    height: 320px;
    min-height: 320px;
  }
}



/* Mobile marketplace: make previews impossible to miss */
@media (max-width: 860px) {
  .filter-sidebar {
    order: 1 !important;
  }

  .card-listings-column {
    order: 2 !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 380px;
    margin-top: 0;
    overflow: visible !important;
  }

  .card-listings-column::before {
    content: "Business previews";
    display: block;
    padding: 16px 16px 0;
    color: #072f49;
    font-size: 1.45rem;
    font-weight: 950;
    letter-spacing: -0.04em;
  }

  .card-listings-column .results-header {
    display: block !important;
    padding: 8px 16px 0;
  }

  #listing-cards.marketplace-results {
    display: grid !important;
    grid-template-columns: 1fr !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 280px;
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
  }

  #listing-cards.marketplace-results:empty::before {
    content: "Loading business previews...";
    display: grid;
    min-height: 180px;
    place-items: center;
    border: 2px dashed rgba(116, 184, 158, 0.65);
    border-radius: 20px;
    color: #072f49;
    background: rgba(116, 184, 158, 0.12);
    font-weight: 950;
  }

  #listing-cards.marketplace-results .card {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100%;
  }

  .map-panel {
    order: 3 !important;
    margin-top: 0;
  }

  .map-panel::before {
    content: "Map view";
    display: block;
    margin: 0 0 8px 4px;
    color: #072f49;
    font-size: 1.2rem;
    font-weight: 950;
    letter-spacing: -0.035em;
  }
}


/* Mobile marketplace: readable preview cards */
@media (max-width: 860px) {
  #listing-cards.marketplace-results {
    gap: 12px !important;
  }

  #listing-cards.marketplace-results .card {
    display: grid !important;
    grid-template-columns: 112px minmax(0, 1fr) !important;
    align-items: stretch !important;
    gap: 12px !important;
    min-height: 126px !important;
    padding: 10px !important;
    border-radius: 20px !important;
    background: linear-gradient(135deg, #ffffff 0%, #f3f8f6 100%) !important;
    border: 1px solid rgba(7, 47, 73, 0.12) !important;
    box-shadow: 0 12px 26px rgba(7, 47, 73, 0.12) !important;
    overflow: hidden !important;
  }

  #listing-cards.marketplace-results .card-photo-col {
    width: 112px !important;
    min-width: 112px !important;
    height: 106px !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    align-self: center !important;
    background: #dcebe5 !important;
  }

  #listing-cards.marketplace-results .card-photo-col::before,
  #listing-cards.marketplace-results .card-photo-overlay {
    display: none !important;
  }

  #listing-cards.marketplace-results .card-photo-col .card-photo {
    width: 100% !important;
    height: 100% !important;
    min-height: 106px !important;
    margin: 0 !important;
    border-radius: 16px !important;
    overflow: hidden !important;
  }

  #listing-cards.marketplace-results .card-photo-col .card-photo img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
  }

  #listing-cards.marketplace-results .card-info-col {
    display: flex !important;
    min-width: 0 !important;
    padding: 4px 2px 4px 0 !important;
    gap: 6px !important;
    justify-content: center !important;
  }

  #listing-cards.marketplace-results .card h3,
  #listing-cards.marketplace-results .card-info-col h3 {
    display: block !important;
    margin: 0 !important;
    color: #072f49 !important;
    font-size: 1.05rem !important;
    line-height: 1.05 !important;
    font-weight: 950 !important;
    letter-spacing: -0.03em !important;
    text-shadow: none !important;
    white-space: normal !important;
    overflow: visible !important;
  }

  #listing-cards.marketplace-results .card .card-meta {
    display: flex !important;
    gap: 3px !important;
    color: #475569 !important;
    font-size: 0.78rem !important;
    line-height: 1.25 !important;
    font-weight: 800 !important;
  }

  #listing-cards.marketplace-results .card .meta-tag {
    color: #1f7a5c !important;
  }

  #listing-cards.marketplace-results .card .meta-loc {
    color: #3f4643 !important;
  }

  #listing-cards.marketplace-results .card .card-actions {
    display: flex !important;
    margin-top: 2px !important;
  }

  #listing-cards.marketplace-results .card .view-link {
    width: auto !important;
    min-height: 34px !important;
    padding: 0 13px !important;
    border-radius: 999px !important;
    background: #072f49 !important;
    color: #fff !important;
    font-size: 0.78rem !important;
    font-weight: 950 !important;
  }
}

@media (max-width: 430px) {
  #listing-cards.marketplace-results .card {
    grid-template-columns: 96px minmax(0, 1fr) !important;
    min-height: 116px !important;
  }

  #listing-cards.marketplace-results .card-photo-col {
    width: 96px !important;
    min-width: 96px !important;
    height: 96px !important;
  }

  #listing-cards.marketplace-results .card-photo-col .card-photo {
    min-height: 96px !important;
  }

  #listing-cards.marketplace-results .card h3,
  #listing-cards.marketplace-results .card-info-col h3 {
    font-size: 0.98rem !important;
  }
}


/* Mobile marketplace: keep cards and map separated */
@media (max-width: 860px) {
  .card-listings-column {
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    overflow: visible !important;
    padding-bottom: 12px !important;
    margin-bottom: 18px !important;
  }

  .card-listings-column::before {
    flex: 0 0 auto !important;
  }

  .card-listings-column .results-header {
    flex: 0 0 auto !important;
  }

  #listing-cards.marketplace-results,
  .listing-grid.marketplace-results {
    flex: 0 0 auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    padding-bottom: 14px !important;
  }

  .map-panel {
    clear: both;
    margin-top: 10px !important;
  }

  .map-panel::before {
    padding-top: 2px;
  }
}

/* Desktop card column visibility safety */
@media (min-width: 861px) {
  .market-layout {
    grid-template-columns: 250px minmax(380px, 470px) minmax(0, 1fr) !important;
  }

  .card-listings-column {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-width: 0;
    min-height: 0;
    z-index: 2;
  }

  .card-listings-column .results-header {
    display: block !important;
  }

  #listing-cards.marketplace-results,
  .listing-grid.marketplace-results {
    display: flex !important;
    flex-direction: column !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 0;
    overflow-y: auto !important;
  }

  #listing-cards.marketplace-results .card,
  .listing-grid.marketplace-results .card {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
}

/* Multi-select subcategory checkboxes */
.filter-field .filter-label {
  font-weight: 800;
  color: var(--navy);
  font-size: 0.76rem;
  margin-bottom: 5px;
  display: block;
}
.subcategory-checklist {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 190px;
  overflow-y: scroll;
  padding: 8px 6px 8px 0;
  scrollbar-width: thin;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}
.subcategory-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 7px 9px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  background: #fff;
  color: #334155;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}
.subcategory-check:has(input:checked) {
  background: rgba(23, 198, 189, 0.14);
  border-color: rgba(23, 198, 189, 0.55);
  color: var(--navy);
}
.subcategory-check input {
  width: 16px;
  min-height: 16px;
  margin: 0;
  accent-color: var(--aqua);
}
.subcategory-empty {
  margin: 0;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
}

.subcategory-checklist::-webkit-scrollbar {
  width: 8px;
}
.subcategory-checklist::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.06);
  border-radius: 999px;
}
.subcategory-checklist::-webkit-scrollbar-thumb {
  background: rgba(23, 198, 189, 0.75);
  border-radius: 999px;
}
