/* AeroMobilis — форма поиска на десктопе, кнопки-CTA сайта.
   Часть styles.css (нарезка 2026-10-18, без правок): подключается сразу за styles.css, порядок кусков = каскад. */
/* Десктоп: VIN (в DOM после полей) визуально в одной строке с типами ТС — только CSS order */
@media (min-width: 901px) {
  .home-vt-row,
  .site-chrome .home-vt-row {
    order: 1;
    flex: 1 1 0;
    width: auto;
    max-width: none;
    min-width: 12rem;
    margin: 0;
    padding: 0 0 6px;
    border-bottom: none;
  }
  .header-quick-search--dock,
  .site-chrome .header-quick-search--dock {
    order: 2;
    flex: 0 0 auto;
    margin-left: auto;
    align-self: center;
    padding-bottom: 6px;
  }
  .home-search-row-break {
    display: block;
    order: 3;
    flex: 1 1 100%;
    width: 100%;
    height: 0;
    margin: 0 0 2px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  }
  .home-search-field,
  .home-search-or,
  .home-auction-toggles,
  .home-search-actions,
  .home-search-err {
    order: 4;
  }
  .home-search-or {
    display: none !important;
  }
}

.home-search-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  padding-bottom: 0;
}

/* Десктоп: поля + аукционы зафиксированы; резиновая только кнопка «Показать N» */
@media (min-width: 901px) {
  .home-search-field--make,
  .home-search-field--model {
    flex: 0 0 152px;
    width: 152px;
    max-width: 152px;
  }
  .home-search-field--generation {
    flex: 0 0 160px;
    width: 160px;
    max-width: 160px;
  }
  .home-search-field--year {
    flex: 0 0 84px;
    width: 84px;
    max-width: 84px;
  }
  /* Свободное место между «годом до» и кнопкой — Copart/IAAI по центру (равные поля слева/справа) */
  .home-auction-toggles {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    align-items: center;
  }
  /* Фиксированная ячейка кнопки — при смене VT/числа блок аукционов не прыгает */
  .home-search-actions {
    flex: 0 0 15.5rem;
    width: 15.5rem;
    max-width: 15.5rem;
    min-width: 15.5rem;
    margin-left: 0;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 3px;
    padding: 0 0 2px;
  }
  /* Слот = высота подписи «ГДЕ ИЩЕМ?» — кнопка встаёт в ряд с названиями аукционов */
  .home-search-actions::before {
    content: "";
    display: block;
    height: calc(0.68rem * 1.2);
    width: 0;
    overflow: hidden;
    visibility: hidden;
    pointer-events: none;
  }
  .home-search-actions .site-text-btn,
  .home-search-actions .home-search-go {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    margin-left: 0;
    min-height: 26px; /* высота переключателя */
    box-sizing: border-box;
    width: fit-content;
    max-width: 100%;
  }
}

/* CTA сайта: текст + красная линия (не чип). Канон: .cursor/rules/no-chip-buttons.mdc */
.site-text-btn,
.home-search-go {
  appearance: none;
  position: relative;
  display: inline-block;
  margin: 0;
  /* Линия ровно по ширине букв; зазор к линии минимальный, без «отрыва» */
  padding: 0 0 3px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.15;
  white-space: nowrap;
  cursor: pointer;
  min-height: 0;
  font-variant-numeric: tabular-nums;
  transition: color 0.12s ease;
}

/* Канон: глагол ··· число ··· пиктограмма ТС */
.home-search-go__verb {
  display: inline;
  letter-spacing: 0.08em;
}
.home-search-go__n {
  display: inline;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.home-search-go__ico {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 0;
}
.home-search-go__ico svg,
.home-search-go__vt-ico {
  width: 1.2em;
  height: 1.2em;
  display: block;
}

.site-text-btn::after,
.home-search-go::after {
  content: "";
  position: absolute;
  left: 0;
  /* letter-spacing добавляет «хвост» после последней буквы — линию режем ровно по глифу */
  right: 0.08em;
  bottom: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 0;
  pointer-events: none;
  transition: background 0.08s linear;
}

/* Кнопка поиска: линия строго по буквам, не шире текста */
.home-search-actions .site-text-btn,
.home-search-actions .home-search-go {
  width: fit-content;
  max-width: 100%;
}

.site-text-btn:hover,
.home-search-go:hover {
  color: var(--brand-deep);
  background: transparent;
}

.site-text-btn:focus-visible,
.home-search-go:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.site-text-btn:disabled,
.home-search-go:disabled {
  cursor: wait;
  opacity: 0.85;
}

.site-text-btn.is-flashing::after,
.home-search-go.is-flashing::after {
  background: #2a9d4e;
  animation: site-text-btn-flash 0.22s ease-out;
}

@keyframes site-text-btn-flash {
  0% { background: var(--accent); }
  40% { background: #2a9d4e; }
  100% { background: #2a9d4e; }
}

.home-search-err {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  margin: 0;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 6px 16px rgba(13, 27, 42, 0.12);
  font-size: 0.84rem;
  color: var(--accent);
  text-align: left;
  z-index: 2;
}

@media (max-width: 900px) {
  /* Мобилка: одно поле ширины — форма = карточка = экран, без сдвига вбок */
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }
  .header--chrome,
  .header--chrome .site-chrome,
  .header--chrome .site-chrome__search,
  .home-search-dock,
  .home-search--lines,
  .site-chrome .home-search--lines,
  .home-shelves,
  .home-shelves-section {
    max-width: 100%;
    min-width: 0;
  }
  .home-search-dock {
    position: static;
    top: auto;
    box-shadow: none;
    padding: 8px var(--site-gutter-x) 10px;
    overflow-x: hidden;
    overflow-y: visible;
  }
  .header--chrome .site-chrome__search {
    padding: 8px var(--site-gutter-x) 10px;
    overflow-x: hidden;
    overflow-y: visible;
  }
  .home-search--lines,
  .site-chrome .home-search--lines,
  .header--chrome .home-search--lines {
    gap: 10px 12px;
    width: 100%;
    min-width: 0;
    align-items: stretch;
  }
  /* Вкладки ТС и VIN — разные строки, ничего не сливается */
  .home-vt-row,
  .site-chrome .home-vt-row {
    flex-wrap: wrap;
    gap: 8px 10px;
    width: 100%;
    min-width: 0;
    margin: 0 0 2px;
    padding: 0 0 10px;
    min-height: 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    overflow: visible;
  }
  .home-vt-tabs {
    flex: 1 1 100%;
    min-width: 0;
    max-width: 100%;
    gap: 0;
    justify-content: space-between;
    overflow: visible;
    flex-wrap: nowrap;
    mask-image: none;
    -webkit-mask-image: none;
  }
  .home-vt-tabs::-webkit-scrollbar { display: none; }
  .home-vt-tabs > .home-vt-tab,
  .home-vt-tabs > .home-vt-more {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
  }
  .home-vt-tab {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    padding: 6px 2px 8px;
    white-space: nowrap;
  }
  .home-vt-ico,
  .site-chrome .home-vt-ico {
    display: block;
    width: 16px;
    height: 16px;
  }
  .home-vt-ico[viewBox="0 0 512 512"],
  .site-chrome .home-vt-ico[viewBox="0 0 512 512"] {
    width: 20px;
    height: 20px;
  }
  .home-vt-tab[data-vt="jet_sky"] .home-vt-ico,
  .site-chrome .home-vt-tab[data-vt="jet_sky"] .home-vt-ico {
    width: 23px;
    height: 23px;
  }
  /* Мобилка: Авто + Мото + «Ещё» — равные доли ширины */
  .home-vt-more,
  .site-chrome .home-vt-more {
    display: inline-flex;
    position: relative;
    align-items: stretch;
    margin-left: 0;
    z-index: 5;
  }
  .home-vt-more.is-open,
  .site-chrome .home-vt-more.is-open {
    z-index: 60;
  }
  .home-vt-more-btn,
  .site-chrome .home-vt-more-btn {
    display: inline-flex;
    width: 100%;
    justify-content: center;
  }
  .home-vt-more-dots {
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    line-height: 1;
  }
  .home-vt-more-menu,
  .site-chrome .home-vt-more-menu,
  .home-vt-more-menu[hidden],
  .site-chrome .home-vt-more-menu[hidden] {
    display: none !important;
  }
  .home-vt-more.is-open .home-vt-more-menu,
  .site-chrome .home-vt-more.is-open .home-vt-more-menu,
  .home-vt-more.is-open .home-vt-more-menu[hidden],
  .site-chrome .home-vt-more.is-open .home-vt-more-menu[hidden] {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    position: absolute;
    top: calc(100% + 4px);
    left: auto;
    right: 0;
    z-index: 40;
    min-width: 12.5rem;
    width: max-content;
    max-width: min(16rem, calc(100vw - 24px));
    padding: 6px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(13, 27, 42, 0.14);
    box-sizing: border-box;
  }
  .home-vt-more.is-open .home-vt-more-menu .home-vt-tab,
  .site-chrome .home-vt-more.is-open .home-vt-more-menu .home-vt-tab {
    width: 100%;
    justify-content: flex-start;
    padding: 10px 10px;
    border-bottom: 0;
    border-radius: 6px;
    font-size: 0.78rem;
  }
  .home-vt-more.is-open .home-vt-more-menu .home-vt-tab.is-active,
  .site-chrome .home-vt-more.is-open .home-vt-more-menu .home-vt-tab.is-active {
    background: rgba(15, 23, 42, 0.05);
  }
  .home-vt-more-btn.is-active {
    color: var(--ink);
    border-bottom-color: var(--accent);
  }
  /* VIN на мобилке — на всю ширину после «или» (позиция в DOM, без JS) */
  .header-quick-search--dock,
  .site-chrome .header-quick-search--dock {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100% !important;
    min-width: 0;
    margin: 0;
    gap: 0;
  }
  .header-quick-search--dock .header-quick-input,
  .site-chrome .header-quick-search--dock .header-quick-input {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 44px;
    height: 44px;
    margin: 0;
    padding: 0 12px;
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: 6px;
    background: #f4f6f8;
    font-size: 16px;
    font-weight: 500;
    box-sizing: border-box;
  }
  .header-quick-search--dock .header-quick-input:focus {
    border-color: var(--accent);
    background: #fff;
  }
  .header-quick-search--dock .header-quick-btn {
    display: none;
  }
  .home-search-row-break {
    display: none !important;
  }
  /* Марка / модель / поколение — каждое на всю ширину */
  .home-search-field--make,
  .home-search-field--model,
  .home-search-field--generation,
  .site-chrome .home-search-field--make,
  .site-chrome .home-search-field--model,
  .site-chrome .home-search-field--generation {
    flex: 1 1 100%;
    width: 100%;
    max-width: none;
  }
  /* Годы рядом, но с зазором — две отдельные коробки */
  .home-search-field--year,
  .site-chrome .home-search-field--year {
    flex: 1 1 calc(50% - 6px);
    width: auto;
    min-width: 0;
    max-width: none;
  }
  .home-search-field select:not(.home-field-picker__native),
  .site-chrome .home-search-field select:not(.home-field-picker__native),
  .home-field-picker__btn,
  .site-chrome .home-field-picker__btn {
    height: 44px;
    min-height: 44px;
    font-size: 16px; /* iOS: без авто-зума при фокусе */
    padding: 0 34px 0 12px;
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: 6px;
    background-color: #f4f6f8;
    background-position: right 12px center;
    background-size: 11px;
  }
  .home-search-field select:not(.home-field-picker__native):focus,
  .site-chrome .home-search-field select:not(.home-field-picker__native):focus,
  .home-field-picker__btn:focus,
  .home-field-picker.is-open .home-field-picker__btn,
  .site-chrome .home-field-picker.is-open .home-field-picker__btn {
    border-color: var(--accent);
    background-color: #fff;
  }
  .home-field-picker__panel {
    left: 0;
    right: 0;
    width: 100%;
    max-height: min(50vh, 340px);
    border-radius: 8px;
  }
  .home-search-or {
    display: flex;
    margin: 6px 0 2px;
  }
  .header-quick-search--in-form,
  .site-chrome .header-quick-search--in-form {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100% !important;
    min-width: 0;
    margin: 0;
    gap: 0;
  }
  .header-quick-search--in-form .header-quick-input,
  .site-chrome .header-quick-search--in-form .header-quick-input {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 44px;
    height: 44px;
    margin: 0;
    padding: 0 12px;
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: 6px;
    background: #f4f6f8;
    /* ≥16px — иначе iOS зумит страницу и она «уезжает» вправо */
    font-size: 16px;
    font-weight: 500;
    box-sizing: border-box;
  }
  .home-field-picker__search {
    font-size: 16px;
  }
  .header-quick-search--in-form .header-quick-input:focus,
  .site-chrome .header-quick-search--in-form .header-quick-input:focus {
    border-color: var(--accent);
    background: #fff;
  }
  .header-quick-search--in-form .header-quick-btn {
    display: none; /* ищем по Enter / логике формы — как поле у конкурента */
  }
  .home-auction-toggles {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1 1 100%;
    width: 100%;
    margin: 8px 0 4px;
    gap: 6px;
  }
  .home-auction-toggles--reserve {
    display: flex !important;
    visibility: hidden;
    pointer-events: none;
    user-select: none;
  }
  .home-auction-toggles__hint {
    display: none; /* подпись — только десктоп */
  }
  .home-auction-toggles__row {
    display: flex;
    width: 100%;
    justify-content: center;
    gap: 28px;
  }
  .home-search-actions {
    flex: 1 1 100%;
    margin-top: 4px;
    width: 100%;
  }
  /* Кнопка поиска: ширина по тексту (линия = буквы), по центру ряда */
  .home-search-actions .btn,
  .home-search-actions .site-text-btn,
  .home-search-actions .home-search-go {
    width: fit-content;
    max-width: 100%;
    margin-inline: auto;
    display: block;
    text-align: center;
    min-height: 0;
    font-size: 0.9rem;
    padding: 10px 0 3px;
  }
  a.home-shelf-all.site-text-btn {
    width: auto;
    max-width: none;
    margin-inline: 0;
    display: inline-block;
    padding: 0 0 3px;
  }
}


