/* =========================================================
   ГЛОБАЛЬНЫЙ ФИЛЬТР (ДЕСКТОП И МОБИЛКИ)
   ========================================================= */

/* 1. УБИВАЕМ БЕЛЫЕ ДЫРЫ ПОД ВКЛАДКАМИ (ВЕЗДЕ, ВКЛЮЧАЯ ПК) */
.catalog-header .filter .tabs,
.catalog-header .filter ul#myTab,
.catalog-header .filter ul.nav-tabs {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    border-bottom: none !important;
}

.nav-tabs .nav-link {
    border: none !important;
    border-bottom: none !important;
    margin-bottom: 0 !important;
}

/* Выравниваем задний фон полей, чтобы не было белых просветов на десктопе */
.catalog-header .filter .fields {
    background-color: #1a1a1a !important; 
    margin-top: 0 !important;
}

/* Скрываем системный инпут */
.catalog-header .filter input[name="field_tip_nedvizhimosti_target_id"],
.catalog-header .filter input[hidden] {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
}

/* =========================================================
   МОБИЛЬНАЯ ВЕРСИЯ КАТАЛОГА И ФИЛЬТРА (ДО 767PX)
   ========================================================= */
@media (max-width: 767px) {
    
    /* 2. ДИЗАЙН ВКЛАДОК */
    #myTab .nav-link {
        background-color: rgb(120 100 65 / 84%) !important; /* Коричневый */
        color: #fff !important;
        border-radius: 5px 5px 0 0 !important;
        margin-right: 4px !important;
    }
    #myTab .nav-link.active,
    #myTab .nav-link[aria-selected="true"] {
        background-color: #1a1a1a !important; 
        font-weight: bold !important;
        opacity: 1 !important;
    }

    /* 3. СКЛЕЙКА ФИЛЬТРА */
    .catalog-header .filter .form-wrapper {
        display: flex !important;
        flex-direction: column !important;
    }
    .catalog-header .filter .fields,
    .catalog-header .filter .button-wrapper,
    .catalog-header .search-wrapper {
        background-color: #1a1a1a !important; 
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 15px !important;
        margin: 0 !important;
        display: block !important;
    }

    /* Идеальный нахлест полей на вкладки */
    .catalog-header .filter .fields {
        margin-top: -1px !important; 
    }

    /* Ширина инпутов */
    .catalog-header .filter .fields .form-item,
    .catalog-header .filter .fields .nice-select { 
        width: 100% !important; 
        max-width: 100% !important; 
        margin-bottom: 12px !important; 
    }

    /* Кнопка поиска */
    .catalog-header .filter .button-wrapper button.btn-primary {
        width: 100% !important;
        padding: 12px !important;
        background-color: #c4a162 !important; 
        border: 2px solid #fff !important; 
    }

    /* Скрываем сортировку */
    .form-item-sort-order,
    section.container-fluid.sort,
    body.path-catalog section.sort {
        display: none !important;
        height: 0 !important;
        margin: 0 !important;
    }

    /* ==============================================
       4. ИНДИВИДУАЛЬНО ДЛЯ /CATALOG
       ============================================== */
    body.path-catalog header.catalog-header:first-of-type,
    body.path-catalog header.catalog-header:has(.catalog-header-background) {
        position: relative !important;
        min-height: 380px !important; 
        display: block !important;
       /* background-color: #1a1a1a !important;*/
        padding: 0 !important;
    }
    
    body.path-catalog .catalog-header-background {
        position: absolute !important;
        top: 0 !important; left: 0 !important; 
        width: 100% !important; height: 100% !important;
        background-size: cover !important;
        background-position: center !important;
        z-index: 1 !important;
    }

    body.path-catalog .catalog-header .headline {
        position: relative !important;
        z-index: 5 !important;
        padding-top: 50px !important;
        text-align: center !important;
        width: 100% !important;
    }
    body.path-catalog .catalog-header .headline h1 {
        color: #fff !important;
        text-shadow: 2px 2px 8px rgba(0,0,0,0.8) !important;
        font-size: 35px !important;
    }
    
    body.path-catalog header.catalog-header:nth-of-type(2),
    body.path-catalog header.catalog-header:has(.filter) {
        min-height: auto !important;
        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
    }

    /* Нахлест фильтра на море */
    body.path-catalog header.catalog-header .filter {
        margin-top: -46px !important;
        position: relative !important;
        z-index: 10 !important;
    }

    /* Фикс белых дыр */
    body.path-catalog main#it-main-content,
    body.path-catalog main#it-main-content .views-element-container,
    body.path-catalog main#it-main-content .nav-filtr {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    body.path-catalog .it-local-tasks_wrapper,
    body.path-catalog .it-help__wrapper,
    body.path-catalog .it-notification__wrapper {
        display: none !important;
    }

    body.path-catalog .catalog {
        margin-top: 0 !important;
        padding-top: 15px !important; 
    }

    body.path-catalog .catalog .item.first {
        margin-top: 2px !important; 
        padding-top: 0 !important;
    }
}

/* =========================================================
   ФИКС ФУТЕРА: Отменяем влияние стилей фильтра на блок подписки
   ========================================================= */
.site-footer header.catalog-header,
.site-footer .catalog-header {
    background-color: transparent !important;
    min-height: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    display: block !important;
}

/* =====================================================
   ФИКС ФУТЕРА: Отменяем влияние стилей фильтра на блок подписки
   ===================================================== */
@media (max-width: 767px) {
  .site-footer header.catalog-header,
  .site-footer .catalog-header {
    background-color: transparent !important;
    min-height: unset !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    display: block !important;
  }
}

/* =====================================================
   ФИКС ФУТЕРА: черный блок в футере в форме
   ===================================================== */
@media (max-width: 767px) {
  footer.site-footer .subscribe form,
  footer.site-footer div.subscribe {
    background-color: transparent !important;
    background-image: none !important;
  }
}

/* Скрываем заголовки над селектами в фильтре каталога */
.catalog-header .filter .select-wrapper label {
    display: none !important;
}
/* высота блока поиска в фильтре каталога */
header.header .filter .search {
    display: block;
    padding: 34px 62px 30px 30px !important;
    border-left: 1px solid #707070;
    background-color: rgba(0, 0, 0, .8);
}

/* высота кнопки поиска в фильтре каталога */
.item.button-wrapper {
    padding-bottom: 7px;
}