/* Стили для формы главного блока на тестовой странице */

#hero-form {
  background: transparent;
  padding: 0;
  overflow: visible;
}

/* Убедимся, что родительские контейнеры не обрезают выпадающий список */
.header-btn {
  overflow: visible !important;
  position: relative;
  z-index: auto;
}

/* Контейнеры формы не должны создавать новый контекст наложения */
.header-btn .row,
.header-btn .col-xl-7,
.header-btn .container {
  overflow: visible !important;
}

#hero-form .form-group {
  margin-bottom: 15px;
  display: block;
  width: 100%;
  clear: both;
  overflow: visible !important;
  position: relative;
}

/* Form-group с select для времени должен иметь z-index для выпадающего списка */
#hero-form .form-group:has(#hero_time) {
  position: relative;
  z-index: 90 !important;
}

#hero-form .form-group > label:empty:not([style*="display: block"]) {
  display: none;
}

#hero-form .form-control {
  border-radius: 8px;
  border: 1px solid #e1e1e1;
  padding: 12px 15px;
  font-size: 14px;
  transition: all 0.3s ease;
  height: 48px;
  line-height: 1.5;
}

#hero-form .form-control:focus {
  border-color: #232d6b;
  outline: none;
  box-shadow: 0 0 0 3px rgba(35, 45, 107, 0.1);
}

#hero-form select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 12px;
  padding-right: 40px;
  color: #6a6a6a;
}

#hero-form select.form-control option {
  color: #333;
}

#hero-form select.form-control option[value=""] {
  color: #6a6a6a;
}

/* Стили для nice-select в форме */
#hero-form .nice-select {
  width: 100%;
  height: auto;
  min-height: 48px;
  line-height: 48px;
  padding: 0 40px 0 15px;
  border-radius: 8px;
  border: 1px solid #e1e1e1;
  background-color: #fff;
  position: relative;
  z-index: 1;
}

/* Nice-select с временем должен иметь высокий z-index когда открыт */
#hero-form #hero_time + .nice-select.open,
#hero-form #hero_time.nice-select.open {
  z-index: 95 !important;
}

#hero-form select.form-control,
#hero-form .nice-select {
  min-height: 48px;
  height: 48px;
  line-height: 48px;
  padding-top: 0;
  padding-bottom: 0;
}

#hero-form .nice-select .current {
  display: block;
  line-height: 15px;
  padding: 0;
  margin: 0;
  color: #6a6a6a;
  font-size: 14px;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  height: 48px;
}

#hero-form .nice-select:after {
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
}

/* Выпадающий список должен быть поверх секции #courses и кнопки, но ниже хедера (хедер z-index: 99) */
#hero-form .nice-select.open {
  z-index: 95 !important;
}

#hero-form .nice-select .list {
  z-index: 90 !important;
  position: absolute !important;
  max-height: none !important;
  overflow: visible !important;
}

/* Контейнеры внутри banner-area не должны обрезать выпадающий список */
.banner-area .container,
.banner-area .row,
.banner-area .banner-wrapper,
.banner-area .banner-inner {
  overflow: visible !important;
}

/* Секция после hero блока не должна перекрывать выпадающий список */
section#courses.destination-section {
  position: relative;
  z-index: 0 !important;
  overflow: visible !important;
}

/* Кнопка в форме должна быть ниже выпадающего списка */
#hero-form #hero_submit {
  position: relative;
  z-index: 1;
}

/* Form-group с select времени должен иметь правильный z-index */
#hero-form .form-group:has(#hero_time) {
  position: relative;
  z-index: 90;
}

#hero-form .subjects-checkboxes {
  background: #f8f9fa;
  padding: 15px 15px 15px 30px;
  border-radius: 8px;
  border: 1px solid #e1e1e1;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 15px;
  align-items: start;
}

#hero-form .form-check {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  padding: 5px 0;
  width: 100%;
  box-sizing: border-box;
  min-height: 24px;
}

#hero-form .no-subjects-message {
  grid-column: 1 / -1;
  text-align: center;
  padding: 20px;
  color: #666;
  font-style: italic;
  font-size: 14px;
}

#hero-form .subject-item {
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#hero-form .subject-item[style*="display: none"] {
  display: none !important;
}

#hero-form .form-check:last-child {
  margin-bottom: 0;
}

#hero-form .form-check-input {
  width: 18px;
  height: 18px;
  margin-right: 10px;
  margin-top: 0;
  cursor: pointer;
  flex-shrink: 0;
  border: 2px solid #ced4da;
  border-radius: 4px;
}

#hero-form .form-check-input:checked {
  background-color: #232d6b;
  border-color: #232d6b;
}

#hero-form .form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(35, 45, 107, 0.1);
}

#hero-form .form-check-label {
  margin-bottom: 0;
  cursor: pointer;
  font-weight: 400;
  font-size: 14px;
  color: #333;
  line-height: 1.4;
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

#hero-form .form-check-label:hover {
  color: #232d6b;
}

#hero-form .form-group label[style*="display: block"],
#hero-form label[style*="display: block"] {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  margin-bottom: 10px;
  display: block !important;
  visibility: visible !important;
}

/* Отступ сверху для label "Выберите предмет" */
#hero-form .form-group.mb-3 > label[style*="display: block"] {
  padding-top: 20px;
}

#hero-form #hero_submit {
  margin-top: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

#hero-form .privacy-policy {
  margin-top: 12px;
  line-height: 1.5;
  text-align: center;
  display: block;
  width: 100%;
}

#hero-form .privacy-policy a {
  color: #232d6b;
  text-decoration: underline;
  display: inline;
}

#hero-form .privacy-policy a:hover {
  text-decoration: none;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
  #hero-form .subjects-checkboxes {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  #hero-form .form-control {
    font-size: 16px; /* Предотвращает зум на iOS */
  }
}

/* Улучшение для планшетов */
@media (min-width: 769px) and (max-width: 1024px) {
  #hero-form .subjects-checkboxes {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}
