/* Каталог кемпів: стилі робочих фільтрів (доповнюють блок .camps-* у main.css).
   Підключається тільки на /camps/ (functions.php). Логіка: assets/js/camps-filter.js. */

/* ---------- "When": кнопка і календар діапазону ---------- */
.camps-bar_field.fmc-when-field { position: relative; }

button.camps-bar_control.fmc-when {
  display: block;
  width: 100%;
  padding: 0;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
}
.fmc-when.is-empty .camps-bar_value { color: #546678; }
.fmc-when[aria-expanded="true"] { border-color: #0C1F33; }
.fmc-when:focus-visible { outline: 2px solid #0066CC; outline-offset: 2px; }

.fmc-cal {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  width: 308px;
  padding: 14px;
  background: #FFF;
  border: 1px solid #DBE3EE;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(12, 31, 51, 0.14);
  font-size: 13px;
  color: #0C1F33;
}
.fmc-cal[hidden] { display: none; }

.fmc-cal_head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.fmc-cal_title { font-size: 14px; font-weight: 700; text-transform: capitalize; }
.fmc-cal_nav {
  width: 30px; height: 30px; padding: 0;
  border: 1px solid #DBE3EE; border-radius: 8px; background: #FFF;
  font-size: 18px; line-height: 1; color: #0C1F33; cursor: pointer;
}
.fmc-cal_nav:hover { background: #E7EDF4; }

.fmc-cal_week,
.fmc-cal_grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.fmc-cal_week { margin-bottom: 4px; }
.fmc-cal_week span { text-align: center; font-size: 11px; line-height: 18px; color: #546678; text-transform: capitalize; }

.fmc-cal_day {
  height: 38px; padding: 0;
  border: 0; border-radius: 8px; background: transparent;
  font-size: 13px; color: #0C1F33; cursor: pointer;
}
.fmc-cal_day:hover:not(:disabled) { background: #E7EDF4; }
.fmc-cal_day.is-today { box-shadow: inset 0 0 0 1px #CDD6E1; }
.fmc-cal_day.is-in { background: #E7EDF4; border-radius: 0; }
.fmc-cal_day.is-start,
.fmc-cal_day.is-end { background: #0C1F33; color: #FFF; }
.fmc-cal_day.is-start { border-radius: 8px 0 0 8px; }
.fmc-cal_day.is-end { border-radius: 0 8px 8px 0; }
.fmc-cal_day.is-start:not(.is-end):last-child,
.fmc-cal_day.is-start.is-end { border-radius: 8px; }
.fmc-cal_day:disabled { opacity: .3; cursor: not-allowed; }
.fmc-cal_day:focus-visible,
.fmc-cal_nav:focus-visible { outline: 2px solid #0066CC; outline-offset: 1px; }

/* Покриття: точка під днями, коли є кемпи; дні без кемпів приглушені (їх можна вибрати, але видача буде порожня) */
.fmc-cal_day { position: relative; }
.fmc-cal_day.has-camps::after {
  content: ""; position: absolute; left: 50%; bottom: 5px;
  width: 5px; height: 5px; margin-left: -2.5px;
  border-radius: 50%; background: #22A06B;
}
.fmc-cal_day.is-start::after,
.fmc-cal_day.is-end::after { background: #FFF; }
.fmc-cal_day.no-camps { color: #99AAB5; }
.fmc-cal_day.no-camps.is-start,
.fmc-cal_day.no-camps.is-end { color: #FFF; }
.fmc-cal_nav:disabled { opacity: .3; cursor: not-allowed; }
.fmc-cal_nav:disabled:hover { background: #FFF; }
.fmc-cal_legend { display: flex; align-items: center; gap: 6px; margin: 10px 0 0; font-size: 12px; line-height: 16px; color: #546678; }
.fmc-cal_legend i { flex: none; width: 6px; height: 6px; border-radius: 50%; background: #22A06B; }

.fmc-cal_foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.fmc-cal_clear { padding: 0; border: 0; background: none; font-size: 13px; color: #546678; text-decoration: underline; cursor: pointer; }
.fmc-cal_done {
  padding: 8px 16px; border: 0; border-radius: 8px;
  background: #0C1F33; color: #FFF; font-size: 13px; font-weight: 600; cursor: pointer;
}

@media (max-width: 700px) {
  .fmc-cal {
    position: fixed; z-index: 60;
    left: 15px; right: 15px; bottom: 15px; top: auto;
    width: auto; max-width: none;
  }
  .fmc-cal_day { height: 42px; }
}

/* ---------- Вік: вибір кількох значень ---------- */
.camps-bar_field.fmc-age-field { position: relative; }
.fmc-age .camps-bar_value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 34px; }
.fmc-agepop {
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0;
  width: 280px; max-width: calc(100vw - 30px); padding: 14px;
  background: #FFF; border: 1px solid #DBE3EE; border-radius: 12px;
  box-shadow: 0 12px 32px rgba(12, 31, 51, 0.14); color: #0C1F33;
}
.fmc-agepop[hidden] { display: none; }
.fmc-agepop_hint { margin: 0 0 10px; font-size: 12px; line-height: 16px; color: #546678; }
.fmc-agepop_grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.fmc-agepop_btn {
  height: 38px; padding: 0; border: 1px solid #DBE3EE; border-radius: 8px;
  background: #FFF; font-family: inherit; font-size: 14px; color: #0C1F33; cursor: pointer;
}
.fmc-agepop_btn:hover { background: #E7EDF4; }
.fmc-agepop_btn.is-on { background: #0C1F33; border-color: #0C1F33; color: #FFF; }
.fmc-agepop_btn:focus-visible { outline: 2px solid #0066CC; outline-offset: 1px; }
@media (max-width: 700px) {
  .fmc-agepop { position: fixed; z-index: 60; left: 15px; right: 15px; bottom: 15px; top: auto; width: auto; max-width: none; }
  .fmc-agepop_btn { height: 42px; }
}

/* ---------- Слайдер бюджету ---------- */
.camps-slider { cursor: pointer; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.camps-slider_thumb {
  z-index: 2;
  cursor: grab;
  touch-action: none;
}
.camps-slider_thumb::after { content: ""; position: absolute; inset: -10px; }
.camps-slider_thumb.is-drag { cursor: grabbing; border-color: #0C1F33; }
.camps-slider_thumb:focus-visible { outline: 2px solid #0066CC; outline-offset: 2px; }
.camps-slider_fill { pointer-events: none; }

/* ---------- More filters: бейдж, опції ---------- */
.camps-more_badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; margin-left: 2px; padding: 0 5px;
  border-radius: 9px; background: #FFF; color: #0C1F33;
  font-size: 11px; font-weight: 700; line-height: 1;
}
.camps-more_badge[hidden] { display: none; }

.fmc-opt.is-empty { opacity: .45; cursor: not-allowed; }
.fmc-opt.is-empty .fmc-opt_label { cursor: not-allowed; }
.fmc-opt_point:disabled + .fmc-opt_box { background: #F4F6FA; border-color: #E4E9F0; }

/* Перемикач типу кемпу (All / Overnight / Day) сховано за проханням; розмітка й логіка лишились — див. fmc_cf_type_enabled */
.camps-toggle { display: none !important; }

/* Тип кемпу на вузьких екранах: три кнопки ділять ширину порівно, нічого не обрізається */
@media (max-width: 520px) {
  .camps-toggle { display: flex; width: 100%; }
  .camps-toggle_btn { flex: 1 1 auto; padding: 8px 6px; font-size: 13px; }
}

/* Тип кемпу: фокус з клавіатури */
.camps-toggle_btn:focus-visible { outline: 2px solid #0066CC; outline-offset: 2px; }

/* ---------- Видача ---------- */
#fmc-results { transition: opacity .15s; }
#fmc-results.is-loading { opacity: .45; pointer-events: none; }

.fmc-empty { text-align: center; padding: 56px 0; }
.fmc-empty_h { margin: 0 0 6px; font-size: 18px; font-weight: 700; color: #0C1F33; }
.fmc-empty_p { margin: 0 0 18px; font-size: 14px; color: #546678; }
.fmc-empty_btn {
  padding: 11px 20px; border: 1px solid #0C1F33; border-radius: 8px;
  background: #0C1F33; color: #FFF; font-size: 14px; font-weight: 600; cursor: pointer;
}
.fmc-empty_btn:hover { opacity: .9; }

/* ---------- Сортування ----------
   Раніше select був завширшки з текст усередині рамки, тому випадний список виходив вузьким і "криво".
   Тепер select розтягнутий на всю рамку (список під ним такої ж ширини), а напис "Sort by:" лежить поверх зліва. */
.camps-sort {
  min-width: 250px;
  padding: 0;
}
.camps-sort_label {
  position: relative;
  z-index: 1;
  margin-left: 18px;
  pointer-events: none;
}
.camps-sort_point {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0 38px 0 calc(18px + var(--sort-label-w, 64px) + 8px);
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-family: "OpenSans", sans-serif;
  font-size: 14px;
  color: #0C1F33;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.camps-sort:focus-within { border-color: #0C1F33; }
.camps-sort_point:focus-visible { outline: 2px solid #0066CC; outline-offset: 2px; }
.camps-sort_icon { z-index: 1; }
.camps-map { white-space: nowrap; flex: none; }
.camps-map_label { white-space: nowrap; }
@media (max-width: 900px) {
  .camps-summary_actions { display: flex; flex-wrap: wrap; gap: 10px; }
  /* Кнопка карти — за змістом, сортування займає решту рядка; якщо тісно — переноситься на новий рядок на всю ширину */
  .camps-sort { flex: 1 1 210px; width: auto; min-width: 0; }
}
@media (max-width: 420px) {
  .camps-map { width: 100%; justify-content: center; }
  .camps-sort { flex-basis: 100%; }
}

/* ---------- Карта каталогу (View on map) ---------- */
.camps-map:focus-visible { outline: 2px solid #0066CC; outline-offset: 2px; }
.camps-map[aria-expanded="true"] { background: #0C1F33; color: #FFF; }
.camps-map[aria-expanded="true"] svg path { stroke: #FFF; }

.fmc-map {
  margin: 0 0 24px;
  background: #FFF;
  border: 1px solid #DBE3EE;
  border-radius: 12px;
  overflow: hidden;
}
.fmc-map[hidden] { display: none; }
.fmc-map_canvas { width: 100%; height: 440px; background: #E7EDF4; }
.fmc-map_note { margin: 0; padding: 10px 14px; border-top: 1px solid #DBE3EE; font-size: 12px; line-height: 16px; color: #546678; }
.fmc-map_note:empty { display: none; }

/* Вікно маркера (Google InfoWindow): картинка, назва, локація, ціна */
.fmc-iw { display: flex; gap: 12px; width: 280px; max-width: 100%; font-family: "OpenSans", sans-serif; }
.fmc-iw_img { flex: none; width: 88px; height: 88px; border-radius: 8px; overflow: hidden; background: #DBE3EE; }
.fmc-iw_img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.fmc-iw_b { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.fmc-iw_h { font-size: 14px; font-weight: 700; line-height: 18px; color: #0C1F33; text-decoration: none; }
.fmc-iw_h:hover { text-decoration: underline; }
.fmc-iw_p { margin: 0; font-size: 12px; line-height: 16px; color: #546678; }
.fmc-iw_pr { margin: 0; font-size: 14px; font-weight: 800; line-height: 18px; color: #0C1F33; }
.fmc-iw_more { margin-top: 2px; font-size: 12px; font-weight: 700; color: #0066CC; text-decoration: none; }
.fmc-iw_more:hover { text-decoration: underline; }

@media (max-width: 700px) {
  .fmc-map_canvas { height: 360px; }
  .fmc-iw { width: 220px; }
  .fmc-iw_img { width: 64px; height: 64px; }
}

/* ---------- Чипи ---------- */
.camps-chips { margin-bottom: 16px; }
.camps-chip { max-width: 100%; }
.camps-chip > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
