/* ===== map.html only — the property map page =====
   Loaded after style.css by map.html, en/map.html and he/map.html. Everything
   here is prefixed .imap- so it can never reach another page, and style.css is
   left untouched. Colours come from the :root tokens style.css defines, so the
   admin «التصميم» gold/ink overrides reach this page too. */

/* ---------- filter bar ---------- */
.imap-bar{
  background:var(--gray-50);
  border:1px solid var(--line);
  padding:18px 20px;
  margin-bottom:26px;
}
.imap-fields{
  display:flex;
  flex-wrap:wrap;
  align-items:flex-start;
  gap:18px 26px;
}
.imap-field{display:flex;flex-direction:column;gap:8px;min-width:0;}
.imap-field-wide{flex:1 1 320px;}
.imap-field-actions{margin-inline-start:auto;align-self:flex-end;}
.imap-field > label{
  color:var(--gold-dark);
  font-weight:800;
  font-size:12px;
  letter-spacing:1.4px;
  text-transform:uppercase;
}
.imap-chips{display:flex;flex-wrap:wrap;gap:8px;}
.imap-chip{
  border:1px solid var(--line);
  background:var(--white);
  color:var(--ink);
  font-weight:700;
  font-size:13.5px;
  padding:9px 15px;
  line-height:1.2;
  transition:var(--transition);
  white-space:nowrap;
}
.imap-chip:hover{border-color:var(--gold);color:var(--gold-dark);}
.imap-chip.on{background:var(--ink);border-color:var(--ink);color:var(--white);}
.imap-range{display:flex;align-items:center;gap:8px;}
.imap-range input{
  width:110px;
  border:1px solid var(--line);
  background:var(--white);
  color:var(--ink);
  font-weight:700;
  font-size:13.5px;
  padding:9px 12px;
}
.imap-range input:focus{outline:none;border-color:var(--gold);}
.imap-range span{color:var(--muted);font-weight:700;}
.imap-reset{
  border:1px solid var(--line);
  background:var(--white);
  color:var(--muted);
  font-weight:800;
  font-size:13px;
  padding:9px 16px;
  transition:var(--transition);
}
.imap-reset:hover{border-color:var(--ink);color:var(--ink);}
.imap-count{
  margin-top:16px;
  padding-top:14px;
  border-top:1px solid var(--line);
  color:var(--ink);
  font-weight:800;
  font-size:14.5px;
}
/* the «الفلاتر» button only exists on phones */
.imap-toggle{display:none;}

/* ---------- the map itself ---------- */
.imap-stage{
  margin:0 0 34px;
  border-top:1px solid var(--line);
  border-bottom:1px solid var(--line);
  background:var(--gray-100);
}
.imap-map{
  height:clamp(420px, 62vh, 680px);
  width:100%;
  z-index:0;      /* keeps Leaflet panes under the site header and the WA float */
}
.imap-map .leaflet-control-attribution{font-size:10.5px;}

/* the grouped pin: a gold disc with the count, the place name beside it */
.imap-pin-wrap{background:none;border:none;}
.imap-pin{
  display:flex;
  align-items:center;
  gap:8px;
  direction:ltr;    /* the disc stays left of the label in all three languages */
}
.imap-pin b{
  flex:0 0 auto;
  width:38px;height:38px;
  border-radius:50%;
  display:grid;place-items:center;
  background:var(--gold);
  color:#fff;
  font-size:14.5px;
  font-weight:900;
  border:2px solid #fff;
  box-shadow:0 3px 12px rgba(19,45,71,.35);
  transition:var(--transition);
}
.imap-pin span{
  background:rgba(255,255,255,.94);
  border:1px solid var(--line);
  color:var(--ink);
  font-weight:800;
  font-size:12.5px;
  padding:3px 9px;
  white-space:nowrap;
  box-shadow:0 2px 8px rgba(19,45,71,.14);
}
.imap-pin-wrap:hover .imap-pin b{background:var(--ink);transform:scale(1.08);}
.imap-pin.on b{background:var(--ink);width:44px;height:44px;font-size:16px;}
.imap-pin.on span{background:var(--ink);color:#fff;border-color:var(--ink);}

/* ---------- the list under the map ---------- */
.imap-panel{scroll-margin-top:calc(var(--nav-h) + 20px);}
.imap-panel-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:20px;
  flex-wrap:wrap;
  margin-bottom:24px;
}
.imap-panel-title{font-size:clamp(22px,2.8vw,32px);font-weight:900;letter-spacing:.3px;}
.imap-panel-sub{color:var(--muted);font-weight:700;font-size:14px;}
.imap-back{
  border:1px solid var(--line);
  background:var(--white);
  color:var(--ink);
  font-weight:800;
  font-size:13.5px;
  padding:11px 18px;
  transition:var(--transition);
}
.imap-back:hover{border-color:var(--gold);color:var(--gold-dark);}
.imap-group{margin-bottom:46px;}
.imap-group-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
  border-bottom:1px solid var(--line);
  padding-bottom:12px;
  margin-bottom:22px;
}
.imap-group-head h3{font-size:20px;font-weight:900;letter-spacing:.2px;}
.imap-group-btn{
  color:var(--gold-dark);
  font-weight:800;
  font-size:13.5px;
  transition:var(--transition);
}
.imap-group-btn:hover{color:var(--ink);}
.imap-empty{
  text-align:center;
  color:var(--muted);
  font-weight:700;
  padding:50px 20px;
  border:1px dashed var(--line);
}

/* ---------- tablet ---------- */
@media(max-width:1024px){
  .imap-field-wide{flex-basis:100%;}
  .imap-field-actions{margin-inline-start:0;}
}

/* ---------- phone: filters collapse behind «الفلاتر» ---------- */
@media(max-width:768px){
  .imap-bar{padding:14px;margin-bottom:18px;}
  .imap-toggle{
    display:flex;
    align-items:center;
    gap:10px;
    width:100%;
    border:1px solid var(--ink);
    background:var(--ink);
    color:#fff;
    font-weight:800;
    font-size:15px;
    padding:13px 16px;
  }
  .imap-toggle svg{width:20px;height:20px;flex:0 0 auto;}
  .imap-toggle em{
    margin-inline-start:auto;
    background:var(--gold);
    color:#fff;
    font-style:normal;
    font-weight:900;
    font-size:12px;
    min-width:22px;
    height:22px;
    border-radius:11px;
    display:grid;
    place-items:center;
    padding:0 6px;
  }
  .imap-toggle em[hidden]{display:none;}
  .imap-fields{display:none;padding-top:16px;gap:16px;}
  .imap-fields.open{display:flex;flex-direction:column;}
  .imap-field,.imap-field-wide{width:100%;flex-basis:auto;}
  .imap-field-actions{align-self:stretch;}
  .imap-reset{width:100%;padding:13px 16px;}
  .imap-range input{flex:1 1 0;width:auto;min-width:0;padding:12px;}
  .imap-chip{padding:10px 14px;font-size:14px;}
  .imap-count{margin-top:12px;font-size:13.5px;}

  /* the client asked for the map first, the list under it */
  .imap-map{height:60vh;min-height:360px;}
  .imap-stage{margin-bottom:24px;}
  .imap-pin span{display:none;}        /* labels overlap on a phone; the popup/panel names the place */
  .imap-pin b{width:34px;height:34px;font-size:13.5px;}
  .imap-pin.on b{width:40px;height:40px;}
  .imap-panel-head{margin-bottom:18px;}
  .imap-back{width:100%;text-align:center;}
  .imap-group{margin-bottom:34px;}
}
