/* BSK Property Listings 1.5.0: search bar, custom dropdowns, results tabs, save-search panel.
   Loaded after bskpl.css, only on pages that show the search (directory, home search, agency pages).
   Every rule is scoped to .bskpl. Colours come from the tokens below and from bskpl.css, so the BSK logo
   colours can be changed in one place later. */

.bskpl {
  /* Search tokens (1.5.0). Owner's design layout; BSK colours replace these after the logo arrives. */
  --s-accent: var(--g);
  --s-accent-hover: #237528;
  --s-soft: #eef8ee;
  --s-soft-hover: #f1f8e9;
  --s-soft-on: #e8f5e9;
  --s-line: #d5dbe3;
  --s-field-h: 46px;
  --s-radius: 6px;
  --s-radius-lg: 10px;
  --s-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 14px rgba(16, 24, 40, .05);
  --s-pop-shadow: 0 14px 32px rgba(16, 24, 40, .18);
  --s-dark: #111827;
  --s-dark-2: #1f2937;
}

/* ---------- Custom dropdown ----------
   The native select stays in the form. With JavaScript it is hidden and a button shows the choice,
   so the form still works without JavaScript. */
.bskpl-dd { position: relative; min-width: 0; }
.bskpl.is-js .bskpl-dd-src {
  position: absolute !important; left: 0; top: 0; width: 1px !important; height: 1px !important; min-width: 0 !important;
  margin: 0 !important; padding: 0 !important; border: 0 !important; opacity: 0; pointer-events: none; overflow: hidden;
}
.bskpl-dd-btn {
  display: none;
  align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; min-height: var(--s-field-h); padding: 0 12px;
  border: 1px solid var(--s-line); border-radius: var(--s-radius); background: #fff; color: var(--ink);
  font: inherit; font-size: 15px; font-weight: 400; text-align: left; cursor: pointer;
}
.bskpl.is-js .bskpl-dd-btn { display: flex; }
.bskpl-dd-btn:hover { border-color: #b7c0cc; }
.bskpl-dd-btn[aria-expanded="true"] { border-color: var(--g-brand); outline: 2px solid var(--g-brand); outline-offset: 0; }
.bskpl-dd-btn:disabled { background: #f3f5f8; color: #9aa4b1; cursor: not-allowed; }
.bskpl-dd-val { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bskpl-dd.is-empty .bskpl-dd-val { color: var(--muted); }
.bskpl-dd.is-set .bskpl-dd-btn { border-color: #9fd3a3; background: var(--s-soft); }
.bskpl-dd-chev { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; color: var(--muted); }
.bskpl-dd-menu {
  position: absolute; z-index: 1000; left: 0; right: 0; top: calc(100% + 4px);
  max-height: 220px; overflow-y: auto; margin: 0; padding: 4px; list-style: none;
  background: #fff; border: 1px solid var(--s-line); border-radius: var(--s-radius); box-shadow: var(--s-pop-shadow);
}
.bskpl-dd-menu[hidden] { display: none; }
.bskpl-dd-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 38px; padding: 8px 10px; border-radius: 4px; cursor: pointer; font-size: 15px; color: var(--ink);
}
.bskpl-dd-opt:hover, .bskpl-dd-opt:focus { background: var(--s-soft-hover); outline: none; }
.bskpl-dd-opt[aria-selected="true"] { background: var(--s-soft-on); font-weight: 700; color: var(--g); }
.bskpl-dd-opt.is-child { padding-left: 24px; color: #3a4350; }
.bskpl-dd-opt.is-placeholder { color: var(--muted); }

/* ---------- Home search bar ([bsk_search]) ---------- */
.bskpl-hs {
  background: #fff; border: 1px solid var(--line); border-radius: var(--s-radius-lg); box-shadow: var(--s-shadow);
  margin-top: 16px; overflow: hidden;
}
/* Photo band. The shortcode sets the photo in --bskpl-hero-img. Height and position come from admin settings in 1.7.0. */
.bskpl-hs-hero {
  position: relative; display: grid; align-content: end; gap: 14px; min-height: var(--bskpl-hero-h, 200px);
  padding: 24px 22px 22px; color: #fff; background-color: #1f2937;
  background-image: linear-gradient(180deg, rgba(10, 20, 15, var(--bskpl-ov-top, .22)) 0%, rgba(10, 20, 15, var(--bskpl-ov-bot, .68)) 100%), var(--bskpl-hero-img, none);
  background-size: cover; background-position: var(--bskpl-hero-pos, center 40%);
}
.bskpl .bskpl-hs-hero .bskpl-hs-title { margin: 0; font-size: 26px; color: #fff; text-shadow: 0 1px 10px rgba(0, 0, 0, .35); }
.bskpl .bskpl-hs-hero .bskpl-hs-tab { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .4); color: #fff; }
.bskpl .bskpl-hs-hero .bskpl-hs-tab.is-link { color: #fff; }
.bskpl .bskpl-hs-hero .bskpl-hs-tab.on, .bskpl .bskpl-hs-hero .bskpl-hs-tab:has(input:checked) { background: var(--s-accent); border-color: var(--s-accent); }
.bskpl .bskpl-hs-hero .bskpl-hs-tab.is-soon { color: rgba(255, 255, 255, .75); background: rgba(0, 0, 0, .18); border-style: dashed; }
.bskpl .bskpl-hs-hero .bskpl-hs-tab small { background: rgba(255, 255, 255, .2); color: #fff; }
.bskpl .bskpl-hs-hero .bskpl-hs-tab.is-link:hover { border-color: #fff; color: #fff; }
.bskpl-hs-fields { display: grid; gap: 12px; padding: 16px; }
@media (max-width: 720px) {
  .bskpl-hs-hero { min-height: var(--bskpl-hero-h-phone, 150px); padding: 18px 14px 14px; }
  .bskpl .bskpl-hs-hero .bskpl-hs-title { font-size: 22px; }
  .bskpl-hs-fields { padding: 12px; }
}
.bskpl .bskpl-hs-title { font-size: 20px; font-weight: 900; line-height: 1.25; margin: 0 0 12px; }
/* The directory bar sets column spans for its own grid. The home card lays its fields out with its own rows. */
.bskpl .bskpl-hs .bskpl-f { grid-column: auto; }
.bskpl .bskpl-hs-tab.is-link { color: var(--ink); }
.bskpl-hs-form { display: grid; gap: 0; }
.bskpl-hs-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.bskpl-hs-tab {
  position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border: 1px solid var(--s-line); border-radius: var(--s-radius); background: #fff; color: var(--ink);
  font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer;
}
.bskpl-hs-tab input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.bskpl-hs-tab input:focus-visible + span { outline: 2px solid var(--g-brand); outline-offset: 3px; border-radius: 3px; }
.bskpl-hs-tab.on, .bskpl-hs-tab:has(input:checked), .bskpl-hs-tab.is-on { background: var(--s-accent); border-color: var(--s-accent); color: #fff; }
.bskpl-hs-tab.is-link:hover { border-color: var(--g-brand); color: var(--g); }
.bskpl-hs-tab.is-soon { color: #8a94a3; border-style: dashed; background: #fafbfc; cursor: default; }
.bskpl-hs-tab small {
  font-size: 11px; font-weight: 700; color: #6b7280; background: #eef1f4; border-radius: 999px; padding: 2px 8px;
}
.bskpl-hs-row { display: grid; gap: 10px; align-items: end; }
.bskpl-hs-row-top { grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr) minmax(0, 1fr); }
.bskpl-hs-row-bottom { grid-template-columns: minmax(0, 1.5fr) minmax(0, .8fr) minmax(0, 1.5fr) minmax(0, 1fr); }
.bskpl-hs-go { display: grid; }
.bskpl-hs-go .bskpl-btn { width: 100%; min-height: var(--s-field-h); background: var(--s-accent); border-color: var(--s-accent); }
.bskpl-hs-go .bskpl-btn:hover { background: var(--s-accent-hover); border-color: var(--s-accent-hover); }
.bskpl-hs .bskpl-f { gap: 6px; }
.bskpl-hs .bskpl-f-label { font-size: 12px; }
.bskpl-hs .bskpl-f input[type="number"] { min-height: var(--s-field-h); }
.bskpl-hs .bskpl-range { grid-template-columns: 1fr 1fr 1.1fr; }
.bskpl-hs .bskpl-range.is-price { grid-template-columns: 1fr 1fr; }
.bskpl-promo {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 12px; padding: 12px 16px; border-radius: var(--s-radius-lg);
  background: linear-gradient(90deg, var(--s-dark-2), var(--s-dark)); color: #fff;
}
.bskpl-hs > .bskpl-promo { margin: 0; border-radius: 0; }
.bskpl-promo p { margin: 0; font-size: 15px; font-weight: 700; }
.bskpl-promo p span { color: #7fd186; }
.bskpl-promo a {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: var(--s-radius);
  background: var(--s-accent); color: #fff; font-weight: 700; font-size: 14px; text-decoration: none;
}
.bskpl-promo a:hover { background: var(--s-accent-hover); color: #fff; }

/* ---------- Directory search bar (restyled) ---------- */
.bskpl-searchbar { box-shadow: var(--s-shadow); border-radius: var(--s-radius-lg); }
.bskpl-tabs-purpose { gap: 6px; margin-bottom: 12px; }
.bskpl-tab span { min-height: 40px; border-radius: var(--s-radius); border-color: var(--s-line); }
.bskpl-tab:has(input:checked) span { background: var(--s-accent); border-color: var(--s-accent); color: #fff; }
.bskpl-tab input:checked + span { background: var(--s-accent); border-color: var(--s-accent); color: #fff; }
.bskpl-f select, .bskpl-f input[type="number"], .bskpl-f input[type="search"] { border-color: var(--s-line); border-radius: var(--s-radius); }
.bskpl-agency-select { width: 100%; }
.bskpl-hp-note { font-size: 13px; color: var(--muted); }

/* ---------- Results: sub-tabs, bed and bath rolls, cross-purpose link, save search ---------- */
.bskpl-results-tools { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.bskpl-subtabs {
  display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 14px 0 0; padding: 0;
}
.bskpl-subtabs a {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; white-space: nowrap;
  border: 1px solid var(--s-line); border-radius: 999px; background: #fff; color: var(--ink);
  font-size: 14px; font-weight: 700; text-decoration: none;
}
.bskpl-subtabs a b { font-weight: 700; color: var(--muted); }
.bskpl-subtabs a:hover { border-color: var(--g-brand); color: var(--g); }
.bskpl-subtabs a[aria-current="true"] { background: var(--s-accent); border-color: var(--s-accent); color: #fff; }
.bskpl-subtabs a[aria-current="true"] b { color: #e8f5e9; }
.bskpl-rolls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 10px 0 0; }
.bskpl-rolls-label { font-size: 13px; font-weight: 700; color: var(--muted); min-width: 52px; }
.bskpl-rolls ul { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.bskpl-rolls a {
  display: inline-flex; align-items: center; min-height: 32px; padding: 0 11px; border-radius: var(--s-radius); white-space: nowrap;
  border: 1px solid var(--s-line); background: #fff; color: var(--ink); font-size: 13px; font-weight: 700; text-decoration: none;
}
.bskpl-rolls a:hover { border-color: var(--g-brand); color: var(--g); }
.bskpl-rolls a[aria-current="true"] { background: var(--s-soft); border-color: #9fd3a3; color: var(--g); }
.bskpl-cross { margin: 12px 0 0; font-size: 14px; }
.bskpl-cross a { font-weight: 700; color: var(--g); }

.bskpl-savesearch { position: relative; }
.bskpl-savesearch > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px;
  border: 1px solid var(--s-accent); border-radius: var(--s-radius); background: #fff; color: var(--g);
  font-size: 14px; font-weight: 700;
}
.bskpl-savesearch > summary::-webkit-details-marker { display: none; }
.bskpl-savesearch > summary:hover { background: var(--s-soft); }
.bskpl-savesearch > summary .bskpl-i { width: 16px; height: 16px; }
.bskpl-savesearch[open] > summary { background: var(--s-soft); }
.bskpl-savesearch-panel {
  position: absolute; z-index: 40; right: 0; top: calc(100% + 8px); width: min(360px, 88vw);
  display: grid; gap: 8px; padding: 14px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--s-radius-lg); box-shadow: var(--s-pop-shadow);
}
.bskpl-savesearch-panel h3 { font-size: 16px; font-weight: 900; margin: 0; }
.bskpl-savesearch-panel p { font-size: 13px; color: var(--muted); margin: 0; }
.bskpl-savesearch-panel label { display: grid; gap: 4px; font-size: 13px; font-weight: 700; }
.bskpl-savesearch-panel input[type="email"] {
  font: inherit; font-size: 15px; font-weight: 400; width: 100%; min-height: 42px; padding: 9px 12px;
  border: 1px solid var(--s-line); border-radius: var(--s-radius); background: #fff; color: var(--ink);
}
.bskpl-savesearch-panel .bskpl-btn { width: 100%; }
.bskpl-alert-hidden { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- Phone ---------- */
@media (max-width: 1020px) {
  .bskpl-hs-row-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .bskpl-hs-row-top .bskpl-f-type { grid-column: span 2; }
  .bskpl-hs-row-bottom { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .bskpl-hs-row-bottom .bskpl-hs-go { grid-column: span 2; }
}
@media (min-width: 1021px) {
  /* 1.8.0: with Beds hidden (Plots, Commercial), the price field takes their space, as on zameen.com. */
  .bskpl-hs-row-bottom.is-no-beds .bskpl-f-price { grid-column: span 2; }
}
@media (max-width: 720px) {
  .bskpl-hs { padding: 14px; }
  .bskpl-hs-tab { min-height: 38px; padding: 0 12px; font-size: 14px; }
  .bskpl-hs-row-top, .bskpl-hs-row-bottom { grid-template-columns: minmax(0, 1fr); }
  .bskpl-hs-row-top .bskpl-f-type, .bskpl-hs-row-bottom .bskpl-hs-go { grid-column: auto; }
  .bskpl-promo { padding: 12px; }
  .bskpl-results-tools { width: 100%; }
  .bskpl-savesearch-panel { right: auto; left: 0; }
  .bskpl-subtabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .bskpl-subtabs a { flex: 0 0 auto; }
}

/* ---------- 1.13.1: laptop search box in two rows ----------
   Row 1: City, Location, Property type, Beds, Baths, Area, Price. Row 2: Keyword, More filters, Search and Clear all.
   Beds and Baths leave row 1 when the property type does not show them, and the other boxes share the space.
   Phones and tablets keep the classic box. Narrow laptop windows (up to 1020px) keep the old grid. */
@media (min-width: 1021px) {
  .bskpl-searchbar-desk .bskpl-fields { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
  .bskpl-searchbar-desk .bskpl-desk-main { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
  /* Each box has a base width (--b) and a share of the spare width (--g). Area and Price carry the longest text. */
  .bskpl-searchbar-desk .bskpl-desk-main > .bskpl-f { flex: var(--g, 1) 1 var(--b, 150px); }
  .bskpl-searchbar-desk .bskpl-f-city { --g: .9; --b: 120px; }
  .bskpl-searchbar-desk .bskpl-f-loc, .bskpl-searchbar-desk .bskpl-f-type { --g: 1.3; --b: 150px; }
  .bskpl-searchbar-desk .bskpl-f-area { --g: 1.6; --b: 160px; }
  .bskpl-searchbar-desk .bskpl-f-price { --g: 1.6; --b: 160px; }
  .bskpl-searchbar-desk .bskpl-f-beds, .bskpl-searchbar-desk .bskpl-f-baths { --g: .7; --b: 100px; }
  /* 1.13.5: the keyword line. Keyword, More filters, Search and Clear all sit on one line. The Search button and Clear all
     are a flex row. In 1.13.4 that row was a grid, so Search sat on a row of its own above Clear all. The mobile shell wraps
     this block in a display:contents box, so the rule below matches the block wherever it is, not only as a direct child.
     Every box is --s-field-h tall and their bottoms are in line. The keyword box has a fixed width: it does not stretch on a
     wide screen, and it only gives way (down to 140 px) when the bar is narrow. */
  .bskpl-searchbar-desk .bskpl-desk-actions { display: flex; flex-wrap: nowrap; align-items: flex-end; gap: 10px; }
  .bskpl-searchbar-desk .bskpl-desk-actions > .bskpl-f-kw { flex: 0 1 240px; width: 240px; min-width: 140px; }
  .bskpl-searchbar-desk .bskpl-desk-actions > .bskpl-f-kw input { min-height: var(--s-field-h, 46px); height: var(--s-field-h, 46px); box-sizing: border-box; }
  .bskpl-searchbar-desk .bskpl-desk-actions > .bskpl-more { flex: 0 0 auto; }
  .bskpl-searchbar-desk .bskpl-desk-actions > .bskpl-more > summary { min-height: var(--s-field-h, 46px); height: var(--s-field-h, 46px); box-sizing: border-box; }
  .bskpl-searchbar-desk .bskpl-desk-actions .bskpl-go { flex: 0 0 auto; display: flex; flex-direction: row; flex-wrap: nowrap; align-items: flex-end; gap: 14px; }
  .bskpl-searchbar-desk .bskpl-go .bskpl-btn-go { width: auto; min-height: var(--s-field-h, 46px); height: var(--s-field-h, 46px); box-sizing: border-box; white-space: nowrap; }
  .bskpl-searchbar-desk .bskpl-go .bskpl-textlink { display: inline-flex; align-items: center; height: var(--s-field-h, 46px); white-space: nowrap; }
  .bskpl-searchbar-desk .bskpl-more .bskpl-checks { left: auto; right: 0; width: min(380px, 92vw); }
  /* The bar measures itself: a bar 960px wide or more keeps row 1 on one line (the boxes share the width). A narrower bar
     (a narrow content column) wraps the boxes onto more lines, so each box keeps a readable width. */
  .bskpl-searchbar-desk { container-type: inline-size; }
}
@container (min-width: 960px) {
  .bskpl-searchbar-desk .bskpl-desk-main { flex-wrap: nowrap; }
}
@media (max-width: 1020px) {
  .bskpl-searchbar-desk .bskpl-desk-main, .bskpl-searchbar-desk .bskpl-desk-actions { display: contents; }
}

/* ---------- 1.13.1: the Location and Property type boxes on the laptop bar ---------- */
.bskpl-dd-custom > .bskpl-dd-menu { left: 0; right: auto; width: 320px; max-width: 92vw; max-height: 380px; padding: 8px; }
.bskpl-dd-custom .bskpl-loc-text { display: block; width: 100%; min-height: 40px; margin: 0 0 8px; padding: 0 10px; border: 1px solid #cdd3dc; border-radius: var(--s-radius); background: #fff; color: var(--ink); font: inherit; font-size: 15px; }
.bskpl-dd-custom .bskpl-loc-text:focus { border-color: var(--g-brand); outline: 2px solid var(--g-brand); outline-offset: 0; }
.bskpl-dd-custom .bskpl-cust-list { list-style: none; margin: 0; padding: 0; max-height: 280px; overflow-y: auto; }
.bskpl-dd-custom .bskpl-cust-item { margin: 0; }
.bskpl-dd-custom .bskpl-cust-item[hidden], .bskpl-dd-custom .bskpl-cust-note[hidden], .bskpl-dd-custom .bskpl-type-sub[hidden] { display: none; }
.bskpl-dd-custom .bskpl-cust-note { padding: 8px 10px; color: var(--muted); font-size: 14px; }
.bskpl-dd-custom .bskpl-cust-opt, .bskpl-dd-custom .bskpl-type-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 38px; padding: 8px 10px; border: 0; border-radius: 6px; background: none; color: var(--ink); font: inherit; font-size: 15px; font-weight: 400; text-align: left; cursor: pointer; }
.bskpl-dd-custom .bskpl-cust-opt:hover, .bskpl-dd-custom .bskpl-cust-opt:focus-visible, .bskpl-dd-custom .bskpl-type-head:hover, .bskpl-dd-custom .bskpl-type-head:focus-visible { background: var(--s-soft-hover); outline: none; }
.bskpl-dd-custom .bskpl-cust-opt.is-on { background: var(--s-soft-on); color: var(--g); font-weight: 700; }
.bskpl-dd-custom .bskpl-cust-opt.is-any, .bskpl-dd-custom .bskpl-type-head { font-weight: 700; }
.bskpl-dd-custom .bskpl-cust-opt.is-child { padding-left: 26px; color: #3a4350; }
.bskpl-dd-custom .bskpl-type-group + .bskpl-type-group { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--s-line); }
.bskpl-dd-custom .bskpl-type-sub { list-style: none; margin: 0; padding: 0 0 4px; }
.bskpl-dd-custom .bskpl-type-head .bskpl-dd-chev { transition: transform .15s ease; }
.bskpl-dd-custom .bskpl-type-head[aria-expanded="true"] .bskpl-dd-chev { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .bskpl-dd-custom .bskpl-type-head .bskpl-dd-chev { transition: none; } }

/* 1.13.1: the English / اردو link above the search bar. It shows in English and in Urdu. */
.bskpl-langrow { display: flex; justify-content: flex-end; margin: 0 0 10px; }
.bskpl-urdu .bskpl-langrow { justify-content: flex-start; }
.bskpl-lang { display: inline-flex; align-items: center; min-height: 32px; padding: 0 14px; border: 1px solid #cdd3dc; border-radius: 999px; background: #fff; color: var(--ink, #1b2430); font-size: 14px; font-weight: 700; text-decoration: none; }
.bskpl-lang:hover, .bskpl-lang:focus-visible { border-color: var(--accent, #0b5cad); color: var(--accent, #0b5cad); }
