/* ==========================================================================
   EduNav — page styles for bagcalar.html only.
   Every class here is prefixed .bagcalar- and is loaded after style.css.
   Nothing in this file may be reused by another page.
   ========================================================================== */

/* --- two-column shell: filter rail + results ------------------------------ */
.bagcalar-shell {
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.bagcalar-side {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.bagcalar-results { min-width: 0; }

/* --- filter panel --------------------------------------------------------- */
.bagcalar-panel {
  box-sizing: border-box;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg);
}

.bagcalar-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line-4);
}

.bagcalar-panel-title {
  margin: 0;
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.02em;
  color: var(--ink);
}

.bagcalar-reset {
  box-sizing: border-box;
  margin: 0;
  padding: 4px 6px;
  border: 0;
  border-radius: var(--r-xxs);
  background: none;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
  color: var(--text-2);
  cursor: pointer;
  transition: color .16s var(--ease);
}
.bagcalar-reset:hover { color: var(--ink); }
.bagcalar-reset:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* --- search field inside the panel ---------------------------------------- */
.bagcalar-search {
  position: relative;
  display: block;
  margin-bottom: 16px;
}

.bagcalar-search-icon {
  position: absolute;
  top: 50%;
  left: 12px;
  display: flex;
  align-items: center;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.bagcalar-search-icon svg { width: 16px; height: 16px; }

.bagcalar-panel .bagcalar-search-input { padding: 11px 12px 11px 36px; }

/* --- filter groups -------------------------------------------------------- */
.bagcalar-groups {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bagcalar-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.bagcalar-group-title {
  margin: 0;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink-2);
}

.bagcalar-side-note {
  margin: 16px 0 0;
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
}

/* --- support card under the panel ----------------------------------------- */
.bagcalar-help {
  box-sizing: border-box;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
}

.bagcalar-help-title {
  margin: 10px 0 0;
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.02em;
  color: var(--ink);
}

.bagcalar-help-text {
  margin: 7px 0 14px;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
}

/* --- results toolbar ------------------------------------------------------ */
.bagcalar-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
}

.bagcalar-toolbar-text { min-width: 0; }

.bagcalar-toolbar-title {
  margin: 0;
  font-family: var(--font-head);
  font-size: var(--fs-h2);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.026em;
  color: var(--ink);
  text-wrap: pretty;
}

.bagcalar-count {
  margin: 7px 0 0;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text-2);
}
.bagcalar-count-num {
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.bagcalar-sort {
  flex: none;
  width: 200px;
}

/* --- results grid --------------------------------------------------------- */
.bagcalar-grid .ecard { height: 100%; }

.bagcalar-empty { margin-top: 24px; }

.bagcalar-banner { margin-top: 36px; }

/* --- responsive ----------------------------------------------------------- */
@media (max-width: 1024px) {
  .bagcalar-shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
  .bagcalar-side {
    position: static;
    top: auto;
  }
}

@media (max-width: 768px) {
  .bagcalar-toolbar { align-items: flex-start; }
}

@media (max-width: 560px) {
  .bagcalar-panel { padding: 16px; }
  .bagcalar-sort { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .bagcalar-reset { transition: none; }
}


/* ==========================================================================
   Catalogue additions — checkbox facets, budget band, applied-filter tags,
   view switcher, list rows and the district map view.
   ========================================================================== */

/* --- facet options as checkbox rows, not chips: they carry a count and the
       list can run long, so a vertical rhythm reads faster than a chip wrap. */
.bagcalar-opts { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.bagcalar-opt {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 6px; border-radius: var(--r-xs);
  font-family: var(--font-body); font-size: 13.5px; font-weight: 500;
  color: var(--text); text-decoration: none;
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.bagcalar-opt:hover { background: var(--surface-2); color: var(--ink); }
.bagcalar-opt:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.bagcalar-opt-box {
  flex: none; display: grid; place-items: center;
  width: 18px; height: 18px; border: 1.5px solid var(--line-5);
  border-radius: var(--r-ctl); background: var(--bg); color: transparent;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.bagcalar-opt.is-on { color: var(--ink); font-weight: 700; }
.bagcalar-opt.is-on .bagcalar-opt-box { background: var(--brand); border-color: var(--brand-deep); color: var(--ink); }
.bagcalar-opt-label { flex: 1; min-width: 0; }
.bagcalar-opt-n {
  flex: none; font-size: 12px; font-weight: 600; color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* --- budget band --------------------------------------------------------- */
.bagcalar-price { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.bagcalar-price-in { padding: 10px 12px; font-size: 13.5px; text-align: center; }
.bagcalar-price-in::-webkit-outer-spin-button,
.bagcalar-price-in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bagcalar-price-in { -moz-appearance: textfield; appearance: textfield; }
.bagcalar-price-dash { color: var(--muted-3); font-size: 13px; }
.bagcalar-price-go { grid-column: 1 / -1; justify-content: center; margin-top: 2px; }
.bagcalar-price-note {
  margin: 9px 0 0; font-family: var(--font-body); font-size: 11.5px;
  line-height: 1.5; color: var(--muted);
}
.bagcalar-price-note strong { color: var(--text); font-weight: 700; }

/* --- applied-filter tags -------------------------------------------------- */
.bagcalar-applied {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-bottom: 16px;
}
.bagcalar-applied-label {
  font-family: var(--font-body); font-size: 12.5px; font-weight: 600; color: var(--text-2);
}
.bagcalar-tag {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 13px; border-radius: var(--r-pill);
  background: var(--ink); color: #fff; text-decoration: none;
  font-family: var(--font-body); font-size: 12.5px; font-weight: 600; line-height: 1;
  transition: background-color .16s var(--ease);
}
.bagcalar-tag:hover { background: var(--ink-3); color: #fff; }
.bagcalar-tag:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.bagcalar-tag svg { flex: none; opacity: .7; }
.bagcalar-tag:hover svg { opacity: 1; }
.bagcalar-applied-clear {
  font-family: var(--font-body); font-size: 12.5px; font-weight: 600;
  color: var(--text-2); text-decoration: underline; text-underline-offset: 3px;
}
.bagcalar-applied-clear:hover { color: var(--ink); }

/* --- toolbar tools -------------------------------------------------------- */
.bagcalar-tools { display: flex; align-items: center; gap: 10px; flex: none; }
.bagcalar-views {
  display: flex; align-items: center; gap: 2px; flex: none;
  padding: 3px; border: 1px solid var(--line-5); border-radius: var(--r-xs);
  background: var(--bg);
}
.bagcalar-view {
  display: grid; place-items: center; width: 34px; height: 32px;
  border-radius: var(--r-ctl); color: var(--muted);
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.bagcalar-view:hover { background: var(--surface-2); color: var(--ink); }
.bagcalar-view.is-on { background: var(--ink); color: #fff; }
.bagcalar-view:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* --- list view ------------------------------------------------------------ */
.bagcalar-list { display: grid; gap: 14px; }
.bagcalar-row {
  display: grid; grid-template-columns: 200px minmax(0, 1fr) 190px; gap: 18px;
  padding: 14px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--bg);
  transition: box-shadow .2s var(--ease), transform .2s var(--ease);
}
.bagcalar-row:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.bagcalar-row-media {
  position: relative; overflow: hidden; border-radius: var(--r-sm);
  min-height: 132px;
}
.bagcalar-row-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bagcalar-row-body { display: flex; flex-direction: column; gap: 7px; min-width: 0; padding: 4px 0; }
.bagcalar-row-title {
  margin: 0; font-family: var(--font-head); font-size: 17px; font-weight: 700;
  line-height: 1.3; letter-spacing: -.019em;
}
.bagcalar-row-title a { color: var(--ink); }
.bagcalar-row-title a:hover { color: var(--brand-dark); }
.bagcalar-row-desc {
  margin: 0; font-family: var(--font-body); font-size: 13px; line-height: 1.55; color: var(--text);
}
.bagcalar-row-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.bagcalar-row-side {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  gap: 8px; padding-left: 18px; border-left: 1px solid var(--line-4);
}
.bagcalar-row-priceline {
  margin: 0; font-family: var(--font-body); font-size: 11.5px; font-weight: 600; color: var(--muted);
}
.bagcalar-row-price {
  margin: 0; font-family: var(--font-head); font-size: 19px; font-weight: 700;
  letter-spacing: -.02em; color: var(--ink); white-space: nowrap;
}
/* The compare control is absolute inside a card; in a row it sits in flow. */
.bagcalar-row-cmp { position: static; box-shadow: none; }

/* --- map view ------------------------------------------------------------- */
.bagcalar-map { display: grid; gap: 16px; }
.bagcalar-map-note {
  padding: 16px 18px; border: 1px dashed var(--line-5);
  border-radius: var(--r-md); background: var(--surface);
}
.bagcalar-map-note p {
  margin: 8px 0 0; font-family: var(--font-body); font-size: 13px;
  line-height: 1.6; color: var(--text); max-width: 70ch;
}
.bagcalar-map-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}
.bagcalar-map-zone {
  padding: 14px 16px 12px; border: 1px solid var(--line);
  border-radius: var(--r-md); background: var(--bg);
}
.bagcalar-map-zone-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.bagcalar-map-zone-title {
  margin: 0; font-family: var(--font-head); font-size: 15px; font-weight: 700; letter-spacing: -.02em;
}
.bagcalar-map-zone-n {
  font-family: var(--font-head); font-size: 15px; font-weight: 700; color: var(--brand-dark);
  font-variant-numeric: tabular-nums;
}
.bagcalar-map-bar {
  height: 5px; margin: 9px 0 12px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden;
}
.bagcalar-map-bar-fill { display: block; width: var(--w, 0%); height: 100%; background: var(--brand); }
.bagcalar-map-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.bagcalar-map-item {
  display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: var(--r-xs);
  transition: background-color .15s var(--ease);
}
.bagcalar-map-item:hover { background: var(--surface-2); }
.bagcalar-map-mono {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px;
  border-radius: var(--r-ctl); color: #fff;
  font-family: var(--font-head); font-size: 11.5px; font-weight: 700;
}
.bagcalar-map-item-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bagcalar-map-item-name {
  font-family: var(--font-body); font-size: 13px; font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bagcalar-map-item-meta { font-family: var(--font-body); font-size: 11.5px; color: var(--muted); }

@media (max-width: 900px) {
  .bagcalar-row { grid-template-columns: 150px minmax(0, 1fr); }
  .bagcalar-row-side {
    grid-column: 1 / -1; flex-direction: row; align-items: center; flex-wrap: wrap;
    padding-left: 0; padding-top: 12px; border-left: 0; border-top: 1px solid var(--line-4);
  }
  .bagcalar-row-priceline { width: 100%; }
}
@media (max-width: 560px) {
  .bagcalar-row { grid-template-columns: minmax(0, 1fr); }
  .bagcalar-row-media { min-height: 150px; }
  .bagcalar-tools { width: 100%; justify-content: space-between; }
  .bagcalar-price { grid-template-columns: 1fr auto 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .bagcalar-row:hover { transform: none; }
}

/* --- real map canvas ------------------------------------------------------ */
.bagcalar-map-canvas {
  height: clamp(340px, 52vh, 560px);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-2);
  z-index: 0;                 /* keep tiles under the sticky header */
}
.bagcalar-map-hint {
  margin: 0;
  padding: 12px 16px;
  border: 1px dashed var(--line-5);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
}
/* Leaflet ships its own control styling; only the type needs aligning. */
.bagcalar-map .leaflet-container {
  font-family: var(--font-body);
  font-size: 12.5px;
}
.bagcalar-map .leaflet-popup-content strong {
  font-family: var(--font-head);
  font-size: 14px;
  letter-spacing: -.015em;
}
.bagcalar-map .leaflet-popup-content a { color: var(--brand-dark); font-weight: 600; }

/* --- radius search panel -------------------------------------------------- */
.bagcalar-radius {
  display: grid;
  gap: 10px;
  padding: 16px 18px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg);
}
.bagcalar-radius-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
}
.bagcalar-radius-title {
  margin: 0; font-family: var(--font-head); font-size: 16px; font-weight: 700;
  letter-spacing: -.02em; color: var(--ink);
}
.bagcalar-radius-sub {
  margin: 5px 0 0; font-family: var(--font-body); font-size: 12.5px;
  line-height: 1.5; color: var(--text-2); max-width: 56ch;
}
.bagcalar-radius-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-top: 4px;
}
.bagcalar-radius-label {
  font-family: var(--font-body); font-size: 12.5px; font-weight: 600; color: var(--text-2);
}
.bagcalar-radius-out {
  font-family: var(--font-head); font-size: 17px; font-weight: 700;
  letter-spacing: -.02em; color: #E0483C; font-variant-numeric: tabular-nums;
}
.bagcalar-radius-scale {
  display: flex; justify-content: space-between;
  font-family: var(--font-body); font-size: 11px; color: var(--muted);
}

/* The track is drawn on the input itself so it needs no wrapper element. */
.bagcalar-radius-range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; margin: 0;
  border-radius: var(--r-pill); background: var(--surface-3);
  cursor: pointer;
}
.bagcalar-radius-range:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.bagcalar-radius-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: #E0483C; border: 3px solid #fff;
  box-shadow: 0 2px 8px -2px rgba(224, 72, 60, .8);
  cursor: grab;
}
.bagcalar-radius-range::-webkit-slider-thumb:active { cursor: grabbing; }
.bagcalar-radius-range::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: #E0483C; border: 3px solid #fff;
  box-shadow: 0 2px 8px -2px rgba(224, 72, 60, .8);
  cursor: grab;
}
.bagcalar-radius-range::-moz-range-track { height: 6px; border-radius: var(--r-pill); background: var(--surface-3); }

@media (max-width: 560px) {
  .bagcalar-radius-head { flex-direction: column; }
  .bagcalar-radius-head .btn-ghost { width: 100%; justify-content: center; }
}
