/* Форма пошуку турів з розширеними фільтрами (за референсом модуля Otpusk) */
.sf {
  --sf-brand: #c1996f;
  --sf-brand-dark: #a9825a;
  --sf-blue: #3d8fd6;
  --sf-orange: #f7941d;
  --sf-orange-dark: #e5820b;
  --sf-panel: #e4e8ef;
  --sf-line: #cfd5de;
  --sf-text: #444;
  color: var(--sf-text);
  font-size: .9rem;
  border-radius: .35rem;
  overflow: visible;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
}

/* --- Верхня панель */
.sf__bar { background: var(--sf-brand); padding: 1rem 1.25rem 1.25rem; border-radius: .35rem .35rem 0 0; }
.sf__title { color: #fff; font-weight: 700; font-size: 1.15rem; margin: 0 0 1rem; }
.sf__row { display: flex; background: #fff; border-radius: .25rem; position: relative; }
.sf__cell { position: relative; border-right: 1px solid var(--sf-line); min-width: 0; }
.sf__cell--dest { flex: 1.6 1 0; }
.sf__cell--from { flex: 1 1 0; }
.sf__cell--dates { flex: 0 0 auto; display: flex; align-items: center; gap: .25rem; padding: 0 .5rem; }
.sf__cell--nights { flex: 1 1 0; }
.sf__cell--people { flex: 1 1 0; border-right: 0; }

.sf-control {
  width: 100%; height: 44px; border: 0; background: transparent; color: var(--sf-text);
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: 0 .75rem; text-align: left; white-space: nowrap; font-size: .9rem;
}
.sf-control span { overflow: hidden; text-overflow: ellipsis; }
.sf-control::after { content: ''; flex: none; border: 5px solid transparent; border-bottom: 0; border-top-color: var(--sf-blue); }
.sf-control:focus-visible { outline: 2px solid var(--sf-blue); outline-offset: -2px; }
select.sf-control { appearance: none; cursor: pointer; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='5'%3E%3Cpath d='M0 0h10L5 5z' fill='%233d8fd6'/%3E%3C/svg%3E") no-repeat right .75rem center; padding-right: 2rem; }
select.sf-control::after { display: none; }
select.sf-control:disabled { color: #aaa; cursor: not-allowed; }

.sf-date { border: 0; background: #eef0f3; border-radius: .2rem; height: 30px; padding: 0 .4rem; font-size: .85rem; color: var(--sf-text); width: 128px; }
.sf-date__icon { color: var(--sf-blue); }
.sf-date__hint {
  position: absolute; left: 50%; top: -14px; transform: translate(-50%, -100%); white-space: nowrap;
  background: #e9edf2; color: #555; font-size: .72rem; padding: .1rem .75rem; border-radius: .25rem;
}

.sf__submit {
  flex: 0 0 auto; border: 0; background: var(--sf-orange); color: #fff; font-weight: 700;
  padding: 0 1.75rem; margin-left: .5rem; border-radius: .2rem; font-size: 1rem;
}
.sf__submit:hover { background: var(--sf-orange-dark); }

/* --- Спливаючі панелі */
.sf-pop {
  position: absolute; top: calc(100% + 2px); left: 0; z-index: 1050; background: #fff;
  border: 1px solid var(--sf-line); border-radius: .25rem; box-shadow: 0 6px 20px rgba(0, 0, 0, .15);
  display: none; min-width: 100%;
}
.sf-pop.is-open { display: block; }
.sf-pop__foot { display: flex; justify-content: flex-end; padding: .5rem; background: #f3f5f8; border-top: 1px solid var(--sf-line); }
.sf-btn-ok { border: 0; background: var(--sf-blue); color: #fff; font-weight: 700; font-size: .75rem; padding: .35rem 1.1rem; border-radius: .2rem; text-transform: uppercase; }

/* Напрямок: країни + курорти */
.sf-dest { width: 620px; max-width: calc(100vw - 2rem); }
.sf-dest__cols { display: grid; grid-template-columns: 1fr 1fr; height: 300px; }
.sf-dest__list { overflow-y: auto; padding: .25rem 0; }
.sf-dest__list--resorts { background: #e9edf3; }
.sf-country { display: block; width: 100%; border: 0; background: none; text-align: left; padding: .15rem 1rem; font-size: .85rem; color: var(--sf-text); }
.sf-country.is-bold { font-weight: 700; }
.sf-country:hover { background: #f0f3f7; }
.sf-country.is-active { background: #dfe6ef; }
.sf-country-sep { border-top: 1px solid var(--sf-line); margin: .25rem 1rem; }
.sf-check { display: flex; align-items: center; gap: .45rem; padding: .12rem .75rem; font-size: .85rem; cursor: pointer; margin: 0; }
.sf-check input { accent-color: var(--sf-blue); width: 15px; height: 15px; }
.sf-check small { color: #8a93a0; margin-left: auto; }

/* Ночі і туристи */
.sf-pop--small { padding: .75rem; min-width: 240px; }
.sf-pop--right { left: auto; right: 0; }
.sf-counter { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; }
.sf-counter__btns { display: flex; align-items: center; gap: .5rem; }
.sf-counter button { width: 28px; height: 28px; border: 1px solid var(--sf-line); background: #fff; border-radius: 50%; line-height: 1; color: var(--sf-blue); font-weight: 700; }
.sf-counter button:disabled { color: #bbb; }
.sf-counter output { min-width: 1.5rem; text-align: center; font-weight: 700; }
.sf-ages { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; }
.sf-ages select { width: 100%; }
.sf-nights { min-width: 220px; padding: .25rem 0; }
.sf-nights__list { max-height: 300px; overflow-y: auto; }
.sf-nights__item { display: block; width: 100%; border: 0; background: none; text-align: left; padding: .3rem .75rem; font-size: .85rem; color: #8a93a0; white-space: nowrap; }
.sf-nights__item strong { color: var(--sf-text); font-weight: 700; }
.sf-nights__item:hover, .sf-nights__item:focus-visible { background: #f0f3f7; outline: 0; }
.sf-nights__item.is-active { background: #dfe6ef; }

/* --- Розширені фільтри */
.sf__filters { background: var(--sf-panel); padding: .75rem 1.25rem; border-radius: 0 0 .35rem .35rem; }
.sf__toggle[aria-expanded="true"] + #sf-extended { padding-bottom: .75rem; }
.sf__toggle { border: 0; background: none; color: var(--sf-blue); font-weight: 600; padding: 0; }
.sf__toggle::after { content: ' ▾'; }
.sf__toggle[aria-expanded="true"]::after { content: ' ▴'; }
.sf__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem 2rem; margin-top: 1rem; }
.sf-h { color: var(--sf-blue); font-weight: 700; font-size: .9rem; margin: 0 0 .6rem; }
.sf-sub { color: var(--sf-blue); font-size: .8rem; margin: .5rem 0 .35rem; }
.sf__filters .sf-check { padding: .15rem 0; }
.sf-round input { appearance: none; width: 14px; height: 14px; border: 1px solid #b9c1cc; border-radius: 50%; background: #fff; margin: 0; flex: none; }
.sf-round input:checked { border: 4px solid var(--sf-blue); }
.sf-square input { appearance: none; width: 14px; height: 14px; border: 1px solid #b9c1cc; border-radius: 2px; background: #fff; margin: 0; flex: none; position: relative; }
.sf-square input:checked { background: var(--sf-blue); border-color: var(--sf-blue); }
.sf-square input:checked::after { content: ''; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.sf-round input:focus-visible, .sf-square input:focus-visible { outline: 2px solid var(--sf-blue); outline-offset: 1px; }
.sf-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 2rem; }
.sf-stars { color: #f5b301; letter-spacing: -1px; }

/* Слайдери */
.sf-range { position: relative; height: 22px; }
.sf-range input[type=range] { position: absolute; inset: 0; width: 100%; margin: 0; background: none; pointer-events: none; appearance: none; }
.sf-range input[type=range]::-webkit-slider-runnable-track { height: 6px; background: transparent; }
.sf-range input[type=range]::-moz-range-track { height: 6px; background: transparent; }
.sf-range input[type=range]::-webkit-slider-thumb { appearance: none; pointer-events: auto; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid var(--sf-blue); margin-top: -5px; cursor: pointer; }
.sf-range input[type=range]::-moz-range-thumb { pointer-events: auto; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--sf-blue); cursor: pointer; }
.sf-range__track { position: absolute; left: 0; right: 0; top: 8px; height: 6px; background: #fff; border-radius: 3px; }
.sf-range__fill { position: absolute; top: 8px; height: 6px; background: var(--sf-blue); border-radius: 3px; }
.sf-scale { position: relative; height: 1.1rem; font-size: .75rem; color: #666; margin: .25rem 8px 0; }
.sf-scale span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.sf-scale span:first-child { transform: translateX(-8px); }
.sf-range-values { display: flex; justify-content: space-between; font-size: .8rem; color: #555; margin-top: .25rem; }

.sf__actions { display: flex; justify-content: flex-end; align-items: center; gap: 1.5rem; margin-top: 1.5rem; }
.sf__clear { border: 0; background: none; color: var(--sf-blue); text-decoration: underline; padding: 0; font-size: .85rem; }
.sf__apply { border: 0; background: var(--sf-orange); color: #fff; font-weight: 700; padding: .6rem 1.75rem; border-radius: .2rem; }
.sf__apply:hover { background: var(--sf-orange-dark); }
.sf-badge { display: inline-block; min-width: 1.3rem; padding: 0 .35rem; margin-left: .25rem; border-radius: 1rem; background: var(--sf-orange); color: #fff; font-size: .75rem; text-align: center; }

/* --- Адаптив */
@media (max-width: 991.98px) {
  .sf__row { flex-wrap: wrap; }
  .sf__cell { border-bottom: 1px solid var(--sf-line); }
  .sf__cell--dest { flex: 1 1 100%; border-right: 0; }
  .sf__cell--from { flex: 1 1 50%; }
  .sf__cell--dates { flex: 1 1 50%; border-right: 0; justify-content: center; padding: .5rem; }
  .sf__cell--nights { flex: 1 1 50%; border-bottom: 0; }
  .sf__cell--people { flex: 1 1 50%; border-bottom: 0; }
  .sf__submit { flex: 1 1 100%; margin: .5rem 0 0; height: 44px; }
  .sf__grid { grid-template-columns: 1fr 1fr; }
  .sf-date__hint { display: none; }
}
@media (max-width: 575.98px) {
  .sf__bar, .sf__filters { padding: 1rem; }
  .sf__cell--from, .sf__cell--dates { flex-basis: 100%; border-right: 0; }
  .sf-date { width: auto; flex: 1; }
  .sf-dest__cols { grid-template-columns: 1fr; height: auto; }
  .sf-dest__list { max-height: 220px; }
  .sf-pop--right { left: 0; right: auto; }
  .sf__grid, .sf-cols { grid-template-columns: 1fr; }
}
