/* Venues — cards-first + map split (static page section) */
:root{
  --brandFrom:#025fbc; --brandTo:#06a2dd;
  --ink:#0f172a; --sub:#475569; --line:#e5e7eb; --light:#F3F4F6;
  --surface:#fff; --page:#F9FAFB;
}
body[data-page-kind="venue"]{
  background:var(--page);
}

/* Page container width + spacing */
body[data-page-kind="venue"] .wrap.page-wrap,
body[data-page-kind="venue"] .results-wrap{
  max-width:1350px; margin:0 auto; padding:60px 20px; box-sizing:border-box;
}

/* Kill extra global spacing on this page only */
body[data-page-kind="venue"] .results-layout{ margin-top:0 !important; }

/* Hide inline empties inside #gridResults (browse JS will use #resultsEmpty instead) */
body[data-page-kind="venue"] #gridResults > .empty,
body[data-page-kind="venue"] #gridResults > .no-results,
body[data-page-kind="venue"] #gridResults > .grid-empty{
  display:none !important;
}

/* Centered empty state (matches browse pages look) */
body[data-page-kind="venue"] #resultsEmpty{
  display:none;              /* JS will flip this when there are 0 real cards */
  padding:32px 16px 40px;
}
body[data-page-kind="venue"] #resultsEmpty .empty-wrap{
  max-width:420px;
  margin:0 auto;
  text-align:center;
  background:#fff;
  border-radius:16px;
  border:1px dashed var(--line);
  padding:24px 20px 28px;
  box-shadow:0 12px 30px rgba(15,23,42,.06);
}
body[data-page-kind="venue"] #resultsEmpty h3{
  margin:0 0 8px;
  font:600 1.05rem/1.3 Poppins,system-ui;
  color:var(--ink);
}
body[data-page-kind="venue"] #resultsEmpty p{
  margin:0 0 16px;
  font:400 .9rem/1.5 Poppins,system-ui;
  color:var(--sub);
}
body[data-page-kind="venue"] #resultsEmpty .btn-reset{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:8px 16px;
  border-radius:999px;
  border:1px solid var(--line);
  background:#fff;
  font:600 .9rem Poppins,system-ui;
  cursor:pointer;
}
body[data-page-kind="venue"] #resultsEmpty .btn-reset:hover{
  background:#f8fafc;
}

/* Toolbar (scoped to Venues only) */
body[data-page-kind="venue"] .results-toolbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  margin-bottom:24px;
}
body[data-page-kind="venue"] .results-title{
  margin:0;
  font-weight:700;
  font-size:clamp(20px,2.4vw,28px);
  white-space:nowrap;
}
body[data-page-kind="venue"] .results-title strong{ color:var(--brandFrom); }
body[data-page-kind="venue"] .results-controls{
  display:flex;
  gap:12px;
  align-items:center;
  margin-left:auto;
  flex:0 0 auto;
}
body[data-page-kind="venue"] .results-head{
  flex:1 1 auto;
  min-width:0;
}
body[data-page-kind="venue"] .results-controls select{
  padding:8px 12px;
  border:1px solid var(--line);
  border-radius:8px;
  background:var(--surface);
  font:500 .95rem Poppins,system-ui;
}

.btn{ text-decoration:none; font-weight:600; font-size:.9rem; padding:8px 16px; border-radius:999px; transition:.2s; display:inline-flex; align-items:center; gap:6px; border:1px solid transparent; cursor:pointer; }
.btn-secondary-dark{ background:var(--surface); color:var(--ink); border-color:var(--line); }
.btn-secondary-dark:hover{ background:#eef2f7; }
.btn-primary-dark{ background:var(--ink); color:#fff; }
.btn-primary-dark:hover{ filter:brightness(0.95); }
/* keep width stable while text swaps */
#mapToggleBtn{ min-width:112px; justify-content:center; }


/* Map/list rows — circular hearts like cards */
#mapSplit :is(.heart-btn,.favorite-btn),
#listPane  :is(.heart-btn,.favorite-btn){
  width:36px; height:36px;
  border-radius:999px !important;
  display:grid; place-items:center;
  border:1px solid rgba(0,0,0,.12);
}
#mapSplit :is(.heart-btn,.favorite-btn) svg,
#listPane  :is(.heart-btn,.favorite-btn) svg{ width:18px; height:18px; }

/* Pager */
.pager{ display:flex; justify-content:center; gap:8px; margin:28px 0 8px; }

/* Toolbar — match Vendors/Rentals look */
body[data-page-kind="venue"] .results-toolbar{
  display:flex;
  justify-content:space-between;
  gap:16px;
}

body[data-page-kind="venue"] .results-head{
  flex:1 1 auto;
  min-width:0;
}

body[data-page-kind="venue"] .results-title{
  margin:0;
  font-family:Poppins,system-ui;
  font-weight:700;
  font-size:clamp(22px, 2.4vw, 28px);
  line-height:1.2;
  color:var(--ink);
}

body[data-page-kind="venue"] .results-title-main{
  display:block;
}

body[data-page-kind="venue"] .results-subtitle{
  display:block;
  margin-top:4px;
  font-weight:500;
  font-size:.9rem;
  line-height:1.5;
  color:var(--sub);
  white-space:nowrap;       /* keep "Showing 22 venues in Manitoba" on one line */
}

/* Right-side actions (Map view / Filters / Featured) */
body[data-page-kind="venue"] #resultsActions,
body[data-page-kind="venue"] .toolbar-actions{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  gap:12px;
}

body[data-page-kind="venue"] #resultsActions .btn-ghost.btn-with-icon,
body[data-page-kind="venue"] #resultsActions .btn-ghost{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 16px;
  border-radius:999px;
  background:#0f172a;
  box-shadow:0 4px 12px rgba(15,23,42,.06);
  font:500 .9rem Poppins,system-ui;
  color:#FFF;
  cursor:pointer;
}

body[data-page-kind="venue"] #resultsActions .btn-ghost.btn-with-icon svg{
  flex:0 0 16px;
}

body[data-page-kind="venue"] #resultsActions .sort-wrap select,
body[data-page-kind="venue"] .sort-wrap select{
  padding:10px 32px 10px 14px;
  border-radius:999px;
  border:1px solid #e5e7eb;
  background:#fff;
  font:500 .9rem Poppins,system-ui;
  color:#0f172a;
  box-shadow:0 4px 12px rgba(15,23,42,.06);
}

/* keep width stable while text swaps */
body[data-page-kind="venue"] #mapToggleBtn{
  min-width:112px;
  justify-content:center;
}


/* ===== Filters modal (always above header) ===== */
.filter-modal[hidden]{ display:none !important; }
.filter-modal{
  position:fixed; inset:0; z-index:10050; display:grid; place-items:center;
  background:rgba(0,0,0,.5);
}
.filters-panel{
  width:min(480px, 92vw); background:#fff; border-radius:16px; padding:24px;
  box-shadow:0 20px 60px rgba(15,23,42,.25);
}
.filter-modal-header{ display:flex; justify-content:space-between; align-items:center; margin-bottom:24px; }
.filter-modal-close{ background:var(--light); border:none; width:32px; height:32px; border-radius:50%; cursor:pointer; font-weight:700; }
.filter-group{ padding-top:20px; margin-top:20px; border-top:1px solid var(--line); }
.filter-group:first-child{ padding-top:0; margin-top:0; border-top:0; }
.filter-group h4{ margin:0 0 12px; font:700 1rem/1 Poppins,system-ui; }
.filter-search{ position:relative; }
.filter-search input{
  width:100%; box-sizing:border-box; padding:10px 12px 10px 36px;
  border:1px solid var(--line); background:#F3F6FB; border-radius:8px;
  font:500 .95rem Poppins,system-ui;
}
.filter-search .icon{ position:absolute; left:12px; top:50%; transform:translateY(-50%); width:16px; height:16px; color:#94a3b8; }
.filter-options{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.filter-options label{ display:flex; align-items:center; gap:8px; font:.9rem Poppins,system-ui; cursor:pointer; }
.budget-row{ display:flex; align-items:center; gap:10px; }
.budget-row .min,.budget-row .max{ font-size:.85rem; color:#64748b; }
/* Ensure Apply text visible on dark btn */
.filter-modal .btn-primary-dark{ color:#fff !important; font-weight:700; }

/* ===== Map split (static section, not a popup) ===== */
#mapSplit[hidden]{ display:none !important; }
#mapSplit,
.map-layout,
#map-view{
  position:static !important;
  z-index:1 !important;
  max-width:1350px !important;
  margin:0 auto !important;
  box-sizing:border-box;

  display:grid !important;
  grid-template-columns:50% 50% !important; /* 50/50 split */
  gap:24px !important;
  background:transparent !important;
}

/* Left pane → full-width list rows with ~20% image */
.map-list-column,
#listPane{
  overflow:auto;
  max-height:640px;  /* match map height */
  height:640px;      /* fixed viewport for scrollable rows */
}
.map-list-column #gridResults,
#listPane #gridResults{
  display:grid !important; grid-template-columns:1fr !important;
  gap:12px !important; padding:0 !important;
}
.map-list-column #gridResults > *, #listPane #gridResults > *{
  display:grid;
  grid-template-columns:minmax(180px, 20%) 1fr; /* ~20% media | 80% content */
  grid-auto-rows: auto;                         /* let content decide height */
  min-height:112px;                             
  gap:0;
  align-items:stretch;
  border-radius:12px;
  overflow:hidden;
  box-shadow:0 2px 8px rgba(15,23,42,.06);
}
/* media cell */
.map-list-column #gridResults > * > :first-child,
#listPane #gridResults > * > :first-child{
  margin:0;
  padding:0 !important;                 /* no padding around the image */
  border-radius:0 !important;           /* remove image container radius */
  overflow:hidden;
  display:block;

/* Guarantee media fills the left column edge-to-edge */
#listPane #gridResults > * > :first-child,
.map-list-column #gridResults > * > :first-child{
  inset:0; width:100%; height:100%;
}

#listPane #gridResults > * > :first-child > img,
#listPane #gridResults > * > :first-child > picture > img,
.map-list-column #gridResults > * > :first-child > img,
.map-list-column #gridResults > * > :first-child > picture > img{
  width:100%; height:100%;
  object-fit:cover;
  border-radius:0 !important;
  display:block;
}

  /* override card grid's 16:9 so rows aren't clipped */
  aspect-ratio:auto !important;
  height:100%;
}
.map-list-column #gridResults > * > :first-child img,
#listPane #gridResults > * > :first-child img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  border-radius:0 !important;           /* ensure squared image edges */
}

.map-list-column #gridResults > * > :first-child img,
#listPane #gridResults > * > :first-child img{
  width:100%; height:100%; object-fit:cover; display:block;
}

/* Map element */
.map-column, #leafletMap, #leaflet-map{
  height:640px !important;
  border:1px solid #e5e7eb; border-radius:16px; overflow:hidden; background:#f8fafc;
}
#leaflet-map{ height:100%; min-height:420px; }
/* Airbnb-style price pins for map markers */
.map-price-pin{
  background:#fff;
  border-radius:999px;
  padding:4px 10px;
  border:1px solid rgba(15,23,42,.14);
  font:600 .8rem/1 Poppins,system-ui;
  color:#020617;
  box-shadow:0 6px 16px rgba(15,23,42,.22);
  white-space:nowrap;
}

/* Remove legacy floating toggle; toolbar owns the control */
/* View toggle now lives in the top-right toolbar */
#mapToggleBtn{
  position:static !important;
  bottom:auto !important;
  width:auto !important;
}

/* Venues: Map/List toggle — keep pill sizing, no special pop hover */
body[data-page-kind="venue"] #mapToggleBtn{
  font-size:.9rem;
  border-radius:999px;
  justify-content:center;
}

/* Responsive */
@media (max-width:1100px){
  #mapSplit, .map-layout, #map-view{ grid-template-columns:50% 50% !important; }
}

@media (max-width:640px){
  .map-list-column #gridResults > * > :first-child,
  #listPane #gridResults > * > :first-child{ height:96px; }
}

/* --- Map list rows: nuke any inherited padding/margins from global card styles --- */
.map-list-column #gridResults > *,
#listPane #gridResults > *{
  padding: 0 !important;            /* kill card padding from global.css */
  overflow: hidden;                  /* keep row clipping/rounded left edge */
}

/* media wrapper: no padding/radius from any card/media classes */
.map-list-column #gridResults > * > :first-child,
#listPane #gridResults > * > :first-child{
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;      /* image itself will square; row clips */
  aspect-ratio: auto !important;
  height: 100% !important;
}

/* catch inner wrappers sometimes present inside the media cell */
.map-list-column #gridResults > * > :first-child > *:not(.heart-btn):not(.favorite-btn),
#listPane #gridResults > * > :first-child > *:not(.heart-btn):not(.favorite-btn){
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
}

/* Map rows: keep save heart circular & positioned */
#mapSplit .heart-btn,
#mapSplit .favorite-btn{
  position:absolute !important;
  top:8px; right:8px;
  width:36px; height:36px;
  border-radius:9999px !important;
  display:grid; place-items:center;
  box-shadow:0 2px 8px rgba(0,0,0,.15);
  overflow:hidden; /* ensure true circle clip */
}

/* ensure the actual <img> fills and has no rounding */
.map-list-column #gridResults > * > :first-child img,
#listPane #gridResults > * > :first-child img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0 !important;
}

/* Map view — ensure the media cell is the positioning context */
.map-list-column #gridResults > * > :first-child,
#listPane #gridResults > * > :first-child{
  position: relative !important;   /* for absolute heart */
}


/* Map split: keep heart colors identical to list view */
#mapSplit :is(.heart-btn,.favorite-btn)[aria-pressed="true"],
#mapSplit :is(.heart-btn,.favorite-btn).is-saved{
  background:#fff !important;
  color:#e11d48 !important; /* saved = red */
}
#mapSplit :is(.heart-btn,.favorite-btn):not([aria-pressed="true"]):not(.is-saved){
  background:rgba(0,0,0,.62) !important;
  color:#fff !important;     /* unsaved = white icon on black */
}


/* Filters modal — unified footer buttons */
.filter-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin-top:16px;
}
.filter-actions .btn{
  width:100%;
  height:44px;
  border-radius:999px;
  font-weight:700;
  justify-content:center;
}
.filter-actions .btn-secondary-dark{
  background:#fff;
  color:var(--ink);
  border:1px solid var(--line);
}
.filter-actions .btn-secondary-dark:hover{
  background:#f8fafc;
}
@media (max-width:520px){
  .filter-actions{ grid-template-columns:1fr; }
}

/* ===== Mobile polish (Venues only) ===== */
@media (max-width: 680px){
  body[data-page-kind="venue"] .results-toolbar{
    flex-direction:column;
    align-items:flex-start;
    gap:10px;
  }
  body[data-page-kind="venue"] .results-title{
    white-space:normal;
    line-height:1.25;
  }
  body[data-page-kind="venue"] .results-controls{
    width:100%;
    display:flex;
    gap:8px;
    flex-wrap:wrap;
  }
  body[data-page-kind="venue"] #mapToggleBtn{
    flex:0 0 auto;
    min-width:112px;
  }
  body[data-page-kind="venue"] .results-controls select{
    flex:1 1 160px;
    min-width:0;
  }
}


/* Make the media cell truly flush and full-cover in row layout */
.map-list-column #gridResults > * > :first-child,
#listPane #gridResults > * > :first-child{
  width:100% !important;
  height:100% !important;           /* stretches with the grid row */
  align-self:stretch;               /* ensure full column height */
}
.map-list-column #gridResults > * > :first-child img,
#listPane #gridResults > * > :first-child img{
  width:100% !important;
  height:100% !important;
  object-fit:cover !important;
  object-position:center;
  display:block;
}

/* Desktop: hide bottom mobile navbar */
@media (min-width:960px){
  #mbTabbar{ display:none !important; }
}


/* Ensure first paint matches chosen view even if HTML had [hidden] */
html.prefers-map  #mapSplit[hidden]{ display:grid !important; }
html.prefers-list #mapSplit:not([hidden]){ display:none !important; }

/* Anti-FOUC reinforcement (title visible, softened count) */
[data-results-region]:not([data-ready="1"]) .results-head{ visibility: visible; }
[data-results-region]:not([data-ready="1"]) [data-results-count]{ opacity:.55; transition: opacity .18s ease; }

/* Map rows: ensure the image fully covers the left cell */
#mapSplit .map-list-column #gridResults > * > :first-child,
#mapSplit #listPane #gridResults > * > :first-child{
  position: relative !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 112px;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  overflow: hidden !important;
}
#mapSplit .map-list-column #gridResults > * > :first-child img,
#mapSplit #listPane #gridResults > * > :first-child img{
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  border-radius: 0 !important;
}

/* Heart buttons in map rows: always circular overlay */
#mapSplit :is(.heart-btn,.favorite-btn){
  position: absolute !important;
  top: 10px; left: 10px;
  width: 36px; height: 36px;
  border-radius: 999px !important;
  display: grid; place-items: center;
}

/* Desktop: hide mobile bottom navbar */
@media (min-width: 961px){
  #mbTabbar{ display:none !important; }
}

/* --- Compact row inside sheet: image left, content right --- */
@media (max-width: 900px){
  .map-list-column #gridResults > *{
    grid-template-columns: 112px 1fr; min-height: 112px;
    border: 1px solid var(--line); background: #fff;
  }
  .map-list-column #gridResults > * > :first-child{
    height: 100% !important; aspect-ratio: auto !important;
  }
}

/* --- Heart: circular overlay, consistent everywhere --- */
#mapSplit :is(.heart-btn,.favorite-btn,.card-heart,.save-btn){
  position: absolute; left: 10px; top: 10px; z-index: 2;
  width: 36px; height: 36px; border-radius: 9999px; display: grid; place-items: center;
  border: 1px solid rgba(0,0,0,.08);
}

/* --- Hide mobile bottom nav on desktop (if present globally) --- */
@media (min-width: 901px){
  .mb-tabbar, #mbTabbar, .mobile-nav { display: none !important; }
}

/* Mobile sticky Filters CTA (reuse #openFilters) */
/* Mobile filters button: inline in the sticky header (no bottom float) */
@media (max-width:680px){
  #openFilters.btn-filter{
    position: static;
    height: 40px;
    border-radius: 999px;
    padding-inline: 14px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    background: #020617;
    color: #fff;
    border: none;
    box-shadow: 0 4px 10px rgba(0,0,0,.16);
    font: 600 .85rem/1 Poppins, system-ui;
  }

  #openFilters.btn-filter svg{
    flex: 0 0 16px;
  }
}

@media (min-width:681px){
  #openFilters.btn-filter{
    position: static;
    box-shadow: none;
  }
}

@media (min-width:961px){
  #mbTabbar{ display:none !important; }
}
/* === Mobile: list-only view for Venues === */
@media (max-width: 900px){

  /* Never show the map split on small screens */
  body[data-page-kind="venue"] #mapSplit{
    display:none !important;
  }

  /* Hide the Map/List toggle button */
  body[data-page-kind="venue"] #mapToggleBtn{
    display:none !important;
  }
}

/* === Mobile: list-only view for Venues === */
@media (max-width: 900px){

  /* Never show the map split on small screens */
  body[data-page-kind="venue"] #mapSplit{
    display:none !important;
  }

  /* Hide the Map/List toggle button entirely */
  body[data-page-kind="venue"] #mapToggleBtn{
    display:none !important;
  }

  /* Make sure the grid actually renders as rows */
  body[data-page-kind="venue"] #gridResults.cards-grid{
    display:grid !important;
    grid-template-columns:minmax(0,1fr) !important;
  }
}
/* Venues: keep the "Featured" sort pill compact */
body[data-page-kind="venue"] .results-main .toolbar-actions .sort-wrap select{
  min-width: 0;          /* don’t force a wide pill */
  padding: 8px 14px;     /* slightly tighter padding */
}