/* ==========================================================================
   main-grid.css — сетка главной страницы (main2) на flex/grid
   Заменяет bootstrap-классы row, col-*, d-*, mb-*, mt-* новыми fx-* классами.
   Поведение повторяет bootstrap 4 grid: 12 колонок, брейкпоинты 768/992.
   ========================================================================== */

/* Flex-ряд (аналог .row.no-gutters: без отступов и padding у детей) */
.fx-row {
    display: flex;
    flex-wrap: wrap;
}

/* Дети ряда без padding (аналог .no-gutters > [class*="col-"]).
   Важно: перебивает padding сторонних классов на колонках (напр. jq-selectbox__select) */
.fx-row > .fx-col {
    padding-right: 0;
    padding-left: 0;
}

/* Аналог проектного ".no-gutters [class^=col]" (descendant, !important):
   обнуляет padding у ЛЮБЫХ потомков fx-row, чей class начинается с "col"
   (напр. collection__filters-item-parent — иначе ловит padding 20px от
   @media(max-width:1200px){[class^=col]{padding:0 20px}}) */
.fx-row [class^="col"] {
    padding-right: 0 !important;
    padding-left: 0 !important;
}

/* Базовая колонка: во всю ширину (как .col-* в bootstrap до брейкпоинта) */
.fx-col {
    position: relative;
    width: 100%;
}

/* Фиксированные доли на всех ширинах (аналоги col-*) */
.fx-1  { flex: 0 0 8.3333%;  max-width: 8.3333%; }
.fx-2  { flex: 0 0 16.6667%; max-width: 16.6667%; }
.fx-3  { flex: 0 0 25%;      max-width: 25%; }
.fx-4  { flex: 0 0 33.3333%; max-width: 33.3333%; }
.fx-6  { flex: 0 0 50%;      max-width: 50%; }
.fx-8  { flex: 0 0 66.6667%; max-width: 66.6667%; }
.fx-9  { flex: 0 0 75%;      max-width: 75%; }
.fx-10 { flex: 0 0 83.3333%; max-width: 83.3333%; }
.fx-11 { flex: 0 0 91.6667%; max-width: 91.6667%; }
.fx-12 { flex: 0 0 100%;     max-width: 100%; }

/* База адаптивных колонок: до своего брейкпоинта — во всю ширину ряда
   (как bootstrap col-*: width:100% без media). Без этого flex-item
   сжимается до ширины контента и дети с width:100% (img) схлопываются в 0 */
.fx-sm-3, .fx-sm-4, .fx-sm-5, .fx-sm-6, .fx-sm-12,
.fx-md-1, .fx-md-2, .fx-md-3, .fx-md-4, .fx-md-5, .fx-md-6, .fx-md-7,
.fx-md-8, .fx-md-9, .fx-md-10, .fx-md-11,
.fx-lg-1, .fx-lg-2, .fx-lg-3, .fx-lg-4, .fx-lg-5, .fx-lg-6, .fx-lg-7,
.fx-lg-8, .fx-lg-9, .fx-lg-10, .fx-lg-12 {
    width: 100%;
}

/* ВАЖНО: media-блоки строго по возрастанию брейкпоинта (576 < 768 < 992),
   иначе при равной специфичности поздний md перебивает более ранний lg на десктопе */

/* sm (≥576px): аналоги col-sm-* */
@media (min-width: 576px) {
    .fx-sm-3  { flex: 0 0 25%;      max-width: 25%; }
    .fx-sm-4  { flex: 0 0 33.3333%; max-width: 33.3333%; }
    .fx-sm-5  { flex: 0 0 41.6667%; max-width: 41.6667%; }
    .fx-sm-6  { flex: 0 0 50%; max-width: 50%; }
    .fx-sm-12 { flex: 0 0 100%;     max-width: 100%; }
}

/* md (≥768px): аналоги col-md-* */
@media (min-width: 768px) {
    .fx-md-1  { flex: 0 0 8.3333%;  max-width: 8.3333%; }
    .fx-md-2  { flex: 0 0 16.6667%; max-width: 16.6667%; }
    .fx-md-3  { flex: 0 0 25%;      max-width: 25%; }
    .fx-md-4  { flex: 0 0 33.3333%; max-width: 33.3333%; }
    .fx-md-5  { flex: 0 0 41.6667%; max-width: 41.6667%; }
    .fx-md-6  { flex: 0 0 50%;      max-width: 50%; }
    .fx-md-7  { flex: 0 0 58.3333%; max-width: 58.3333%; }
    .fx-md-8  { flex: 0 0 66.6667%; max-width: 66.6667%; }
    .fx-md-9  { flex: 0 0 75%;      max-width: 75%; }
    .fx-md-10 { flex: 0 0 83.3333%; max-width: 83.3333%; }
    .fx-md-11 { flex: 0 0 91.6667%; max-width: 91.6667%; }
}

/* lg (≥992px): аналоги col-lg-* */
@media (min-width: 992px) {
    .fx-lg-1  { flex: 0 0 8.3333%;  max-width: 8.3333%; }
    .fx-lg-2  { flex: 0 0 16.6667%; max-width: 16.6667%; }
    .fx-lg-3  { flex: 0 0 25%;      max-width: 25%; }
    .fx-lg-4  { flex: 0 0 33.3333%; max-width: 33.3333%; }
    .fx-lg-5  { flex: 0 0 41.6667%; max-width: 41.6667%; }
    .fx-lg-6  { flex: 0 0 50%;      max-width: 50%; }
    .fx-lg-7  { flex: 0 0 58.3333%; max-width: 58.3333%; }
    .fx-lg-8  { flex: 0 0 66.6667%; max-width: 66.6667%; }
    .fx-lg-9  { flex: 0 0 75%;      max-width: 75%; }
    .fx-lg-10 { flex: 0 0 83.3333%; max-width: 83.3333%; }
    .fx-lg-12 { flex: 0 0 100%;     max-width: 100%; }
}

/* Видимость (аналоги d-none d-md-block / d-none d-lg-block / d-block d-md-none)
   !important — как у bootstrap utilities, иначе перебиваются кастомными правилами */
.fx-show-md { display: none !important; }
@media (min-width: 768px) {
    .fx-show-md { display: block !important; }
}

.fx-show-lg { display: none !important; }
@media (min-width: 992px) {
    .fx-show-lg { display: block !important; }
}

.fx-hide-md { display: block !important; }
@media (min-width: 768px) {
    .fx-hide-md { display: none !important; }
}

/* Аналог d-block d-lg-none: виден <992, скрыт ≥992 */
.fx-hide-lg { display: block !important; }
@media (min-width: 992px) {
    .fx-hide-lg { display: none !important; }
}

/* Аналог d-block */
.fx-block { display: block !important; }

/* Порты кастомных правил style.min.css на fx-классы */
.auxiliary-filter .fx-btn-group { align-items: center; }
.text-block .fx-row { color: #83838b; font-size: .7rem; }
.text-block .fx-row > * { padding-right: 1rem !important; }
/* object-house: блок параметров (.p-param) */
.object .p-param .fx-row { align-items: center; border-top: 1px solid var(--fox-black, #000); border-left: 1px solid var(--fox-black, #000); }
.object .p-param .fx-row > * { border-right: 1px solid var(--fox-black, #000); border-bottom: 1px solid var(--fox-black, #000); height: 37px; padding-top: 10px !important; }

/* Прочие утилиты */
.fx-pr-1 { padding-right: .25rem !important; }
.fx-pl-2 { padding-left: .5rem !important; }
.fx-pr-2 { padding-right: .5rem !important; }
.fx-text-center { text-align: center; }

/* Аналог bootstrap .row С gutters (проектные значения style.min.css: -15px, при ≤1200px -20px) */
.fx-row.fx-gutters { margin-right: -15px; margin-left: -15px; }
.fx-row.fx-gutters > .fx-col { padding-right: 15px; padding-left: 15px; }
@media (max-width: 1200px) {
    .fx-row.fx-gutters { margin-right: -20px; margin-left: -20px; }
    .fx-row.fx-gutters > .fx-col { padding-right: 20px; padding-left: 20px; }
}

/* Отступы (аналоги mb-2 / mb-3 / mb-4 / mt-1 / mt-2 / mt-3 / mt-4 / mt-5).
   ВАЖНО: style.min.css переопределяет bootstrap .mt-5 -> 2rem !important, поэтому fx-mt-5 = 2rem, а не 3rem */
.fx-mb-2 { margin-bottom: .5rem !important; }
.fx-mb-3 { margin-bottom: 1rem !important; }
.fx-mb-4 { margin-bottom: 1.5rem !important; }
.fx-mt-1 { margin-top: .25rem !important; }
.fx-mt-2 { margin-top: .5rem !important; }
.fx-mt-3 { margin-top: 1rem !important; }
.fx-mt-4 { margin-top: 1.5rem !important; }
.fx-mt-5 { margin-top: 2rem !important; }

/* ==========================================================================
   Порты кастомных правил из style.min.css, завязанных на старые классы
   ========================================================================== */

/* main2: в оригинале <style>-элемент между header и section ломал селектор
   header+section, поэтому margin-top:125px/93px из style.min.css НЕ применялся.
   После выноса <style> в файл сохраняем исходное поведение: на десктопе герой
   под шапкой (margin 0), на мобильном — 70px (правило из вынесенного блока). */
section.s-main-screen.fx-hero {
    margin-top: 0 !important;
}
@media (max-width: 769px) {
    section.s-main-screen.fx-hero {
        margin-top: 70px !important;
    }
}

/* .seo .row>* div { padding: 1rem } */
.seo .fx-row > * div { padding: 1rem; }

/* .offer-month .p-params>.row и вложенные */
.offer-month .p-params > .fx-row { border: 1px solid var(--fox-black); }
.offer-month .p-params > .fx-row .fx-row > * { text-align: center; font-size: .7rem; border-left: 1px solid var(--fox-black); padding: .1rem; padding-top: .2rem; }
.offer-month .p-params > .fx-row .fx-row > :first-child { border-bottom: 1px solid var(--fox-black); }
.offer-month .fx-row .fx-row { height: 100%; }
.offer-month .p-params > .fx-row .fx-row > * { padding: .3rem; }

/* .info-block .col-lg-4.compilations>:last-child>... */
.info-block .fx-lg-4.compilations > :last-child > :first-child { width: 65%; }
.info-block .fx-lg-4.compilations > :last-child > :last-child { width: 35%; }

/* ==========================================================================
   Дополнения для шаблонов фильтров (new/filters/*)
   ========================================================================== */

/* ==========================================================================
   Bootstrap-essentials: порт минимально необходимых правил bootstrap 4
   (reboot + .container + .btn + компоненты), нужных после отключения
   bootstrap.min.css. Значения взяты из bootstrap.min.css проекта.
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3, h4, h5, h6 { margin-top: 0; margin-bottom: .5rem; font-family: inherit; font-weight: 500; line-height: 1.2; color: inherit; }
h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }
p { margin-top: 0; margin-bottom: 1rem; }
ul, ol, dl { margin-top: 0; margin-bottom: 1rem; }
label { display: inline-block; margin-bottom: .5rem; }
button { border-radius: 0; }
button:focus:not(:focus-visible) { outline: 0; }
input, button, select, optgroup, textarea { margin: 0; font-family: inherit; font-size: inherit; line-height: inherit; }
button, input { overflow: visible; }
button, select { text-transform: none; }
button, [type="button"], [type="reset"], [type="submit"] { -webkit-appearance: button; }
a { text-decoration: none; background-color: transparent; }
img { vertical-align: middle; border-style: none; }
svg { overflow: hidden; vertical-align: middle; }
b, strong { font-weight: bolder; }
sub, sup { position: relative; font-size: 75%; line-height: 0; vertical-align: baseline; }
sub { bottom: -.25em; }
sup { top: -.5em; }

/* Контейнер (кастомные max-width/padding из style.min.css перебивают) */
.container { width: 100%; padding-right: 15px; padding-left: 15px; margin-right: auto; margin-left: auto; }

/* Кнопки */
.btn { display: inline-block; font-weight: 400; text-align: center; white-space: nowrap; vertical-align: middle; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; border: 1px solid transparent; padding: .375rem .75rem; font-size: 1rem; line-height: 1.5; border-radius: .25rem; transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out; }
.btn:not(:disabled):not(.disabled) { cursor: pointer; }
.btn:disabled { opacity: .65; }

/* Навигация / табы / аккордеон */
.nav { display: flex; flex-wrap: wrap; padding-left: 0; margin-bottom: 0; list-style: none; }
.nav-link { display: block; padding: .5rem 1rem; }
.nav-pills .nav-link { border-radius: .25rem; }
.tab-content > .tab-pane { display: none; }
.tab-content > .active { display: block; }
.collapse:not(.show) { display: none; }
.collapsing { position: relative; height: 0; overflow: hidden; transition: height .35s ease; }
.fade { opacity: 0; transition: opacity .15s linear; }
.fade.show { opacity: 1; }

/* Выпадающие меню */
.dropdown, .dropleft, .dropright, .dropup { position: relative; }
.dropdown-menu { position: absolute; top: 100%; left: 0; z-index: 1000; display: none; float: left; min-width: 10rem; padding: .5rem 0; margin: .125rem 0 0; font-size: 1rem; color: #212529; text-align: left; list-style: none; background-color: #fff; background-clip: padding-box; border: 1px solid rgba(0,0,0,.15); border-radius: .25rem; }
.dropdown-menu.show { display: block; }
.dropdown-item { display: block; width: 100%; padding: .25rem 1.5rem; clear: both; font-weight: 400; color: #212529; text-align: inherit; white-space: nowrap; background-color: transparent; border: 0; }
.dropdown-toggle::after { display: inline-block; margin-left: .255em; vertical-align: .255em; content: ""; border-top: .3em solid; border-right: .3em solid transparent; border-bottom: 0; border-left: .3em solid transparent; }
.dropdown-toggle:empty::after { margin-left: 0; }

/* Модальные окна */
.modal-open { overflow: hidden; }
.modal { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1050; display: none; overflow: hidden; outline: 0; }
.modal-open .modal { overflow-x: hidden; overflow-y: auto; }
.modal-dialog { position: relative; width: auto; margin: .5rem; pointer-events: none; }
.modal.fade .modal-dialog { transition: transform .3s ease-out; transform: translate(0,-25%); }
.modal.show .modal-dialog { transform: none; }
.modal-content { position: relative; display: flex; flex-direction: column; width: 100%; pointer-events: auto; background-color: #fff; background-clip: padding-box; border: 1px solid rgba(0,0,0,.2); border-radius: .3rem; outline: 0; }
.modal-backdrop { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1040; background-color: #000; }
.modal-backdrop.fade { opacity: 0; }
.modal-backdrop.show { opacity: .5; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 1rem; border-bottom: 1px solid #dee2e6; border-top-left-radius: .3rem; border-top-right-radius: .3rem; }
.modal-body { position: relative; flex: 1 1 auto; padding: 1rem; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; padding: 1rem; border-top: 1px solid #dee2e6; }
.close { float: right; font-size: 1.5rem; font-weight: 700; line-height: 1; color: #000; text-shadow: 0 1px 0 #fff; opacity: .5; }
button.close { padding: 0; background-color: transparent; border: 0; -webkit-appearance: none; -moz-appearance: none; appearance: none; }
@media (min-width: 576px) {
    .modal-dialog { max-width: 500px; margin: 1.75rem auto; }
}

/* Пагинация */
.pagination { display: flex; padding-left: 0; list-style: none; border-radius: .25rem; }
.page-link { position: relative; display: block; padding: .5rem .75rem; margin-left: -1px; line-height: 1.25; color: #007bff; background-color: #fff; border: 1px solid #dee2e6; }
.page-item:first-child .page-link { margin-left: 0; border-top-left-radius: .25rem; border-bottom-left-radius: .25rem; }
.page-item:last-child .page-link { border-top-right-radius: .25rem; border-bottom-right-radius: .25rem; }
.page-item.active .page-link { z-index: 1; color: #fff; background-color: #007bff; border-color: #007bff; }
.page-item.disabled .page-link { color: #6c757d; pointer-events: none; cursor: auto; background-color: #fff; border-color: #dee2e6; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; clip-path: inset(50%); border: 0; }

/* Карточки / аккордеон (FAQ) */
.card { position: relative; display: flex; flex-direction: column; min-width: 0; word-wrap: break-word; background-color: #fff; background-clip: border-box; border: 1px solid rgba(0,0,0,.125); border-radius: .25rem; }
.card-body { flex: 1 1 auto; padding: 1.25rem; }
.card-header { padding: .75rem 1.25rem; margin-bottom: 0; background-color: rgba(0,0,0,.03); border-bottom: 1px solid rgba(0,0,0,.125); }
.card-header:first-child { border-radius: calc(.25rem - 1px) calc(.25rem - 1px) 0 0; }
.accordion > .card { overflow: hidden; }
.accordion > .card:not(:first-of-type) .card-header:first-child { border-radius: 0; }
.accordion > .card:not(:first-of-type):not(:last-of-type) { border-bottom: 0; }
.accordion > .card:first-of-type { border-bottom: 0; border-bottom-right-radius: 0; border-bottom-left-radius: 0; }
.accordion > .card:last-of-type { border-top-left-radius: 0; border-top-right-radius: 0; }
.accordion > .card .card-header { margin-bottom: -1px; }

/* Смещения (аналоги offset-md-*) */
@media (min-width: 768px) {
    .fx-offset-md-2 { margin-left: 16.6667%; }
}

/* Порядок (аналоги order-1/2, order-md-1/2) */
.fx-order-1 { order: 1; }
.fx-order-2 { order: 2; }
.fx-order-3 { order: 3; }
@media (min-width: 768px) {
    .fx-order-md-1 { order: 1; }
    .fx-order-md-2 { order: 2; }
    .fx-order-md-3 { order: 3; }
}
@media (min-width: 992px) {
    .fx-order-lg-1 { order: 1; }
    .fx-order-lg-2 { order: 2; }
}

/* Видимость: скрыт <768, flex ≥768 (аналог d-none d-md-flex) */
.fx-show-md-flex { display: none !important; }
@media (min-width: 768px) {
    .fx-show-md-flex { display: flex !important; }
}

/* Группа кнопок (аналог .btn-group) */
.fx-btn-group { position: relative; display: inline-flex; vertical-align: middle; }

/* Аналог .btn-group > .btn: кнопки — позиционированные родители для ::before-подчёркивания активной */
.fx-btn-group > .btn { position: relative; flex: 1 1 auto; }

/* Порты правил фильтров, завязанных на .row / .col-lg-2 */
.main-filter-frm .fx-row:first-child .jq-selectbox__select { border-bottom: 0; }
.main-filter-frm .filter-additional .fx-lg-2:not(.finishing) .jq-selectbox { float: left; width: 50%; }
@media (max-width: 768px) {
    .filter .main-filter-frm .fx-row:first-child .jq-selectbox__select { border-bottom: 1px solid var(--fox-black, #000); }
}

/* Конверсионный блок карточки объекта (макет Figma) */
.object-conversion{display:flex;gap:1rem;align-items:stretch}
.oc-card{background:#fff;border:1px solid #3d3d3d;padding:1rem;box-sizing:border-box}
.oc-price-card{flex:0 0 316px}
.oc-offer-card{flex:0 0 316px;display:flex;flex-direction:column;justify-content:center}
.oc-price-row{display:flex;justify-content:space-between;align-items:flex-start;gap:.5rem;margin-bottom:.5rem}
.oc-price-row .item-price{font-size:1.2rem;font-weight:700;color:#2e2e2e;padding:0;width:auto;line-height:1.4rem}
.oc-btn{display:block;width:100%;height:42px;line-height:42px;text-align:center;font-weight:700;font-size:.7rem;border:1px solid var(--fox-orange);cursor:pointer;margin-top:.5rem;box-sizing:border-box;text-transform:uppercase}
.oc-btn--solid{background:var(--fox-orange);color:#fff}
.oc-btn--solid:hover{color:#fff}
.oc-btn--light{background:#fff;color:#333}
.oc-btn:hover{opacity:.92;text-decoration:none}
.oc-expert{display:flex;gap:.6rem;margin-top:1rem;align-items:center}
.oc-expert-photo{width:78px;height:78px;border-radius:50%;object-fit:cover;flex:0 0 78px}
.oc-expert-name{font-weight:700;font-size:.85rem;color:#333;line-height:1rem}
.oc-expert-role{font-size:.7rem;color:#333;margin-top:.2rem}
.oc-expert-socials{display:flex;gap:.2rem;margin-top:.4rem}
.oc-social{display:inline-flex;align-items:center;justify-content:center;height:26px;padding:0 .5rem;font-size:.55rem;font-weight:700;color:#fff;box-sizing:border-box}
.oc-social--tg{background:#37a4ed}
.oc-social--wa{background:#22ca61}
.oc-social:hover{color:#fff;opacity:.92;text-decoration:none}
.oc-offer-title{font-weight:700;font-size:.95rem;color:#333;margin-bottom:.5rem}
.oc-offer-text{font-size:.65rem;line-height:.8rem;color:#333}
.oc-offer-card .oc-btn{max-width:276px;margin-top:1rem}
@media (max-width:992px){
  .object-conversion{flex-direction:column}
  .oc-price-card{flex:1 1 auto}
  .oc-offer-card .oc-btn{max-width:100%}
}
/* мобильный вариант блока */
.oc-mobile{flex-direction:column;gap:0;border:0;padding:0;margin-top:1rem}
.oc-mobile .oc-price-row{margin:0 0 .3rem}
.oc-mobile .oc-price-row .item-price{font-size:1.3rem}
.oc-mobile .oc-btn--big{height:60px;line-height:60px;font-size:1rem;margin-top:.5rem}
.oc-mobile .oc-expert{margin:1.2rem 0 .6rem}
.oc-mobile .oc-expert-photo{width:100px;height:100px;flex-basis:100px}
.oc-mobile .oc-expert-name{font-size:1.2rem}
.oc-mobile .oc-expert-role{font-size:1rem}
.oc-mobile .oc-expert-socials{display:flex;gap:.6rem;margin:0 0 1rem}
.oc-mobile .oc-social{height:41px;flex:1;font-size:.95rem}

/* Двухколоночный макет страницы объекта: контент + правый сайдбар */
.object-layout{display:flex;gap:1rem;align-items:flex-start}
.object-layout-main{flex:1;min-width:0}
.object-layout-side{flex:0 0 316px}
.object-layout-side .object-conversion{flex-direction:column;gap:.5rem;margin-top:1rem}
.object-layout-side .oc-price-card,.object-layout-side .oc-offer-card{flex:1 1 auto;width:100%;box-sizing:border-box}
@media (max-width:1200px){
  .object-layout{flex-direction:column}
  .object-layout-side{flex:1 1 auto;width:100%}
  .object-layout-side .object-conversion{flex-direction:row}
}
@media (max-width:992px){
  .object-layout-side .object-conversion{flex-direction:column}
}
/* Инфраструктура посёлка (Figma v2 без разбивки) */
.infra-block .seo-title h2{margin-bottom:2.5rem}
.infra-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:30px 50px}
.infra-item{display:flex;align-items:center;gap:10px;min-width:0}
.infra-item img{width:60px;height:60px;flex:0 0 60px}
.infra-label{font:400 .94rem/1.1rem Arial,sans-serif;color:#2e2e2e}
@media (max-width:1200px){
  .infra-grid{grid-template-columns:repeat(4,1fr)}
}
@media (max-width:992px){
  .infra-grid{grid-template-columns:repeat(3,1fr);gap:20px}
}
@media (max-width:768px){
  .infra-grid{grid-template-columns:repeat(2,1fr);gap:16px}
  .infra-item{flex-direction:column;justify-content:center;text-align:center;gap:10px}
}
