/* --------------------------------------------  */
/* --- Основное содержимое --- */
/* --------------------------------------------  */


.catalog-container {
    display: flex;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto 20px;
    padding: 0 10px 0;
}

@media (max-width: 992px) {
    .catalog-container {
        flex-direction: column;
    }
}

.content {
    flex: 1;
}



.no-results {
    text-align: center;
    grid-column: 1 / -1;
    padding: 50px;
    font-size: 1.2rem;
    color: #666;
    min-height: 50vh;
}

.no-results a {
    color: var(--secondary-color);
    text-decoration: none;
}


/* --------------------------------------------  */
/* --- Боковое меню --- */
/* --------------------------------------------  */


.sidebar {
    width: 220px;
    background: #f8f8f8;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 10px;
    /*position: sticky;*/
    position: static;
    top: 100px;
    height: fit-content;
}


.filter-title {
    font-size: 1.5rem;
    margin-bottom: 10px;
    text-align: center;
    text-transform: uppercase;
    color: var(--secondary-color);
}

.filters {
    list-style: none;
    padding: 0;
    text-transform: uppercase;
    align-items: center;
    text-align: center;
}

.filters li {
    margin-bottom: 5px;
}

.filters a {
    display: block;
    padding: 10px;
    text-decoration: none;
    color: #333;
    transition: background-color 0.3s ease;
    font-size: 14px;
    font-weight: bold;
}

.filters a:hover,
.filters a.active {
    background-color: #d9cbbf;
}

.search-container {
    margin-bottom: 20px;
}

@media (max-width: 992px) {
    .search-container {
    margin-bottom: 5px;
}
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.search-input-wrapper {
    position: relative;
    flex-grow: 1;
}

.search-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.search-button {
    display: flex;
    flex-direction: row;
    border: none;
    cursor: pointer;
    padding: 10px;
    background: #b37f60;
    color: #fff;
    border-radius: 4px;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.search-button:hover {
    background: #a06e52;
}

.clear-search-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.clear-search-icon:hover {
    opacity: 1;
}

.search-button:hover {
    background-color: #9b6b50;
    /* Темнее secondary-color для hover */
}

.filters-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-dropdown {
    width: 100%;
}

.filter-toggle {
    width: 100%;
    text-align: left;
    padding: 10px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
}

.filter-options {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-top: 5px;
}

.filter-options.active {
    display: flex;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

.color-badge {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.color-preview {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 1px solid #ccc;
    border-radius: 2px;
    margin-right: 8px;
    vertical-align: middle;
    flex-shrink: 0;
    box-sizing: border-box;
    /* Если hex_code пустой или недействительный, показываем серый квадрат по умолчанию */
    background-color: #f0f0f0;
}

.sort-container {
    margin-bottom: 5px;
}

.sort-label {
    font-size: 14px;
    margin-bottom: 5px;
}


.sort-select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.filter-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.apply-filters-btn {
    padding: 10px;
    background: #b37f60;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
}


.apply-filters-btn.reset {
    background: #ad978a;
}

.apply-filters-btn:hover {
    background: #a06e52;
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
    }

    .filters {
        display: none;
    }

    .mobile-category-menu {
        display: block;
        overflow-x: auto;
        margin-bottom: 5px;
    }

    .mobile-category-menu-items {
        display: flex;
        gap: 10px;
        white-space: nowrap;
    }

    .mobile-category {
        padding: 8px 16px;
        border: 1px solid #ccc;
        border-radius: 4px;
        text-decoration: none;
        color: #1D1D1B;
    }

    .mobile-category.active {
        background: #007bff;
        color: #fff;
    }
}

/* --- Горизонтальное меню для мобильных --- */
.mobile-category-menu-items {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    overflow-x: auto;
    padding: 10px 0;
    -webkit-overflow-scrolling: touch;
}

.mobile-category {
    flex-shrink: 0;
    padding: 8px 16px;
    font-size: 14px;
    text-decoration: none;
    color: #333;
    background-color: #f0f0f0;
    border-radius: 20px;
    margin: 0 6px;
    transition: background-color 0.3s ease, color 0.3s ease;
    white-space: nowrap;
}

.mobile-category:hover,
.mobile-category.active {
    background-color: #d9cbbf;
    color: white;
}

@media (max-width: 992px) {
    .mobile-category-menu {
        display: block;
    }
}

@media (min-width: 992px) {
    .mobile-category-menu {
        display: none;
    }
}

@media (max-width: 992px) {
    .sidebar {
        width: 100%;
        position: static;
        padding: 5px 0;
        box-shadow: none;
    }

    .filters {
        display: none;
    }

    .filter-title {
        display: none;
    }
}


/*цвета для эппл */

#filterForm {
  color: #000000;
}

#filterForm .filter-dropdown {
  color: #000000;
    margin-bottom: 5px;
}

#filterForm .filter-option {
  color: #000000;
}

#filterForm .filter-toggle {
  color: #000000;
}

#filterForm .sort-select {
  color: #000000;
}

#filterForm ::placeholder {
  color: #666666;
  opacity: 1;
}

#filterForm :-ms-input-placeholder {
  color: #666666;
}

#filterForm ::-ms-input-placeholder {
  color: #666666;
}


/* --- Дропдаун для фильтров --- */

/*.filters-dropdown-container {*/
/*    position: relative;*/
/*    margin-bottom: 20px;*/
/*}*/

/*.filters-toggle-button {*/
/*    width: 100%;*/
/*    padding: 12px 16px;*/
/*    background-color: #f8f8f8;*/
/*    border: 1px solid #ccc;*/
/*    border-radius: 4px;*/
/*    cursor: pointer;*/
/*    display: flex;*/
/*    justify-content: space-between;*/
/*    align-items: center;*/
/*    font-size: 16px;*/
/*    font-weight: bold;*/
/*    color: #333;*/
/*    transition: all 0.3s ease;*/
/*}*/

/*.filters-toggle-button:hover {*/
/*    background-color: #e9e9e9;*/
/*    border-color: #999;*/
/*}*/

/*.filters-toggle-icon {*/
/*    transition: transform 0.3s ease;*/
/*}*/

/*.filters-toggle-button.active .filters-toggle-icon {*/
/*    transform: rotate(180deg);*/
/*}*/

/*.filters-dropdown-content {*/
/*    display: none;*/
/*    position: absolute;*/
/*    top: 100%;*/
/*    left: 0;*/
/*    width: 100%;*/
/*    background-color: #fff;*/
/*    border: 1px solid #ccc;*/
/*    border-top: none;*/
/*    border-radius: 0 0 4px 4px;*/
/*    box-shadow: 0 2px 5px rgba(0,0,0,0.1);*/
/*    z-index: 1000;*/
/*    max-height: 70vh; !* Ограничиваем высоту *!*/
/*    overflow-y: auto; !* Добавляем скролл при необходимости *!*/
/*}*/

/*.filters-dropdown-content.active {*/
/*    display: block;*/
/*}*/

/*!* Стили для формы внутри дропдауна *!*/
/*.filters-dropdown-content .filters-container {*/
/*    padding: 15px;*/
/*    border-radius: 0 0 4px 4px;*/
/*}*/

/*!* Адаптивность *!*/
/*@media (max-width: 768px) {*/
/*    .filters-dropdown-content {*/
/*        position: static;*/
/*        max-height: none;*/
/*    }*/
/*}*/

/* --- Аккордеон для фильтров --- */

.filters-dropdown-container {
    position: relative; /* Остается relative */
    margin-bottom: 20px;
    width: 100%; /* Убедимся, что ширина корректная */
    border: 1px solid #ccc;
    border-radius: 4px;
    overflow: hidden; /* Скрываем содержимое, когда оно скрыто */
}

@media (max-width: 992px) {
    .filters-dropdown-container {
    margin-bottom: 5px;
}
}

.filters-toggle-button {
    width: 100%;
    padding: 12px 16px;
    background-color: #f8f8f8; /* Цвет фона кнопки совпадает с sidebar */
    border: none; /* Убираем границу кнопки, граница у контейнера */
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    transition: background-color 0.3s ease;
    text-align: left; /* Выравнивание текста по левому краю */
}

.filters-toggle-button:hover {
    background-color: #e9e9e9;
}

.filters-toggle-icon {
    transition: transform 0.3s ease;
    /* transform-origin: center; */ /* Не обязательно, но можно добавить для плавности */
}

.filters-toggle-button.active .filters-toggle-icon {
    transform: rotate(180deg);
}

.filters-dropdown-content {
    /* Убираем position: absolute */
    display: none;
    width: 100%;
    /* background-color и border убираем, так как они у контейнера */
    /* border-radius тоже убираем */
    /* box-shadow тоже убираем для аккордеона */
    max-height: 0; /* Изначально высота 0 */
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out; /* Плавное изменение высоты и padding */
    /* padding: 0 15px; */ /* Начальный padding 0, добавим через JS или CSS при открытии */
}

.filters-dropdown-content.active {
    display: block;
    max-height: 1000px; /* Достаточно большое значение, чтобы вместить содержимое */
    /* padding: 15px; */ /* Добавляем padding при открытии */
    /* Можно также добавить transition-delay для плавности появления содержимого */
    overflow-y: auto;
}

/* Чтобы padding тоже плавно появлялся */
.filters-dropdown-content {
    padding: 0 15px;
}

.filters-dropdown-content.active {
    padding: 15px;
}

/* Стили для формы внутри аккордеона */
.filters-dropdown-content .filters-container {
    /* padding: 0; */ /* Убираем padding у формы, он у контента */
    /* border-radius: 0; */ /* Убираем, так как скругление у контейнера */
}

/* ... остальные стили для .filter-dropdown, .filter-toggle, .filter-options и т.д. остаются прежними ... */

/* Адаптивность */
@media (max-width: 992px) {
    .filters-dropdown-container {
        /* На мобильных можно оставить как есть или адаптировать */
    }
    .filters-dropdown-content {
        /* transition: max-height 0.5s ease-out; */ /* Можно увеличить время анимации на мобильных */
    }
}


/* --- Отдельная форма сортировки --- */

.standalone-sort-container {
    margin-bottom: 5px; /* Отступ снизу */
    position: relative; /* Для позиционирования стрелочки */
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #f8f8f8;
    padding: 12px 16px;
}

.standalone-sort-container .sort-label {
    font-size: 16px;
    margin-bottom: 5px; /* Отступ между меткой и селектом */
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    font-weight: bold;
    color: #333;
}

.sort-button-style {
    background: none; 
    border: none; 
    padding: 0; 
    text-align: left; 
    cursor: default;
}

.sort-icon-hidden {
    display: none;
}

.sort-form {
    /* Форма не должна добавлять лишнего отступа */
    margin: 0;
    padding: 0;
    border: none;
    background: none;
}

.sort-form .sort-select {
    width: 100%;
    padding: 8px 30px 8px 10px; /* Правый padding для кастомной стрелки */
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    /* Убираем стандартную стрелочку браузера */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: #fff;
    cursor: pointer;
}

.sort-form .sort-select:focus {
    border-color: #9b6b50;
    outline: none;
    box-shadow: 0 0 0 2px rgba(155, 107, 80, 0.2);
}

/* Создаем кастомную стрелочку для селекта в отдельной форме */
.standalone-sort-container {
    position: relative; /* Для позиционирования стрелочки */
}

.standalone-sort-container::after {
    content: "";
    position: absolute;
    top: 65%; /* Позиционируем по центру контейнера */
    right: 25px;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #666;
    pointer-events: none;
    z-index: 0;
}

.sort-form .sort-select:hover {
    border-color: #999;
}

/* Адаптивность */
@media (max-width: 768px) {
    .standalone-sort-container {
        padding: 8px 12px;
        margin-bottom: 5px;
    }
    .standalone-sort-container .sort-label {
        font-size: 14px;
    }
    .sort-form .sort-select {
        padding: 6px 25px 6px 8px;
        font-size: 13px;
    }
}


/*скролл фильтров*/

.filters-dropdown-content::-webkit-scrollbar {
    width: 8px; /* Ширина вертикального скроллбара */
}

.filters-dropdown-content::-webkit-scrollbar-track {
    background: #f1f1f1; /* Цвет трека */
    border-radius: 4px;
}

.filters-dropdown-content::-webkit-scrollbar-thumb {
    background: #b37f60; /* Цвет "бегунка" */
    border-radius: 4px;
}

.filters-dropdown-content::-webkit-scrollbar-thumb:hover {
    background: #9b6b50; /* Цвет "бегунка" при наведении */
}

/* Для Firefox */
.filters-dropdown-content {
    scrollbar-width: thin;
    scrollbar-color: #b37f60 #f1f1f1;
}
