/*
 * tehaudumi.lv — форма «Получите лучшую цену» на главной (задача 02).
 *
 * Форма остаётся в странице, но по центру, компактнее и с заголовком по центру.
 * Крестик прячет форму, на её месте — оранжевая кнопка, которая открывает её снова.
 * Поиск под формой скрыт: поиск есть в шапке.
 *
 * Все правила ограничены .main-carousel-container (блок формы на главной), чтобы
 * не задеть форму «Консультация» и другие формы с теми же классами (.form-block,
 * .call-form). Правила main.css для этой формы написаны через .main-carousel,
 * которого сейчас нет в DOM (опечатка <style> в slideshow.twig от 30.09), поэтому
 * они не действуют и здесь не учитываются.
 */

/* Поиск под формой. */
.home-search {
  display: none !important;
}

.main-carousel-container .main-carousel__wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Кнопка открытия: видна только когда форма закрыта крестиком. */
.main-carousel-container .show-best-price-form {
  display: none;
}

.main-carousel-container .main-carousel__wrapper.tt-bp-closed .show-best-price-form {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  margin: 24px auto 8px;
  padding: 12px 32px;
  border: 0;
  border-radius: 10px;
  background: #ff5c00;
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(255, 92, 0, 0.25);
  transition: background-color 0.15s ease;
}

.main-carousel-container .main-carousel__wrapper.tt-bp-closed .show-best-price-form:hover,
.main-carousel-container .main-carousel__wrapper.tt-bp-closed .show-best-price-form:focus-visible {
  background: #e65300;
}

.main-carousel-container .main-carousel__wrapper.tt-bp-closed .best-price-form-wrapper {
  display: none !important;
}

/* Карточка формы.
   position/opacity/transform/z-index заданы явно: если опечатку в slideshow.twig
   исправят и вернётся .main-carousel, правила main.css превратят форму во всплывающее
   окно (opacity 0, fixed, scale 0) — эти значения держат её на месте. */
.main-carousel-container .best-price-form-wrapper {
  position: static;
  inset: auto;
  z-index: auto;
  box-sizing: border-box;
  width: 100%;
  max-width: 460px;
  margin: 24px auto 8px;
  padding: 24px 24px 22px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.06);
  opacity: 1;
  transform: none;
}

/* Три класса — чтобы перебить .main-carousel .best-price-form-wrapper .best-price-form
   (transform: scale(0)) из main.css, если тот снова начнёт действовать. */
.main-carousel-container .best-price-form-wrapper .best-price-form {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  gap: 0;
  background: none;
  box-shadow: none;
  transform: none;
}

/* Заголовок по центру; крестик вынесен абсолютом, чтобы не сдвигать центр. */
.main-carousel-container .best-price-form .form-block__title {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  margin: 0 0 18px;
  padding: 0 36px;
  text-align: center;
}

.main-carousel-container .best-price-form .form-block__title span {
  opacity: 1 !important;
  color: #1a1a1a;
  font-family: inherit;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
}

/* Крестик — в правом верхнем углу, по первой строке заголовка
   (длинный заголовок на мобилке переносится в две строки). */
.main-carousel-container .best-price-form .form-block__close {
  position: absolute;
  top: -3px;
  right: -10px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.main-carousel-container .best-price-form .form-block__close:hover,
.main-carousel-container .best-price-form .form-block__close:focus-visible {
  background: #f2f2f2;
  outline: none;
}

.main-carousel-container .best-price-form .form-block__close img {
  display: block;
  width: 14px;
  height: 14px;
}

/* Поля компактнее. Рамка — у обёртки .call-form__input, как в стилях сайта
   (в ней же живёт выбор страны у телефона), само поле без рамки.
   Блок загрузки файлов тоже .call-form__input, но сайт его прячет — не трогаем. */
.main-carousel-container .best-price-form .call-form__input:not(.call-form__input--fileuploader) {
  display: flex;
  align-items: stretch;
  min-height: 46px;
  margin: 0 0 10px;
  padding: 0;
  border: 1px solid #d9d9d9;
  border-radius: 10px;
  background: #fff;
  transition: border-color 0.15s ease;
}

.main-carousel-container .best-price-form .call-form__input:not(.call-form__input--fileuploader):focus-within {
  border-color: #ff5c00;
}

.main-carousel-container .best-price-form .call-form__input > input,
.main-carousel-container .best-price-form .call-form__input .iti > input {
  box-sizing: border-box;
  width: 100%;
  height: 44px;
  padding-block: 0;
  padding-inline: 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-size: 15px;
  outline: none;
}

.main-carousel-container .best-price-form .call-form__input .iti {
  width: 100%;
  padding-block: 0;
}

.main-carousel-container .best-price-form .call-form__input .iti__selected-country {
  height: 100%;
  border-radius: 9px 0 0 9px !important;
}

.main-carousel-container .best-price-form .call-form__input > textarea {
  box-sizing: border-box;
  width: 100%;
  height: 88px;
  min-height: 88px;
  padding: 12px 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-size: 15px;
  resize: vertical;
  outline: none;
}

.main-carousel-container .best-price-form .call-form__input input::placeholder,
.main-carousel-container .best-price-form .call-form__input textarea::placeholder {
  color: #8a8a8a;
  font-size: 15px;
}

.main-carousel-container .best-price-form .call-form__checkbox {
  gap: 10px;
  margin: 4px 0 16px;
  font-size: 13px;
  line-height: 1.35;
}

.main-carousel-container .best-price-form .call-form__checkbox > input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 0;
}

.main-carousel-container .best-price-form .call-form__button {
  width: 100%;
  min-height: 50px;
  margin: 0;
  padding-block: 13px;
  border-radius: 10px;
}

.main-carousel-container .best-price-form .call-form__button > span {
  font-size: 15px;
  font-weight: 700;
}

/* Текст под формой — тоже по центру, в одну ось с карточкой. */
.main-carousel-container .content-block__wrapper {
  width: 100%;
  max-width: 640px;
  margin: 8px auto 0;
  text-align: center;
}

@media (max-width: 767px) {
  .main-carousel-container .best-price-form-wrapper {
    margin-top: 16px;
    padding: 20px 16px 18px;
    border-radius: 14px;
  }

  .main-carousel-container .best-price-form .form-block__title span {
    font-size: 22px;
  }

  .main-carousel-container .best-price-form .form-block__title {
    margin-bottom: 14px;
  }

  .main-carousel-container .main-carousel__wrapper.tt-bp-closed .show-best-price-form {
    width: 100%;
    max-width: 460px;
    margin-top: 16px;
  }
}
