/* ==========================================================================
   search-form.css — форма пошуку «послуга + місто» (078, partials/search-form.php, js/search-form.js): поля зі своїм
   списком (combobox / listbox), кнопка «Знайти», повідомлення; шапка > 1024 px — компактний рядок, хіро головної (блок
   search_form) — ширший; ≤ 1024 px та сама форма шапки — вікно «Знайти компанію» з лупи (як loca_search_form WP,
   shortcodes-style.css :11–32). Лише токени front-base.css. Підключається в layout.php після front-base.css.
   Вигляд — дизайн-система 075a (макет головної): поля й кнопка з радіусом кнопок макета, у шапці — висотою кнопок шапки
   (43 px), кнопка «Знайти» — як .front-btn; логіка й розмітка 078 — без змін.
   ========================================================================== */
.sf { position: relative; width: 100%; margin: 0; }

.sf-fields {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.sf-field {
    position: relative;
    display: flex;
    flex: 1 1 0;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 0 12px;
    border: 1px solid var(--front-line);
    border-radius: var(--front-radius-btn);
    background: var(--front-surface);
    transition: border-color .15s, box-shadow .15s;
}

.sf-field:focus-within {
    border-color: var(--front-accent);
    box-shadow: 0 0 0 3px var(--front-ring);
}

.sf-icon { flex: none; color: var(--front-muted); }

.sf-input {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    height: 40px;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--front-heading);
    font: inherit;
    font-size: 14px;
    text-overflow: ellipsis;
}

.sf-input::placeholder { color: var(--front-muted); opacity: 1; }

.sf-btn {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 16px;
    border: 0;
    border-radius: var(--front-radius-btn);
    background: var(--front-accent);
    color: var(--front-surface);
    font: inherit;
    font-size: 13px;
    font-weight: 750;
    white-space: nowrap;
    cursor: pointer;
}

.sf-btn:hover,
.sf-btn:focus-visible { background: var(--front-accent-dark); }

/* ── Список варіантів ────────────────────────────────────────────────────── */
.sf-list {
    position: absolute;
    top: calc(100% + 4px);
    left: -1px;
    z-index: 60;
    width: calc(100% + 2px);
    min-width: 240px;
    max-height: 300px;
    margin: 0;
    padding: 4px;
    overflow-y: auto;
    border: 1px solid var(--front-line);
    border-radius: var(--front-radius-sm);
    background: var(--front-surface);
    box-shadow: var(--front-shadow-pop);
    list-style: none;
}

.sf-list[hidden] { display: none; }

.sf-option {
    padding: 7px 10px;
    border-radius: 6px;
    color: var(--front-heading);
    font-size: 14px;
    line-height: 1.35;
    cursor: pointer;
    overflow-wrap: anywhere;
}

.sf-option:hover,
.sf-option.is-active { background: var(--front-soft); color: var(--front-accent); }

.sf-option--note,
.sf-option--note:hover {
    background: none;
    color: var(--front-text);
    cursor: default;
}

/* ── Повідомлення (ховається через 4 с — js) ─────────────────────────────── */
.sf-msg {
    margin: 8px 0 0;
    padding: 8px 12px;
    border-radius: var(--front-radius-sm);
    background: var(--front-surface);
    color: var(--front-danger);
    font-size: 13px;
    line-height: 1.4;
}

.sf-msg[hidden] { display: none; }

/* ── Шапка > 1024 px: рядок висотою кнопок шапки (43 px), повідомлення — під шапкою, висота шапки не змінюється ── */
.fh-search .sf-input { height: 41px; font-size: 13px; }

/* «Знайти» шапки (113c, власник 09.11.2026): фокус сторінки — не на пошуку, тож кнопка непримітна — спокійний вигляд .front-btn--quiet
   (тло --front-quiet, лупа й текст акцентом, без тіні); лупа й текст «Знайти» — на ПК і у вікні телефона (113f, власник 09.11.2026: лупа
   без підпису незрозуміла), лише лупа — 1101–1279 px (правило нижче). Хіро головної (.sf-section) — головна дія головної, не змінюється */
.fh-search .sf-btn { padding: 0 14px; background: var(--front-quiet); color: var(--front-accent); font-size: 12px; }
.fh-search .sf-btn:hover,
.fh-search .sf-btn:focus-visible { background: var(--front-mint); color: var(--front-accent-dark); }

.fh-search .sf-msg {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 61;
    border: 1px solid var(--front-line);
    box-shadow: var(--front-shadow-pop);
}

/* 1101–1279 px (шапка з меню й кнопками, 075a; 113f — повернуто після 113c): тексту немає місця в рядку — кнопка лише лупа, текст «Знайти» —
   для читачів екрана */
@media (min-width: 1101px) and (max-width: 1279px) {
    .fh-search .sf-btn { padding: 0 13px; }

    .fh-search .sf-btn span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
}

/* ── Хіро головної (блок search_form) ────────────────────────────────────── */
.sf-section .sf { max-width: 760px; margin: 0 auto; }
.sf-section .sf-input { height: 48px; font-size: 16px; }
.sf-section .sf-btn { padding: 0 24px; font-size: 16px; }

/* ── Лупа й вікно ────────────────────────────────────────────────────────────
   Форма шапки одна: вікно — спільне front-modal (084a, front-base.css .fmodal*, js/front.js) з модифікатором --search.
   > 1024 px оболонка вікна невидима (фон і шапка вікна — none), форма — рядком у .fh-search; ≤ 1024 px вікно приховане й
   відкривається лупою (.is-open), форма — стовпчиком. */
.sf-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: var(--front-radius-btn);
    background: none;
    color: var(--front-accent);
    cursor: pointer;
}

.sf-open:hover,
.sf-open[aria-expanded="true"] { background: var(--front-soft); }

@media (min-width: 1025px) {
    .fmodal.fmodal--search { display: block; }
    .fmodal--search .fmodal-overlay,
    .fmodal--search .fmodal-head { display: none; }
    .fmodal--search .fmodal-panel { display: block; width: auto; max-height: none; padding: 0; border-radius: 0; background: none; box-shadow: none; }
}

@media (max-width: 1024px) {
    .fmodal--search .sf-fields { flex-direction: column; gap: 12px; }
    .fmodal--search .sf-input { height: 44px; font-size: 16px; }
    .fmodal--search .sf-btn { width: 100%; height: 46px; padding: 0 16px; font-size: 15px; }
    .fmodal--search .sf-list { min-width: 0; max-height: 240px; }

    .fmodal--search .sf-msg {
        position: static;
        border: 0;
        box-shadow: none;
        padding: 0;
    }
}

/* ── Телефон: поля хіро — стовпчиком ─────────────────────────────────────── */
@media (max-width: 600px) {
    .sf-section .sf-fields { flex-direction: column; }
    .sf-section .sf-btn { height: 46px; }
    .sf-section .sf-list { min-width: 0; }
}

