/* Боковая панель с фильтрами */
.side-filters {
  width: 240px; /* Сделать уже */
  background: linear-gradient(145deg, #e6e6e6, #ffffff);
  box-shadow: 3px 3px 6px rgba(190, 190, 190, 0.8),
    -3px -3px 6px rgba(255, 255, 255, 0.8);
  padding: 15px; /* Уменьшение отступов */
  border-radius: 8px;
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px; /* Уменьшение промежутка между элементами */
}

/* Заголовок фильтров */
.side-filters h3 {
  font-size: 16px; /* Уменьшение шрифта заголовка */
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
}

/* Метки фильтров */
.side-filters label {
  font-size: 13px; /* Уменьшение шрифта меток */
  font-weight: 600;
  margin-bottom: 5px;
  display: block;
  color: #555;
}

/* Поля выбора в фильтрах */
.side-filters select {
  width: 100%;
  padding: 8px; /* Уменьшение внутреннего отступа */
  font-size: 13px; /* Уменьшение шрифта в выпадающих списках */
  border-radius: 5px;
  border: 1px solid #ddd;
  margin-bottom: 8px; /* Уменьшение промежутка между фильтрами */
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  background: #f9f9f9;
  cursor: pointer;
}

.side-filters select:focus {
  border-color: #007bff;
  outline: none;
  box-shadow: 0 0 6px rgba(0, 123, 255, 0.3);
}

input {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 8px;

  box-sizing: border-box;
  transition: border-color 0.3s ease;
}

input:focus {
  border-color: #007bff;
  outline: none;
}

/* Модальное окно для фильтров */
#filtersModal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

#filtersModal.active {
  display: flex;
}

#filtersModal .modal-content {
  background: white;
  padding: 20px;
  border-radius: 8px;
  width: 100%;
  max-width: 400px;
}

#filtersModal .modal-content select,
#filtersModal .modal-content input,
#filtersModal .modal-content button {
  width: 100%;
  margin-bottom: 10px;
}

@media (max-width: 1024px) {
  /* Скрытие боковой панели с фильтрами на мобильных устройствах */
  .side-filters {
    display: none;
  }

  /* Добавить поле для поиска на мобильных устройствах */
  #mobileSearchQuery {
    width: 100%;
    padding: 8px;
    font-size: 14px;
    border-radius: 5px;
    border: 1px solid #ddd;
    margin: 5px;
    background: #fff;
  }
}

/* Новый стиль для кнопки "Задать вопрос" (теперь как кнопка) */
.question-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  font-size: 16px;
  font-weight: bold;
  border-radius: 8px;
  text-decoration: none;
  background: linear-gradient(145deg, #4d8bf0, #133670);
  color: white;
  border: none;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}

.question-button:hover {
  transform: scale(1.05);
}

.question-button i {
  margin-right: 8px; /* Добавляет отступ справа от иконки */
}

/* Новый стиль для "Сбросить фильтры" (теперь как ссылка) */
#resetFiltersBtn {
  background: none;
  border: none;
  color: #133670;
  font-size: 16px;
  cursor: pointer;
  text-decoration: none;
  padding: 0;
}

#resetFiltersBtn:hover {
  color: #0056b3;
}

.modal-content {
  position: relative;
  max-width: 90vw;
  margin: auto;
  background: white;
  padding: 20px;
  border-radius: 10px;
  overflow: auto;
  box-sizing: border-box;
}

.close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  color: #999;
}

.close:hover {
  color: black;
}

/* Стиль для заголовка в модальном окне */
.modal-content h3 {
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: #333;
}

/* Стиль для контейнера с переключателями (селектами) */
.modal-content select {
  width: 100%;
  padding: 10px;
  margin: 10px 0;
  border: 1px solid #ccc;
  border-radius: 5px;
  background-color: #f9f9f9;
  font-size: 1rem;
  color: #333;
}

/* Стиль для кнопок в модальном окне */
.modal-content button {
  background-color: #007bff;
  color: #fff;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 20px;
}

/* Стилизация кнопки применения фильтров */
#applyFiltersBtn {
  background: linear-gradient(145deg, #4d8bf0, #133670); /* Убираем фон */
}

#applyFiltersBtn:hover {
  background: linear-gradient(145deg, #133670 #4d8bf0); /* Убираем фон */
}

/* Стиль для текста внутри textarea */
.modal-content textarea {
  width: 100%;
  height: 100px;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 1rem;
  color: #333;
  resize: none;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: #888;
  z-index: 10;
}

.modal-close svg {
  pointer-events: none;
  width: 22px;
  height: 22px;
}

.modal-close:hover {
  color: #000;
}
#resetFiltersBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 15px;
  color: #133670;
  text-decoration: none;
  margin: 10px auto 0;
  cursor: pointer;
}

#resetFiltersBtn:hover {
  color: #0056b3;
}

.modal-content #resetFiltersBtn {
  display: flex;
  justify-content: center;
}
#resetFiltersMobileBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 15px;
  color: #133670;
  text-decoration: none;
  cursor: pointer;
  margin: 15px auto 0;
}

#resetFiltersMobileBtn:hover {
  color: #0056b3;
}

.modal-content #resetFiltersMobileBtn {
  display: flex;
  justify-content: center;
  text-align: center;
}

#resetFiltersFloatingBtn {
  display: block;
  margin: 16px auto;
  padding: 8px 20px;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  color: #fff;
  background: linear-gradient(145deg, #4d8bf0, #133670);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
  text-align: center;
  width: fit-content;
  min-width: 160px;
}

#resetFiltersFloatingBtn i {
  margin-right: 8px;
  font-size: 14px;
}

#resetFiltersFloatingBtn:hover {
  background: linear-gradient(145deg, #3f7bd1, #133670);
  transform: translateY(-2px);
}

.mobile-ask-btn {
  display: none;
  margin: 16px auto 12px auto;
  padding: 12px 24px;
  background: linear-gradient(145deg, #3f7bd1, #133670);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.13);
  width: max-content;
  min-width: 60%;
  max-width: 94%;
  text-align: center;
  justify-content: center;
}
.mobile-ask-btn i {
  margin-right: 8px;
  font-size: 16px;
}
@media (max-width: 768px) {
  .mobile-ask-btn {
    display: block;
  }
}
@media (min-width: 769px) {
  .mobile-ask-btn {
    display: none !important;
  }
}
@media (max-width: 1024px) {
  .mobile-ask-btn {
    display: block !important;
  }
}

@media (min-width: 1025px) {
  .mobile-ask-btn {
    display: none !important;
  }
}
.mobile-ask-btn {
  width: auto;
  padding: 12px 24px;
  min-width: 160px;
  max-width: 320px;
  display: block;
  margin: 16px auto 12px auto;
}

@media (max-width: 1024px) {
  .mobile-ask-btn.fixed {
    position: fixed;
    bottom: 0px;
    margin-bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-ask-btn.hidden {
    transform: translateX(-50%) translateY(100px);
    opacity: 0;
    pointer-events: none;
  }

  .questions-header-combined {
    margin: 16px auto;
  }

  .questions-header-combined .questions-title {
    font-size: 20px;
    font-weight: 700;
    color: #0f2a5a;
    margin-bottom: 8px;
    text-align: center;
  }

  .questions-header-combined .questions-subtitle {
    font-size: 14px;
    color: #333;
    margin-bottom: 16px;
    text-align: center;
  }

  .questions-search-block {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 8px;
    width: 100%;
    flex-wrap: nowrap;
  }

  .questions-search-block .search-wrapper {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    background: #f5f7fa;
    border-radius: 10px;
    padding: 0 12px;
    height: 42px;
    border: 1px solid #ccd1d9;
  }

  .questions-search-block .search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    color: #333;
    min-width: 0;
  }
}

@media (max-width: 1024px) {
  .mobile-blur-overlay {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 72px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    background: rgba(255, 255, 255, 0.05);
    z-index: 999;
  }

  .mobile-ask-btn.fixed {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 90vw;
    padding: 16px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(145deg, #3f7bd1, #133670);
    color: white;
    font-weight: 600;
    font-size: 15px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  }

  .mobile-ask-btn.fixed i {
    margin-right: 8px;
  }
}

@media (min-width: 1025px) {
  .mobile-only {
    display: none !important;
  }
}

@media (min-width: 1025px) {
  .mobile-only {
    display: none !important;
  }
}
/* Чёткий стиль для мобильного поиска и фильтра */
@media (max-width: 1024px) {
  .mobile-search-wrapper {
    padding: 10px 16px;
    margin: 12px auto;
    max-width: 480px;
    display: flex;
    justify-content: center;
  }

  .mobile-search-field {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(19, 54, 112, 0.15);
    padding: 6px 8px;
    border: none;
  }

  .mobile-search-field input#mobileSearchQuery {
    width: 100%;
    border: none;
    outline: none;
    font-size: 15px;
    color: #133670;
    background: transparent;
    padding: 8px 8px;
    box-shadow: none;
  }

  .mobile-search-field input#mobileSearchQuery::placeholder {
    color: #8a9eba;
  }

  button#mobileFiltersBtn {
    flex: none;
    background: transparent;
    border: none;
    color: #133670;
    cursor: pointer;
    font-size: 25px;
    padding: 0px 10px; /* Минимальный отступ */
    margin-left: 0; /* Отступ полностью убран */
    transition: color 0.3s ease;
  }

  button#mobileFiltersBtn:hover {
    color: #4d8bf0;
  }
}
@media (max-width: 768px) {
  .questions-header-combined .questions-title {
    font-size: 20px !important; /* было 20px */
  }

  .questions-header-combined .questions-subtitle {
    font-size: 14px !important; /* было 14px */
  }

  .side-filters h3 {
    font-size: 17px !important; /* повысим для лучшей читабельности */
  }

  .side-filters label,
  .side-filters select {
    font-size: 15px !important; /* из 13px → 15px */
  }

  .modal-content h3 {
    font-size: 18px !important; /* из ~24px → 18px для баланса */
  }

  .modal-content select,
  .modal-content textarea,
  .modal-content button {
    font-size: 15px !important;
  }

  .question-button,
  #resetFiltersBtn,
  #resetFiltersMobileBtn {
    font-size: 15px !important;
  }
}
.mobile-search-wrapper {
  padding: 0; /* Убираем отступы у родительского контейнера */
  margin: 0;
}
/* Стили для полей выбора фильтров внутри модального окна */
#filtersModal select {
  width: 100%; /* Заполняет всю ширину */
  padding: 6px 10px; /* Уменьшаем внутренние отступы */
  margin: 6px 0; /* Уменьшаем отступы между фильтрами */
  font-size: 14px; /* Меньше шрифт */
  border-radius: 8px; /* Закругленные углы */
  border: 1px solid #ddd; /* Цвет рамки */
  background-color: #f9f9f9; /* Цвет фона */
  box-sizing: border-box; /* Чтобы padding не увеличивал размер элемента */
}

/* Стили для меток фильтров */
#filtersModal label {
  font-size: 14px; /* Меньше шрифт */
  font-weight: normal;
  margin-bottom: 4px; /* Уменьшаем отступы между меткой и полем */
  display: block;
  color: #333;
}
/* Обновленный контейнер поиска */
.mobile-search-wrapper {
  display: flex;
  justify-content: center; /* Центрируем содержимое */
  width: 100%;
  padding: 0 10px; /* Убираем лишние отступы */
  box-sizing: border-box;
  margin: 0 auto; /* Центрируем контейнер */
}

/* Поле поиска */
.mobile-search-field {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 500px; /* Максимальная ширина */
  border-radius: 10px;
  padding: 6px 12px;
  margin-bottom: 20px;
  box-sizing: border-box;
}
/* Для мобильных устройств до 768px, кнопка "Задать вопрос" будет занимать 90% ширины */
@media (max-width: 768px) {
  .mobile-ask-btn {
    position: fixed; /* Оставляем фиксированное позиционирование */
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 90vw !important; /* Устанавливаем ширину на 90% от ширины экрана */
    padding: 12px 24px;
    min-width: 160px;
    max-width: 100%; /* Ограничиваем максимальную ширину */
    display: block;
    margin: 16px auto 12px auto;
    background: linear-gradient(145deg, #3f7bd1, #133670);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.13);
    text-align: center;
    justify-content: center;
  }

  .mobile-ask-btn i {
    margin-right: 8px;
    font-size: 16px;
  }
}

/* Для планшетов и устройств с шириной от 768px до 1024px, кнопка остается обычной */
@media (min-width: 768px) and (max-width: 1024px) {
  .mobile-ask-btn {
    width: auto !important; /* Убираем ограничение ширины для планшетов */
    padding: 12px 24px;
    min-width: 160px;
    max-width: 320px;
    display: block;
    margin: 16px auto 12px auto;
    background: linear-gradient(145deg, #3f7bd1, #133670);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.13);
    text-align: center;
    justify-content: center;
  }

  .mobile-ask-btn i {
    margin-right: 8px;
    font-size: 16px;
  }
}

/* Для устройств с шириной более 1024px (десктоп), кнопка остается с шириной по умолчанию */
@media (min-width: 1024px) {
  .mobile-ask-btn {
    width: auto !important; /* Стандартная ширина для десктопа */
    padding: 12px 24px;
    min-width: 160px;
    max-width: 320px;
    display: block;
    margin: 16px auto 12px auto;
    background: linear-gradient(145deg, #3f7bd1, #133670);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.13);
    text-align: center;
    justify-content: center;
  }

  .mobile-ask-btn i {
    margin-right: 8px;
    font-size: 16px;
  }
}
/* === Langard: боковая панель фильтров в фирменном стиле === */
.side-filters {
  --accent: var(--q-accent, #133670);
  --accent2: var(--q-accent-2, #4d8bf0);
  --border: var(--q-border, rgba(13, 16, 40, 0.08));

  width: 240px;
  background: linear-gradient(180deg, #ffffff, #f7f7fb);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 6px 16px rgba(6, 12, 38, 0.08);
  padding: 16px;
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Заголовок */
.side-filters h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 800;
  color: var(--accent); /* фирменный */
}

/* Метки */
.side-filters label {
  font-size: 13px;
  font-weight: 600;
  color: #5b6b95;
  margin-bottom: 6px;
  display: block;
}

/* Поля: селекты и инпуты — белые карточки с синим фокусом */
.side-filters select,
.side-filters input[type="text"],
.side-filters input[type="search"],
.side-filters input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  font-size: 13px;
  color: #0f1220;
  background: #fff;
  border: 1px solid rgba(13, 16, 40, 0.12);
  border-radius: 12px;
  box-shadow: 0 1px 0 rgba(6, 12, 38, 0.03);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
  appearance: none; /* ровнее на разных ОС */
}

/* Ховер/фокус */
.side-filters select:hover,
.side-filters input[type="text"]:hover,
.side-filters input[type="search"]:hover,
.side-filters input[type="number"]:hover {
  border-color: rgba(77, 139, 240, 0.45);
}
.side-filters select:focus,
.side-filters input[type="text"]:focus,
.side-filters input[type="search"]:focus,
.side-filters input[type="number"]:focus {
  border-color: var(--accent2);
  box-shadow: 0 0 0 3px rgba(77, 139, 240, 0.15);
}

/* Кнопка "Задать вопрос" — уже фирменная, просто добавим лёгкую тень */
.side-filters .question-button {
  background: linear-gradient(145deg, var(--accent2), var(--accent));
  box-shadow: 0 6px 16px rgba(77, 139, 240, 0.22);
  border-radius: 12px;
}
.side-filters .question-button:hover {
  transform: translateY(-1px);
}

/* Сброс фильтров — фирменная синяя ссылка */
#resetFiltersBtn,
#resetFiltersMobileBtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 14px;
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}
#resetFiltersBtn:hover,
#resetFiltersMobileBtn:hover {
  color: #0f2a5a; /* чуть темнее */
}

/* Модалка фильтров — те же акценты */
#filtersModal .modal-content {
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 10px 32px rgba(6, 12, 38, 0.18);
}
#filtersModal .modal-content select,
#filtersModal .modal-content input,
#filtersModal .modal-content textarea {
  border: 1px solid rgba(13, 16, 40, 0.12);
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
#filtersModal .modal-content select:focus,
#filtersModal .modal-content input:focus,
#filtersModal .modal-content textarea:focus {
  border-color: var(--accent2);
  box-shadow: 0 0 0 3px rgba(77, 139, 240, 0.15);
}
#applyFiltersBtn {
  background: linear-gradient(145deg, var(--accent2), var(--accent)) !important;
}

/* Скрыть боковую панель на мобильных — оставляем прежнюю логику */
@media (max-width: 1024px) {
  .side-filters {
    display: none;
  }
}
