/* "Простой подбор" (Easy Finder): trigger button and modal. Everything is scoped to .ef-*; no site styles are overridden.
   Sizes and colours follow Figma "SWD Зеленая Гавань (Anton)", page "ТЗ 153 (Простой подбор)". */
.ef-modal{
    --ef-title:#504d4f;
    --ef-text:#56524f;
    --ef-muted:#868070;
    --ef-soft:#e7e5e4;
    --ef-sub:#d5d3d2;
    --ef-weak:#f5f5f4;
    --ef-brand:#8e9c74;
    --ef-dark:#868070;
    --ef-dark-hover:#746e60;
    position:fixed;
    inset:0;
    z-index:10050;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:16px;
    font-family:inherit;
    color:var(--ef-text);
}
.ef-modal[hidden]{display:none}
.ef-modal *,.ef-modal *::before,.ef-modal *::after{box-sizing:border-box}

/* trigger next to "Все фильтры": the same pill (it also carries b-property-filter__all-filter, which no site script uses).
   The site lays the button row out as a 3-column grid; with the trigger it needs 4 columns on desktop. */
.ef-trigger{display:inline-flex;align-items:center;justify-content:center;white-space:nowrap}
.ef-trigger__icon{flex:0 0 auto}
@media (min-width:1024px){
    .b-property-filter__btns.ef-btns{grid-template-columns:auto 1fr auto auto}
}

.ef-modal__backdrop{position:absolute;inset:0;background:rgba(36,44,41,.32);animation:ef-fade .2s ease}
.ef-modal__dialog{
    position:relative;
    display:flex;
    flex-direction:column;
    width:480px;
    max-width:100%;
    height:640px;
    max-height:calc(100vh - 32px);
    max-height:calc(100dvh - 32px);
    background:#fff;
    border-radius:16px;
    overflow:hidden;
    outline:none;
    animation:ef-rise .22s ease;
}
.ef-modal__header{
    flex:0 0 auto;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    padding:20px 32px;
    border-bottom:1px solid var(--ef-soft);
}
.ef-modal__title{font-size:24px;line-height:28px;letter-spacing:-.04em;font-weight:400;color:var(--ef-title)}
.ef-modal__close{
    flex:0 0 auto;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:40px;
    height:40px;
    margin:-8px -8px -8px 0;
    padding:0;
    border:0;
    border-radius:8px;
    background:none;
    color:var(--ef-muted);
    cursor:pointer;
}
.ef-modal__close:hover{color:var(--ef-title);background:var(--ef-weak)}

.ef-modal__body{
    flex:1 1 auto;
    min-height:0;
    display:flex;
    flex-direction:column;
    gap:16px;
    margin:0;
    padding:24px 32px;
}

/* progress: 7 dots joined by lines, "N из 7" under them */
.ef-progress{flex:0 0 auto;display:flex;flex-direction:column;gap:8px}
.ef-progress__track{display:flex;align-items:center}
.ef-progress__dot{
    position:relative;
    flex:0 0 16px;
    width:16px;
    height:16px;
    border:2px solid var(--ef-sub);
    border-radius:50%;
    background:#fff;
    transition:border-color .2s,background-color .2s;
}
.ef-progress__dot.is-current{border-color:var(--ef-brand)}
.ef-progress__dot.is-current::after{content:"";position:absolute;inset:2px;border-radius:50%;background:var(--ef-brand)}
.ef-progress__dot.is-done{border-color:var(--ef-brand);background:var(--ef-brand)}
.ef-progress__line{flex:1 1 auto;height:2px;background:var(--ef-sub);transition:background-color .2s}
.ef-progress__line.is-done{background:var(--ef-brand)}
.ef-progress__label{font-size:14px;line-height:18px;letter-spacing:-.006em;color:var(--ef-muted);text-align:center}

.ef-steps{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;margin:0 -4px;padding:0 4px 4px}
.ef-step{animation:ef-step .18s ease}
.ef-step[hidden]{display:none}
.ef-step__question{max-width:343px;margin:0 0 16px;font-size:20px;line-height:24px;letter-spacing:-.04em;font-weight:400;color:var(--ef-title)}

/* answer cards */
.ef-options{display:flex;flex-direction:column;gap:8px}
.ef-option{
    position:relative;
    display:flex;
    align-items:center;
    gap:14px;
    min-height:52px;
    margin:0;
    padding:16px;
    border:1px solid var(--ef-soft);
    border-radius:12px;
    background:#fff;
    cursor:pointer;
    transition:border-color .15s;
    -webkit-tap-highlight-color:transparent;
}
.ef-option:hover{border-color:var(--ef-sub)}
.ef-option:has(.ef-option__input:checked){border-color:var(--ef-brand)}
.ef-option_media{padding:7px 16px 7px 7px;gap:12px}
.ef-option__input{position:absolute;opacity:0;width:1px;height:1px;margin:0;pointer-events:none}
.ef-option__img{flex:0 0 36px;width:36px;height:36px;border-radius:6px;object-fit:cover;background:var(--ef-weak)}
.ef-option__label{flex:1 1 auto;min-width:0;font-size:14px;line-height:18px;letter-spacing:-.006em;color:var(--ef-text)}
.ef-option__mark{
    flex:0 0 20px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:20px;
    height:20px;
    border:1.5px solid var(--ef-sub);
    background:#fff;
    color:#fff;
    transition:border-color .15s,background-color .15s;
}
.ef-option__mark_check{border-radius:5px}
.ef-option__mark_check svg{opacity:0;transition:opacity .15s}
.ef-option__input:checked ~ .ef-option__mark_check{border-color:var(--ef-brand);background:var(--ef-brand)}
.ef-option__input:checked ~ .ef-option__mark_check svg{opacity:1}
.ef-option__mark_radio{border-width:2px;border-radius:50%}
.ef-option__input:checked ~ .ef-option__mark_radio{border-color:var(--ef-brand);background:radial-gradient(circle,var(--ef-brand) 0 4px,#fff 4.5px)}
.ef-option__input:focus-visible ~ .ef-option__mark{outline:2px solid var(--ef-brand);outline-offset:2px}

/* step 4: currency switch */
.ef-currency{display:flex;gap:4px;margin:0 0 16px;padding:4px;border-radius:10px;background:var(--ef-weak)}
.ef-currency__tab{position:relative;flex:1 1 0;margin:0;cursor:pointer}
.ef-currency__input{position:absolute;opacity:0;width:1px;height:1px;margin:0;pointer-events:none}
.ef-currency__text{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:6px;
    height:36px;
    border:1px solid transparent;
    border-radius:8px;
    font-size:14px;
    line-height:18px;
    color:var(--ef-muted);
    transition:background-color .15s,border-color .15s,color .15s;
}
.ef-currency__sign{font-size:14px;line-height:1}
.ef-currency__input:checked + .ef-currency__text{background:#fff;border-color:var(--ef-soft);color:var(--ef-title)}
.ef-currency__input:focus-visible + .ef-currency__text{outline:2px solid var(--ef-brand);outline-offset:1px}

/* steps 4-5: range with two fields and a two-handle slider */
.ef-field-label{margin:0 0 8px;font-size:14px;line-height:18px;letter-spacing:-.006em;color:var(--ef-text)}
.ef-range__fields{display:flex;align-items:center;gap:8px}
.ef-range__field{
    flex:1 1 0;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:4px;
    min-width:0;
    height:44px;
    margin:0;
    padding:0 12px;
    border-radius:4px;
    background:var(--ef-weak);
    cursor:text;
}
.ef-range__prefix{flex:0 0 auto;font-size:14px;line-height:18px;color:#a8a29e}
.ef-range__input{
    flex:0 1 auto;
    width:9ch;
    min-width:0;
    padding:0;
    border:0;
    background:transparent;
    font:inherit;
    font-size:14px;
    line-height:18px;
    color:var(--ef-text);
    outline:none;
    box-shadow:none;
}
.ef-range__field:focus-within{box-shadow:inset 0 0 0 1px var(--ef-brand)}
.ef-range__dash{flex:0 0 8px;height:1px;background:var(--ef-sub)}
.ef-range__track{position:relative;height:16px;margin:2px 0 0}
.ef-range__track::before{content:"";position:absolute;left:8px;right:8px;top:7px;height:2px;background:var(--ef-sub)}
.ef-range__fill{position:absolute;top:7px;height:2px;background:var(--ef-dark)}
.ef-range__thumb{
    position:absolute;
    inset:0;
    width:100%;
    height:16px;
    margin:0;
    padding:0;
    background:none;
    pointer-events:none;
    -webkit-appearance:none;
    appearance:none;
}
.ef-range__thumb::-webkit-slider-runnable-track{height:16px;background:none;border:0}
.ef-range__thumb::-moz-range-track{height:16px;background:none;border:0}
.ef-range__thumb::-webkit-slider-thumb{
    -webkit-appearance:none;
    width:16px;
    height:16px;
    border:2px solid var(--ef-dark);
    border-radius:50%;
    background:#fff;
    cursor:grab;
    pointer-events:auto;
}
.ef-range__thumb::-moz-range-thumb{
    width:12px;
    height:12px;
    border:2px solid var(--ef-dark);
    border-radius:50%;
    background:#fff;
    cursor:grab;
    pointer-events:auto;
}
.ef-range__thumb:active::-webkit-slider-thumb{cursor:grabbing}

/* footer */
.ef-modal__footer{flex:0 0 auto;display:flex;gap:16px;margin-top:auto;padding-top:8px}
.ef-btn{
    flex:1 1 0;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    height:48px;
    margin:0;
    padding:12px 18px 12px 16px;
    border:1px solid transparent;
    border-radius:8px;
    font:inherit;
    font-size:14px;
    line-height:18px;
    letter-spacing:-.006em;
    cursor:pointer;
    transition:background-color .15s,border-color .15s,color .15s;
}
.ef-btn_back{background:#fff;border-color:var(--ef-soft);color:var(--ef-muted)}
.ef-btn_back:hover{border-color:var(--ef-sub);color:var(--ef-title)}
.ef-btn_next{background:var(--ef-dark);color:#fff}
.ef-btn_next:hover{background:var(--ef-dark-hover)}
.ef-btn:disabled{opacity:.6;cursor:default}
.ef-btn:focus-visible,.ef-modal__close:focus-visible{outline:2px solid var(--ef-brand);outline-offset:2px}

html.ef-modal-open,html.ef-modal-open body{overflow:hidden}

@keyframes ef-fade{from{opacity:0}to{opacity:1}}
@keyframes ef-rise{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}
@keyframes ef-step{from{opacity:0;transform:translateX(8px)}to{opacity:1;transform:none}}
.ef-step.is-back{animation-name:ef-step-back}
@keyframes ef-step-back{from{opacity:0;transform:translateX(-8px)}to{opacity:1;transform:none}}

/* phones: bottom sheet 375 x 640 as in the mobile frames */
@media (max-width:767px){
    .ef-modal{align-items:flex-end;padding:0}
    .ef-modal__dialog{
        width:100%;
        height:640px;
        max-height:calc(100vh - 24px);
        max-height:calc(100dvh - 24px);
        border-radius:16px 16px 0 0;
        animation-name:ef-sheet;
    }
    .ef-modal__header{padding:20px 16px}
    .ef-modal__body{padding:24px 16px calc(24px + env(safe-area-inset-bottom,0px))}
    .ef-modal__footer{gap:16px}
    @keyframes ef-sheet{from{transform:translateY(100%)}to{transform:none}}
}
@media (prefers-reduced-motion:reduce){
    .ef-modal__backdrop,.ef-modal__dialog,.ef-step{animation:none}
}
