/* ==========================================================================
   Ana səhifə axtarışı — «Bütün şəhərlər» premium seçimi (assets/js/city-picker.js)
   ========================================================================== */

/* Əsl select formda qalır, lakin görünmür (panel onu idarə edir) */
.cp-native { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; border: 0 !important; opacity: 0 !important; pointer-events: none !important; }

.cp-trigger {
  flex: 1 1 auto; min-width: 0; height: 100%;
  display: flex; align-items: center;
  padding: 0 24px 0 0; border: 0; background: transparent;
  font: inherit; font-size: 15px; font-weight: 600; color: #241417;
  text-align: left; cursor: pointer; outline: 0;
  -webkit-tap-highlight-color: transparent;
}
.cp-trigger-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-field .sp-chev { transition: transform .2s ease, color .15s ease; }
.cp-field.cp-open { background: #fff1f3 !important; }
.cp-field.cp-open .sp-chev { transform: rotate(180deg); color: #e11d48; }
.cp-field.cp-has-value .cp-trigger { color: #be123c; }
.cp-field:has(.cp-trigger:focus-visible) { box-shadow: inset 0 0 0 2px #fda4b4; }

/* ---- Panel */
.cp-pop {
  position: fixed !important; z-index: 2147483000 !important; isolation: isolate;
  background-color: #fff !important;
  display: flex; flex-direction: column;
  min-height: 0; overflow: hidden;
  border-radius: 20px;
  background: #fff;
  border: 1px solid #f3dfe3;
  box-shadow: 0 28px 60px -22px rgba(60, 20, 30, .42), 0 4px 14px -6px rgba(60, 20, 30, .12);
  opacity: 0; transform: translateY(-6px) scale(.985); transform-origin: top center;
  transition: opacity .16s ease, transform .18s cubic-bezier(.2, .8, .2, 1);
}
.cp-pop.is-up { transform-origin: bottom center; transform: translateY(6px) scale(.985); }
.cp-pop[hidden] { display: none; }
.cp-pop.is-in { opacity: 1; transform: none; }

.cp-head { display: none; align-items: center; justify-content: space-between; padding: 14px 16px 4px; }
.cp-head b { font-size: 16px; font-weight: 800; color: #241417; }
.cp-x { width: 34px; height: 34px; border: 0; border-radius: 11px; background: #f9f3f4; color: #8a6c73; font-size: 14px; cursor: pointer; }

.cp-search {
  flex: none;
  display: flex; align-items: center; gap: 8px;
  margin: 10px 10px 6px; padding: 0 12px;
  height: 42px; border-radius: 13px;
  background: #fbf7f8; border: 1.5px solid #f3e6e9;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
  cursor: text;
}
.cp-search:focus-within { border-color: #fb7185; background: #fff; box-shadow: 0 0 0 4px rgba(251, 113, 133, .14); }
.cp-search svg { flex: none; width: 17px; height: 17px; color: #c4a9af; }
.cp-search input { flex: 1; min-width: 0; height: 100%; border: 0 !important; outline: 0; background: transparent !important; box-shadow: none !important; padding: 0 !important; font: inherit; font-size: 14.5px; font-weight: 600; color: #241417; }
.cp-search input::placeholder { color: #b9a2a8; font-weight: 500; }

.cp-list {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto; overscroll-behavior: contain;
  padding: 4px 6px 8px;
  outline: 0;
  scrollbar-width: thin; scrollbar-color: #ead9dd transparent;
}
.cp-list::-webkit-scrollbar { width: 8px; }
.cp-list::-webkit-scrollbar-thumb { background: #ead9dd; border-radius: 8px; border: 2px solid #fff; }

.cp-group {
  position: sticky; top: -4px; z-index: 1;
  margin: 6px 0 2px; padding: 8px 10px 5px;
  background: linear-gradient(#fff 70%, rgba(255, 255, 255, 0));
  font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #c4a9af;
}

.cp-opt {
  display: flex; align-items: center; gap: 10px;
  min-height: 42px; padding: 7px 10px;
  border-radius: 12px;
  font-size: 14.5px; font-weight: 600; color: #3b2a2e;
  cursor: pointer; user-select: none;
  transition: background .1s ease;
}
.cp-opt-ico {
  flex: none; width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: 9px; background: #fbf4f5; color: #e11d48;
}
.cp-opt-ico svg { width: 15px; height: 15px; display: block; }
.cp-opt.is-all .cp-opt-ico { color: #be123c; }
.cp-opt-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-opt-count {
  flex: none; padding: 2px 8px; border-radius: 999px;
  background: #f6eef0; color: #8a6c73;
  font-size: 11.5px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.cp-opt-chk { flex: none; width: 18px; height: 18px; color: #e11d48; opacity: 0; transform: scale(.6); transition: opacity .12s ease, transform .15s ease; }
.cp-opt-chk svg { width: 100%; height: 100%; display: block; }
.cp-opt.is-active { background: #fdf2f4; }
.cp-opt.is-active .cp-opt-ico { background: #fff; box-shadow: 0 0 0 1px #fbe0e5; }
.cp-opt.is-sel { color: #be123c; font-weight: 800; }
.cp-opt.is-sel .cp-opt-ico { background: linear-gradient(135deg, #fff1f3, #ffe4e9); }
.cp-opt.is-sel .cp-opt-count { background: #ffe4e9; color: #be123c; }
.cp-opt.is-sel .cp-opt-chk { opacity: 1; transform: none; }
.cp-opt.is-all { margin-bottom: 2px; }

.cp-empty { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 26px 16px 22px; text-align: center; }
.cp-empty span { font-size: 24px; margin-bottom: 4px; }
.cp-empty b { font-size: 14px; color: #241417; overflow-wrap: anywhere; }
.cp-empty small { font-size: 12.5px; color: #a88b91; }

/* ---- Mobil: alt pəncərə */
.cp-backdrop { position: fixed !important; inset: 0; z-index: 2147482990 !important; background: rgba(36, 20, 23, .42); opacity: 0; transition: opacity .2s ease; }
.cp-backdrop[hidden] { display: none; }
.cp-backdrop.is-in { opacity: 1; }
html.cp-lock, html.cp-lock body { overflow: hidden; }

.cp-pop.is-sheet {
  left: 0; right: 0; bottom: 0; top: auto;
  width: auto; max-height: min(78vh, 620px); max-height: min(78dvh, 620px);
  border-radius: 24px 24px 0 0; border-bottom: 0;
  padding-bottom: env(safe-area-inset-bottom);
  transform: translateY(24px); transform-origin: bottom center;
}
.cp-pop.is-sheet.is-in { transform: none; }
.cp-pop.is-sheet::before { content: ""; align-self: center; flex: none; width: 40px; height: 4px; margin-top: 8px; border-radius: 99px; background: #eadde0; }
.cp-pop.is-sheet .cp-head { display: flex; }
.cp-pop.is-sheet .cp-search { margin: 8px 14px 6px; height: 46px; }
.cp-pop.is-sheet .cp-search input { font-size: 16px; } /* iOS-da fokus zoom-unu önləyir */
.cp-pop.is-sheet .cp-list { padding: 4px 10px 14px; }
.cp-pop.is-sheet .cp-opt { min-height: 48px; font-size: 15px; }

@media (max-width: 760px) {
  .cp-trigger { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .cp-pop, .cp-backdrop, .cp-opt-chk, .cp-field .sp-chev { transition: none; }
}
