/* Главная: только то, что есть на главной. Цвета, шрифты, кнопки, поля и карточки товара — общие,
   из storefront.css (он подключается раньше этого файла). Анимации появления ставит home.js. */

.storefront.home-page main { padding-top: 24px; }
.home-page .car-hero { padding: 0; text-align: left; }

/* ---------- первый экран: фото машины, заголовок, одно главное действие ---------- */
.home-intro { position: relative; isolation: isolate; overflow: hidden; border-radius: var(--radius-lg); background: #26292e;
  box-shadow: 0 30px 70px -40px rgba(0, 0, 0, .55); }
.home-intro > * { min-width: 0; }
.home-intro__visual { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.home-intro__visual::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(11, 16, 22, .8), rgba(11, 16, 22, .38) 42%, rgba(11, 16, 22, .02) 78%); }
.home-intro__photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 54%; }
.home-intro__render { object-fit: contain; }
.home-intro__copy { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: center; max-width: 580px; min-height: 520px;
  padding: 48px; color: #fff; }
.home-intro .page-kicker { align-self: flex-start; display: inline-flex; align-items: center; margin: 0 0 24px; padding: 7px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 500; color: #fff; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .2);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.storefront:not(.garage-page) .home-intro h1 { margin: 0 0 20px; font-size: clamp(44px, 5.2vw, 76px); line-height: 1.02; letter-spacing: -.04em;
  font-weight: 600; color: #fff; text-wrap: initial; }
.home-intro h1 em { display: block; font-style: normal; color: rgba(255, 255, 255, .64); }
.home-intro__lead { max-width: 42ch; margin: 0; font-size: 17px; line-height: 1.5; color: rgba(255, 255, 255, .86); }
.home-intro__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 30px; }
.home-intro__actions .btn { gap: 10px; padding: 14px 24px; font-size: 16px; }
.home-intro__actions .btn:hover { transform: translateY(-1px); }
.home-intro__secondary { font-size: 15px; font-weight: 500; color: #fff; }
.home-intro__secondary:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.home-intro__note { margin: 18px 0 0; font-size: 13px; color: rgba(255, 255, 255, .7); }
.home-intro__caption { display: none; }
.home-intro__credit { position: absolute; z-index: 1; right: 20px; bottom: 14px; max-width: 50%; margin: 0; font-size: 10px; line-height: 1.4;
  text-align: right; color: rgba(255, 255, 255, .7); }
.home-intro__credit a { color: inherit; }
/* выбранная машина: смена прямо в первом экране */
.home-intro__change { margin-top: 22px; scroll-margin-top: 110px; }
.home-intro__change summary { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; font-size: 15px; font-weight: 500;
  color: rgba(255, 255, 255, .92); }
.home-intro__change summary::-webkit-details-marker { display: none; }
.home-intro__change summary span { font-size: 20px; line-height: 1; transition: transform .3s var(--ease-out); }
.home-intro__change[open] summary span { transform: rotate(45deg); }
.home-intro__picker { margin-top: 14px; padding: 22px; border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-hover); }
.home-intro__picker .picker { padding: 0; background: none; }
.home-intro__picker .picker .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.home-intro__picker .picker-image { display: none; }
.home-intro__picker [data-picker-submit] { margin-top: 14px; }
.home-intro__garage { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.home-intro__garage a { padding: 7px 12px; border-radius: 999px; font-size: 13px; background: var(--surface-3); color: var(--ink); }
.home-intro__garage a:hover { text-decoration: none; background: #dcdce1; }
.home-intro__garage a[aria-current] { background: var(--ink); color: #fff; }
/* кузов без фото: силуэт и подпись */
.home-intro__placeholder { position: relative; overflow: hidden; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: flex-end;
  padding: 48px; color: #fff; background: radial-gradient(ellipse at 75% 30%, #5c6674, #262d39 65%); }
.home-intro__silhouette { position: absolute; left: 38%; bottom: 14%; width: 46%; max-width: 520px; color: rgba(255, 255, 255, .08); }
.home-intro__placeholder > span, .home-intro__placeholder > p { position: relative; text-align: right; }
.home-intro__placeholder > span { font-size: 72px; font-weight: 600; letter-spacing: -.05em; }
.home-intro__placeholder p { font-size: 18px; color: rgba(255, 255, 255, .8); }

/* ---------- первый экран без машины: «разобранный» автомобиль с подписями деталей ---------- */
.storefront.home-page { overflow-x: clip; }
.xhero { position: relative; isolation: isolate; overflow: clip; display: grid; grid-template-columns: minmax(360px, 36fr) minmax(0, 64fr); align-items: center;
  min-height: 600px; margin: -24px calc(50% - 50vw) 0; padding: 0 max(40px, calc((100vw - 1440px) / 2 + 40px)) 40px;
  background:
    linear-gradient(112deg, transparent 63%, rgba(255, 255, 255, .7) 63.4%, rgba(255, 255, 255, 0) 67%),
    linear-gradient(112deg, transparent 76%, rgba(255, 255, 255, .55) 76.3%, rgba(255, 255, 255, 0) 79%),
    radial-gradient(ellipse 55% 75% at 72% 40%, #d9dde4 0%, rgba(217, 221, 228, 0) 72%),
    linear-gradient(180deg, #e9ebef 0%, #f1f2f5 70%, var(--bg) 100%); }
.xhero::after { content: ""; position: absolute; z-index: -1; top: -20%; right: 4%; width: 4px; height: 52%; border-radius: 4px; transform: rotate(32deg);
  background: linear-gradient(180deg, rgba(126, 211, 33, 0), #8be03a 45%, rgba(126, 211, 33, 0)); filter: blur(.6px); opacity: .85; }
.xhero > * { min-width: 0; }
.xhero__copy { position: relative; z-index: 1; padding: 40px 0 60px; container-type: inline-size; }
.xhero__kicker { margin: 0 0 18px; font-size: 16px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.storefront:not(.garage-page) .xhero h1 { margin: 0; font-family: var(--font-accent); font-style: italic; font-weight: 900;
  /* размер от ширины колонки, а не окна: самая длинная строка (~9.8em) всегда помещается целиком */
  font-size: clamp(30px, 9.6cqi, 58px);
  line-height: 1.02; letter-spacing: -.012em; color: var(--ink); text-wrap: initial; }
.xhero h1 > .xhero__line { display: block; white-space: nowrap; }
.xhero h1 > span:not(.xhero__line) { display: block; white-space: nowrap; background: linear-gradient(180deg, #76cf25, #4fa70f); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .12em; }
.xhero__lead { max-width: 30ch; margin: 22px 0 0; font-size: 19px; line-height: 1.45; color: var(--ink-2); }
.xhero__perks { list-style: none; display: flex; gap: 30px; margin: 40px 0 0; padding: 0; }
.xhero__perks li { display: grid; justify-items: center; gap: 10px; max-width: 120px; text-align: center; font-size: 14px; line-height: 1.3; color: var(--ink-2); }
.xhero__perks svg { width: 42px; height: 42px; color: var(--lime-2); }
.xhero__visual { position: relative; container-type: inline-size; margin-right: -2%; }
.xhero__visual img { display: block; width: 100%; height: auto;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 98%, transparent), linear-gradient(180deg, transparent 0, #000 9%, #000 88%, transparent);
  -webkit-mask-composite: source-in; mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 98%, transparent), linear-gradient(180deg, transparent 0, #000 9%, #000 88%, transparent);
  mask-composite: intersect; }
.xhero__tag { position: absolute; border-radius: 2cqw; color: var(--ink); transition: box-shadow .25s, transform .3s var(--ease-out); }
.xhero__tag:hover { text-decoration: none; color: var(--ink); box-shadow: 0 0 0 2px var(--lime), 0 12px 26px -14px rgba(92, 184, 22, .9); transform: translateY(-1px); }
.xhero__label { position: absolute; transform: translateY(-50%); font: 600 calc(1.42cqw * var(--k, 1))/1.16 var(--font); letter-spacing: -.01em; white-space: nowrap; transition: color .2s; }
.xhero__tag:hover .xhero__label { color: var(--accent); }
.xhero__parts { display: none; }
.xhero__tag:focus-visible { outline: 3px solid rgba(108, 196, 23, .7); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .xhero__copy > * { animation: site-rise .8s var(--ease-out) both; }
  .xhero__copy > :nth-child(2) { animation-delay: .08s; }
  .xhero__copy > :nth-child(3) { animation-delay: .16s; }
  .xhero__copy > :nth-child(4) { animation-delay: .24s; }
  .xhero__visual img { animation: xhero-in 1.3s var(--ease-out) both; }
  .xhero__tag { animation: xtag-in .6s var(--ease-out) both; animation-delay: calc(.45s + var(--i, 0) * 70ms); }
  @keyframes xhero-in { from { opacity: 0; transform: translateX(24px) scale(.985); } }
  @keyframes xtag-in { from { opacity: 0; transform: translateY(6px); } }
}

/* ---------- подбор машины: карточка на краю первого экрана ---------- */
.apicker { position: relative; z-index: 2; margin-top: -56px; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 0; align-items: center;
  padding: 34px 36px; border-radius: 26px; background: rgba(255, 255, 255, .94); scroll-margin-top: 100px;
  box-shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 30px 60px -34px rgba(17, 24, 39, .35);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.apicker > * { min-width: 0; }
.apicker__text { padding-right: 32px; margin-right: 32px; border-right: 1px solid var(--line-soft); }
.apicker h2 { margin: 0; font-size: clamp(26px, 2.5vw, 36px); line-height: 1.1; text-wrap: wrap; }
.apicker__text p { margin: 14px 0 0 calc(.95em + 14px); font-size: 15px; line-height: 1.5; color: var(--ink-2); max-width: 36ch; }
.apicker__garage { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 16px 0 0 calc(.95em + 14px); font-size: 13px; color: var(--ink-3); }
.apicker__garage a { padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--ink); font-weight: 500; }
.apicker__garage a:hover { text-decoration: none; background: #e0f3cc; }
.apicker__garage small { color: var(--ink-3); }
.apicker [data-picker-submit] { width: 100%; margin-top: 20px; height: 56px; font-size: 18px; font-weight: 700; letter-spacing: -.005em; gap: 14px; border-radius: 14px; }
.apicker [data-picker-submit]::after { content: ""; width: 22px; height: 22px; background: currentColor; transition: transform .3s var(--ease-out);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h15M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h15M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat; }
.apicker [data-picker-submit]:hover::after { transform: translateX(4px); }
.apicker [data-picker-submit][disabled] { opacity: 1; filter: grayscale(.85) opacity(.6); box-shadow: none; cursor: not-allowed; }

/* ---------- заголовки разделов ---------- */
.home-page .section-title { margin: 72px 0 24px; align-items: center; }
.home-page .section-title h2 { font-size: clamp(28px, 2.9vw, 40px); line-height: 1.08; }
.home-page .section-title p.muted { margin-top: 8px; font-size: 17px; }
.home-page main .eyebrow { margin: 0 0 8px; }
.home-page .link-more { font-size: 15px; font-weight: 600; color: var(--link); white-space: nowrap; }
.home-page .link-more::after { content: "→"; display: inline-block; margin-left: 6px; transition: transform .3s var(--ease-out); }
.home-page .link-more:hover { text-decoration: none; }
.home-page .link-more:hover::after { transform: translateX(4px); }

/* ---------- популярные модели: фильтр по марке и карточки ---------- */
.models .section-title { flex-wrap: wrap; gap: 16px 24px; margin-top: 64px; }
.models__filter { display: flex; flex-wrap: wrap; gap: 10px; }
.models__filter button { height: 42px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink);
  font: 600 14px/1 var(--font); cursor: pointer; transition: background .2s, border-color .2s, box-shadow .2s, transform .2s; }
.models__filter button:hover { border-color: var(--lime-2); transform: translateY(-1px); }
.models__filter button.is-on { background: var(--lime-grad); border-color: transparent; color: var(--lime-ink); box-shadow: var(--lime-glow); }
.models__credits { margin: 14px 0 0; font-size: 11px; color: var(--ink-4); }
.models__credits span + span::before { content: "; "; }
.models__credits span[hidden] { display: none; }
.model-card.is-entering { animation: model-in .5s var(--ease-out) both; }
@keyframes model-in { from { opacity: 0; transform: translateY(14px) scale(.98); } }

/* ---------- преимущества ---------- */
.perks { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 56px 0 0; padding: 0; }
.perks li { display: flex; align-items: flex-start; gap: 18px; padding: 6px 28px; }
.perks li + li { border-left: 1px solid var(--line); }
.perks li:first-child { padding-left: 4px; }
.perks svg { flex: none; width: 42px; height: 42px; color: var(--lime-2); }
.perks b { display: block; margin-bottom: 6px; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.perks span { display: block; font-size: 14px; line-height: 1.45; color: var(--ink-3); }

/* ---------- метки марок и категорий ---------- */
.home-page .chip { padding: 10px 18px; font-size: 14px; font-weight: 500; background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
  transition: background .2s, transform .25s var(--ease-out); }
.home-page .chip:hover { background: var(--surface-3); transform: translateY(-2px); }
.home-page .chip-n { opacity: .55; }

/* ---------- товары: полными рядами по четыре ---------- */
@media (min-width: 1001px) { .home-page .grid.products { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- как мы работаем ---------- */
.howto__steps { gap: 16px; }
.howto__steps li { padding: 28px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.howto__steps li > span { margin-bottom: 18px; background: var(--surface-3); color: var(--ink-2); font-weight: 600; transition: background .3s, color .3s; }
.howto__steps li:hover > span { background: var(--lime-grad); color: var(--lime-ink); }
.howto__steps h3 { font-size: 20px; }
.howto__steps p { color: var(--ink-3); }

/* ---------- финальный призыв ---------- */
.cta-band { margin-top: 80px; padding: 44px; border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.cta-band h2 { color: var(--ink); font-family: var(--font-accent); font-style: italic; font-weight: 800; letter-spacing: -.005em; }
.cta-band p { color: var(--ink-3); }
.cta-band__actions { gap: 12px; }
.cta-band .btn { padding: 14px 24px; }
.cta-band .ahero__help { display: inline-flex; align-items: center; gap: 6px; padding: 14px 22px; border-radius: 999px; font-size: 16px; font-weight: 500;
  background: var(--surface-3); color: var(--ink); transition: background .2s; }
.cta-band .ahero__help:hover { background: #dcdce1; text-decoration: none; }
.btn-arrow svg { width: 18px; height: 18px; margin-left: 4px; transition: transform .35s var(--ease-out); }
.btn-arrow:hover svg { transform: translateX(4px); }

/* ---------- выбранная машина: подходящие позиции лентой ---------- */
.home-page .car-hero__shelf { margin-top: 0; }
.home-page .car-hero__shelf .section-title { margin-top: 48px; }
.home-page .hscroll { grid-auto-columns: calc((100% - 60px) / 4); gap: 20px; padding-bottom: 16px; }
.home-page .pmini { border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); transition: transform .45s var(--ease-out), box-shadow .45s var(--ease-out); }
.home-page .pmini:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.home-page .pmini__img { background: var(--surface); }
.home-page .pmini__name { font-size: 15px; font-weight: 600; }
.home-page .pmini__meta { padding-bottom: 18px; }

/* ---------- появление при прокрутке (классы ставит home.js) ---------- */
.storefront .rv { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); }
.storefront .rv.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: no-preference) {
  .home-intro__copy { animation: site-rise .7s var(--ease-out) both; }
  .home-intro__photo { animation: home-photo-in 1.2s var(--ease-out) both; }
  @keyframes home-photo-in { from { transform: scale(1.04); } to { transform: none; } }
}

/* ---------- адаптив ---------- */
@media (max-width: 1240px) {
  .apicker { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .apicker__text { padding: 0; margin: 0; border: 0; }
  .perks { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 28px; }
  .perks li:nth-child(3) { border-left: 0; padding-left: 4px; }
}
@media (max-width: 1000px) {
  .xhero { grid-template-columns: minmax(0, 1fr); min-height: 0; padding-bottom: 64px; }
  .xhero__copy { padding: 36px 0 8px; }
  .xhero__visual { margin: 0 -2%; }
  .home-intro__copy { padding: 36px; }
  .home-intro__silhouette { left: 8%; width: 84%; bottom: 8%; }
  .home-intro__placeholder > span, .home-intro__placeholder > p { display: none; }
  .home-page .hscroll { grid-auto-columns: calc((100% - 40px) / 3); }
}
@media (max-width: 860px) {
  .apicker { padding: 26px; }
}
@media (max-width: 600px) {
  .storefront.home-page main { padding-top: 12px; }
  .xhero { margin-top: -12px; padding: 0 16px 48px; }
  .xhero__copy { padding-top: 28px; }
  .storefront:not(.garage-page) .xhero h1 { font-size: clamp(30px, 9.4vw, 38px); }
  .xhero h1 > span:not(.xhero__line), .xhero h1 > .xhero__line { white-space: normal; }
  .xhero__parts { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 4px -16px 0; padding: 4px 16px 8px; }
  .xhero__parts a { flex: none; padding: 9px 14px; border-radius: 999px; background: #fff; color: var(--ink); font-size: 13px; font-weight: 600;
    box-shadow: 0 0 0 1px var(--line-soft), 0 4px 12px -8px rgba(17, 24, 39, .3); }
  .xhero__parts a:hover { text-decoration: none; box-shadow: 0 0 0 2px var(--lime); }
  .xhero__lead { font-size: 16px; margin-top: 14px; }
  .xhero__perks { gap: 12px; justify-content: space-between; margin-top: 26px; }
  .xhero__perks li { font-size: 12px; }
  .xhero__perks svg { width: 34px; height: 34px; }
  /* на телефоне кадр шире экрана, подписи остаются в пропорциях плашек; ссылки на категории — чипы под кадром */
  .xhero__visual { margin: 6px -16px 0; }
  .home-intro { border-radius: 22px; }
  .home-intro__copy { justify-content: flex-start; min-height: 520px; padding: 26px 22px 64px; max-width: none; }
  .home-intro__visual::after { background: linear-gradient(180deg, rgba(11, 16, 22, .78), rgba(11, 16, 22, .42) 58%, rgba(11, 16, 22, .1) 80%, rgba(11, 16, 22, .3)); }
  .home-intro__photo { object-position: 61% center; }
  .storefront:not(.garage-page) .home-intro h1 { font-size: 42px; margin-bottom: 16px; }
  .home-intro .page-kicker { margin-bottom: 20px; font-size: 12px; }
  .home-intro__lead { font-size: 15px; }
  .home-intro__actions { gap: 12px 18px; margin-top: 22px; }
  .home-intro__actions .btn { padding: 13px 20px; font-size: 15px; }
  .home-intro__credit { left: 12px; right: 12px; bottom: 12px; max-width: none; text-align: left; font-size: 9px; }
  .apicker { margin-top: -40px; padding: 22px 18px; border-radius: 22px; }
  .apicker h2 { font-size: 26px; }
  .apicker__text p, .apicker__garage { margin-left: 0; }
  .apicker [data-picker-submit] { height: 52px; font-size: 17px; }
  .home-page .section-title { margin: 52px 0 18px; }
  .home-page .section-title h2 { font-size: 26px; }
  .home-page .section-title p.muted { font-size: 15px; }
  .models__filter { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 6px; width: calc(100% + 32px); }
  .models__filter button { flex: none; height: 38px; padding: 0 16px; }
  .perks { grid-template-columns: minmax(0, 1fr); row-gap: 20px; margin-top: 44px; }
  .perks li, .perks li + li, .perks li:first-child, .perks li:nth-child(3) { padding: 0; border-left: 0; }
  .home-page .hscroll { grid-auto-columns: 72%; gap: 14px; }
  .howto__steps { gap: 12px; }
  .howto__steps li { padding: 22px; }
  .cta-band { margin-top: 56px; padding: 24px; border-radius: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .home-intro__copy, .home-intro__photo { animation: none !important; }
  .storefront .rv { opacity: 1; transform: none; transition: none; }
  .model-card, .model-card img, .home-page .pmini, .home-page .chip { transition: none; }
}
