/* Современная верстка секции поиска для market.php */

/* Поджимаем отступы контента только на страницах market.php */
/* Убираем отступы и фон у контейнера контента */
.market-page #main {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.market-page .main-gradient {
  display: none !important;
}

/* Гарантируем, что шапка всегда поверх формы поиска */
.market-page .masthead,
.market-page #phantom.masthead {
  z-index: 1000 !important;
}

/* Серая шапка */
.market-page .page-title {
  min-height: 48px !important;
  margin: 0 !important;
  padding: 4px 0 !important;
  display: flex !important;
  align-items: center !important;
  position: relative;
  z-index: 0;
}

.market-page .page-title .wf-wrap,
.market-page .page-title .wf-container-title,
.market-page .page-title .wf-table,
.market-page .page-title .wf-td {
  height: auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
}

.market-page .page-title .h3-size {
  margin: 0;
  text-align: left;
}

.market-page #content {
  margin-top: 0 !important;
  padding-top: 0 !important;
  position: relative;
  z-index: 1;
}

/* Секция поиска */
.market-page .market-search-section {
  max-width: 1200px;
  background: transparent;
  padding: 6px 0 10px 0;
  margin: 0 auto 10px;
}

.market-page .market-search-section * {
  pointer-events: auto;
}

.market-page .market-search-section h3 {
  margin: 4px 0 16px 0 !important;
  padding: 12px 20px !important;
  background-color: #f8f9fa;
  border-left: 4px solid #dc3545;
  border-radius: 4px;
  font-size: 16px;
  line-height: 1.6;
  color: #333;
  clear: both;
}

.market-page .market-search-section h3 a {
  color: #dc3545;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

.market-page .market-search-section h3 a:hover {
  color: #c82333;
  text-decoration: underline;
}

/* Сообщение об ошибке */
.market-page .market-search-error {
  margin: 6px 0 10px 0;
  padding: 10px 18px;
  background-color: #fff3cd;
  border: 1px solid #ffc107;
  border-left: 4px solid #ffc107;
  border-radius: 4px;
  color: #856404;
  display: block;
  clear: both;
  font-size: 14px;
  line-height: 1.5;
}

/* Подсказка о валидации */
.market-page .market-search-hint {
  font-size: 13px;
  color: #d32f2f;
  margin: 0 0 15px 0;
  padding: 8px 0;
  display: none;
  min-height: 22px;
  line-height: 1.4;
  clear: both;
  width: 100%;
  box-sizing: border-box;
}

.market-page .market-search-hint.show {
  display: block;
}

/* Контейнер форм поиска */
.market-page .market-search-forms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin: 15px 0 0;
}

/* Карточка формы поиска */
.market-page .market-search-card {
  background: #fafafa;
  border: 1px solid #ececec;
  border-radius: 12px;
  padding: 22px 24px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.market-page .market-search-card:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

/* Заголовок карточки */
.market-page .market-search-card-title {
  font-size: 13px;
  font-weight: 600;
  color: #444;
  margin: 0 0 8px 0;
  padding-bottom: 4px;
  border-bottom: 1px solid #f0f0f0;
}

/* Форма поиска */
.market-page .market-search-form {
  display: flex;
  flex-direction: row;
  gap: 12px;
  align-items: center;
  position: relative;
  z-index: 1;
}

/* Поле ввода */
.market-page .market-search-input {
  flex: 1;
  min-width: 0;
  padding: 9px 14px;
  font-size: 14px;
  border: 1px solid #d7d7d7;
  border-radius: 5px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  box-sizing: border-box;
  background-color: #fff;
}

.market-page .market-search-input:focus {
  outline: none;
  border-color: #dc3545;
  box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.1);
}

.market-page .market-search-input::placeholder {
  color: #999;
}

/* Кнопка поиска */
.market-page .market-search-button {
  flex-shrink: 0;
  min-width: 120px;
  margin-left: 8px;
  position: relative;
  z-index: 1;
}

/* Адаптивность для планшетов и десктопов - формы всегда в две колонки */
@media (min-width: 768px) {
  .market-page .market-search-card {
    flex: 1 1 calc(50% - 10px);
    min-width: 300px;
  }
}

/* Адаптивность для десктопов */
@media (min-width: 992px) {
  .market-page .market-search-section {
    margin-top: 10px !important;
    padding: 15px 0;
  }
  
  .market-page .market-search-forms {
    gap: 25px;
  }
  
  .market-page .market-search-card {
    flex: 1 1 calc(50% - 12.5px);
    padding: 25px;
  }
}

/* Мобильная версия */
@media (max-width: 767px) {
  .market-page .market-search-section {
    margin-top: 8px !important;
    padding: 12px 0;
  }
  
  .market-page .market-search-section h3 {
    margin: 10px 0 20px 0;
    padding: 12px 15px;
    font-size: 14px;
  }
  
  .market-page .market-search-forms {
    gap: 12px;
    margin-bottom: 15px;
    max-width: 100%;
    padding: 0 10px;
  }
  
  .market-page .market-search-card {
    flex: 1 1 100%;
    padding: 14px;
  }
  
  .market-page .market-search-card-title {
    font-size: 13px;
    margin-bottom: 10px;
  }
  
  .market-page .market-search-form {
    flex-direction: column;
    gap: 12px;
  }
  
  .market-page .market-search-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
  }
  
  .market-page .market-search-button {
    width: 100%;
    padding: 8px 18px;
    font-size: 14px;
  }
  
  .market-page .market-search-error {
    padding: 10px 15px;
    font-size: 13px;
    margin: 10px 0;
  }
  
  .market-page .market-search-hint {
    font-size: 12px;
    padding: 6px 0;
  }
}

/* Очень маленькие экраны */
@media (max-width: 480px) {
  .market-page .market-search-section {
    padding: 10px 0;
  }
  
  .market-page .market-search-section h3 {
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.5;
  }
  
  .market-page .market-search-card {
    padding: 12px;
  }
  
  .market-page .market-search-input {
    padding: 10px 12px;
  }
  
  .market-page .market-search-button {
    padding: 8px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }
}

