/* ---------- Смуга довіри ---------- */
.trustbar { background: var(--teal-dark); color: #fff; font-size: .82rem; }
.trustbar .container { display: flex; gap: 18px; overflow-x: auto; white-space: nowrap; padding-top: 7px; padding-bottom: 7px; scrollbar-width: none; }
.trustbar .container::-webkit-scrollbar { display: none; }
.trustbar span { display: inline-flex; align-items: center; gap: 6px; }
.trustbar span::before { content: "✓"; color: var(--yellow); font-weight: 700; }

/* ---------- Шапка ---------- */
.header { position: sticky; top: 0; z-index: 50; }
.header-main { position: relative; z-index: 2; background: #fff; border-bottom: 1px solid var(--line); }
.header-extra { position: relative; z-index: 1; background: #fff; }
.header-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding-top: 8px; padding-bottom: 8px; }
.logo img { height: 40px; width: auto; max-width: 100%; }
.header-actions { order: 2; display: flex; align-items: center; gap: 4px; justify-self: end; }
.header-actions .icon-btn { flex: none; }
.header-phone { display: none; font-weight: 700; color: var(--text); text-decoration: none; padding: 8px; }
.header-phone small { display: block; font-weight: 400; color: var(--muted); font-size: .75rem; }
.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: var(--tap); height: var(--tap); border-radius: 10px; border: 0; background: transparent; cursor: pointer; color: var(--text); text-decoration: none; }
.icon-btn:hover { background: var(--teal-soft); }
.icon-btn svg { width: 24px; height: 24px; }
.badge-count { position: absolute; top: 2px; right: 0; min-width: 20px; height: 20px; padding: 0 5px; background: var(--cta); color: #fff; border-radius: 10px; font-size: .72rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.badge-count[hidden] { display: none; }
div.search { order: 3; grid-column: 1 / -1; position: relative; }
div.search input { width: 100%; min-height: var(--tap); padding: 10px 48px 10px 14px; border: 2px solid var(--line); border-radius: 10px; background: var(--bg); }
div.search input:focus { border-color: var(--teal); background: #fff; outline: none; box-shadow: 0 0 0 3px rgba(14,124,134,.18); }
div.search button { position: absolute; right: 2px; top: 2px; bottom: 2px; width: 44px; border: 0; background: transparent; cursor: pointer; border-radius: 8px; }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); z-index: 60; max-height: 60vh; overflow: auto; padding: 6px; }
.suggest[hidden] { display: none; }
.suggest h4 { margin: 8px 10px 4px; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.suggest a, .suggest button { display: flex; width: 100%; align-items: center; gap: 10px; min-height: var(--tap); padding: 8px 10px; border: 0; background: none; text-align: left; color: var(--text); text-decoration: none; border-radius: 8px; cursor: pointer; }
.suggest a:hover, .suggest button:hover, .suggest .active { background: var(--teal-soft); }
.suggest img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; }
.suggest .price { margin-left: auto; font-weight: 700; white-space: nowrap; }

div.fab { position: fixed; right: 12px; bottom: 16px; z-index: 45; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.fab-main { width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--teal); color: #fff; box-shadow: var(--shadow-lg); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.fab-main svg { width: 28px; height: 28px; }
.fab-menu { display: none; flex-direction: column; gap: 6px; background: #fff; border-radius: 12px; padding: 8px; box-shadow: var(--shadow-lg); }
.fab.open .fab-menu { display: flex; }
.fab-menu a { display: flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--text); font-weight: 600; }
.fab-menu a:hover { background: var(--teal-soft); }
body.has-sticky div.fab { bottom: 84px; }

/* ---------- Футер ---------- */
.footer { background: #111827; color: #e5e7eb; margin-top: 30px; padding: 26px 0 90px; font-size: .92rem; }
.footer a { color: #e5e7eb; text-decoration: none; display: inline-flex; min-height: 36px; align-items: center; }
.footer a:hover { text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.footer h3, .footer .foot-h { color: #fff; font-size: .95rem; margin-bottom: 8px; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer .pay { display: flex; flex-wrap: wrap; gap: 6px; }
.footer .pay span { background: #1f2937; border: 1px solid #374151; padding: 4px 8px; border-radius: 6px; font-size: .78rem; }
.footer-bottom { border-top: 1px solid #374151; margin-top: 18px; padding-top: 14px; display: flex; flex-wrap: wrap; gap: 10px 20px; justify-content: space-between; align-items: center; color: #9ca3af; }
.locale-switch { display: inline-flex; border: 1px solid #4b5563; border-radius: 8px; overflow: hidden; }
.locale-switch button { min-height: 40px; padding: 6px 12px; border: 0; background: transparent; color: #e5e7eb; cursor: pointer; font-weight: 600; }
.locale-switch button[aria-pressed="true"] { background: #e5e7eb; color: #111827; }

.ft-toast { position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 20px); background: #111827; color: #fff; padding: 12px 18px; border-radius: 10px; z-index: 120; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100% - 24px); font-weight: 600; }
.ft-toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width:640px){.footer-grid{grid-template-columns:repeat(auto-fit,minmax(160px,1fr))}}
@media (min-width:1024px){.header-actions{order:0}.header-row{grid-template-columns:200px 1fr auto;gap:24px;padding-top:12px;padding-bottom:12px}div.search{grid-column:auto;order:0}.logo img{height:54px}.header-phone{display:block}.footer{padding-bottom:30px}body.has-sticky div.fab{bottom:16px}}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
.car-dialog { border: 0; border-radius: 16px; padding: 0; width: min(480px, calc(100% - 24px)); max-height: calc(100vh - 24px); box-shadow: var(--shadow-lg); }
.car-dialog::backdrop { background: rgba(17, 24, 39, .5); }
.car-dialog form { padding: 4px 18px 18px; }
.car-dlg-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.car-dlg-head h2 { margin: 0; font-size: 1.15rem; }
.car-dlg-actions { display: flex; gap: 8px; justify-content: space-between; align-items: center; margin-top: 12px; }
.car-dlg-actions .btn-cta { flex: 1; }
.form-status { border-radius: 10px; padding: 12px; margin: 10px 0; font-weight: 600; }
.form-status.err { background: var(--red-soft); color: var(--red); }
.form-status[hidden] { display: none; }
.form-status .retry { background: none; border: 0; padding: 0; min-height: 36px; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.field label { font-size: .85rem; font-weight: 600; color: var(--muted); }
.field select { min-height: var(--tap); padding: 8px 12px; border: 2px solid var(--line); border-radius: 8px; background: #fff; width: 100%; }
.field select:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 3px rgba(14,124,134,.18); }

/* 404 */
.notfound { text-align: center; padding-top: 40px; padding-bottom: 48px; }
.notfound-code { font-size: 4.5rem; font-weight: 800; line-height: 1; margin: 0; color: var(--teal); }
.notfound h1 { margin: 8px 0; }
.notfound-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 20px 0 28px; }
.notfound-sub { font-size: 1.05rem; margin: 0 0 10px; }
.notfound .popular-cars { justify-content: center; }
.notfound-help { margin-top: 24px; }
.notfound .popular-cars { display: flex; flex-wrap: wrap; gap: 8px; }
.notfound .popular-cars a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--teal-dark); font-weight: 600; text-decoration: none; }
.notfound .popular-cars a:hover { border-color: var(--teal); background: var(--teal-soft); }
.nocar { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.nocar summary { cursor: pointer; font-weight: 700; color: var(--teal-dark); min-height: var(--tap); display: flex; align-items: center; }
.nocar .field { margin: 8px 0; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 90; max-width: min(92vw, 520px); margin: 0; padding: 12px 18px; border-radius: 10px; font-weight: 600; box-shadow: 0 8px 24px rgba(16,24,40,.2); background: #166534; color: #fff; animation: toast-out .4s ease 7s forwards; }
.toast.err { background: #991b1b; }
@keyframes toast-out { to { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .toast { animation-duration: .01s; animation-delay: 12s; } }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.car-dialog .nocar { margin: 0 18px 18px; }
.car-dialog .nocar form { padding: 4px 0 0; }

/* Форма «Контакти» (заявка через Leads\Store): поля на всю ширину, повідомлення з нормальною висотою. */
.contact-form .field input, .contact-form .field textarea { display: block; width: 100%; max-width: 100%; font: inherit; padding: 8px 12px; border: 2px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); }
.contact-form .field input { min-height: var(--tap); }
.contact-form .field textarea { min-height: 140px; resize: vertical; }
.contact-form .field input:focus, .contact-form .field textarea:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 3px rgba(14,124,134,.18); }
/* Спільне для всіх форм заявок: поле з помилкою і повідомлення про успіх (після правил полів, щоб перекривати їхній фон). */
.field.has-error input, .field.has-error textarea, .field.has-error select { border-color: var(--red); background: var(--red-soft); }
.form-status.ok { background: var(--green-soft); color: var(--green); }

/* Сторінка «Контакти»: контакти й форма поруч на ПК, мапа на всю ширину. */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.contact-list, .contact-social { list-style: none; margin: 0; padding: 0; }
.contact-list li { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.contact-ico { flex: none; display: inline-flex; width: 24px; height: 24px; }
.contact-ico svg { width: 24px; height: 24px; }
.contact-label { display: block; font-size: 13px; color: var(--muted); }
.contact-social { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.contact-map .map-ph { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.contact-map .map-ph p { flex-basis: 100%; margin: 0; color: var(--muted); }
.contact-map iframe { display: block; width: 100%; height: 360px; border: 0; border-radius: var(--radius-sm); }
@media (min-width: 900px) { .contact-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: start; gap: 16px; } }

/* Смуга розділів і авто під шапкою. ПК: один рядок, розділи зліва, авто справа. Телефон: дві смуги одна під одною. */
.extra-row { display: flex; align-items: center; gap: 12px; min-height: 52px; }
.navbar { flex: none; display: flex; align-items: center; gap: 6px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.navbar::-webkit-scrollbar { display: none; }
.navbar a { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 8px; color: var(--text); font-weight: 600; text-decoration: none; white-space: nowrap; }
.navbar a:hover { background: var(--teal-soft); }
.navbar a.primary { background: var(--teal); color: #fff; font-weight: 700; }
.navbar a.primary:hover, .navbar a.primary[aria-current="page"] { background: var(--teal-dark); }
.navbar a[aria-current="page"]:not(.primary) { box-shadow: inset 0 -3px 0 var(--teal); border-radius: 8px 8px 0 0; }
.navbar svg { width: 20px; height: 20px; }
/* «Ковані на замовлення» — преміум-послуга: жовтий градієнт у кольорах бейджа «Залишився 1 комплект» (--yellow), щоб виділялась поруч із бірюзовим каталогом. Темний текст на жовтому ~10:1. */
.navbar a.nav-forged { background: linear-gradient(135deg, #ffe28a 0%, #ffd24d 50%, var(--yellow) 100%); color: #1f2937; font-weight: 800; box-shadow: inset 0 0 0 1px #f0b90a; }
.navbar a.nav-forged:hover { background: linear-gradient(135deg, #ffd978 0%, #ffcb3d 50%, #ffbf14 100%); }
.navbar a.nav-forged[aria-current="page"] { background: #f5b800; box-shadow: inset 0 0 0 1px #d99f00; border-radius: 8px; }
.nav-forged-short { display: none; }
.carbar { flex: 0 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; margin-left: auto; }
.carbar .car-ico { width: 22px; height: 22px; color: var(--teal-dark); flex: none; }
.carbar strong { font-weight: 700; }
.carbar .btn { flex: none; min-height: 40px; padding: 6px 12px; white-space: nowrap; }
.carbar #carbarShow[hidden] { display: none; }
.carbar .carbar-text { min-width: 0; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.carbar .carbar-text:has(.carbar-hint) { max-width: none; }
/* Головна, ПК: вибране авто в смузі показуємо завжди, не ховаємо ні при скролі, ні поки видно блок підбору. Без вибраного авто смуга там не потрібна: є блок підбору. */
html:not(.has-car) body.home .carbar { display: none; }
@media (max-width:1023.98px){ body.home .carbar { display: none; } } /* Телефон, головна: смуги авто немає зовсім (є блок підбору); на інших сторінках лишається. */
@media (max-width:1023.98px){
	.extra-row { display: block; padding: 0; min-height: 0; }
	.navbar { min-height: 48px; padding: 4px 16px; flex: initial; }
	/* Телефон: коротка назва, щоб обидві кнопки вміщались без прокрутки. */
	.nav-forged-full { display: none; }
	.nav-forged-short { display: inline; }
	/* Телефон: усе в один рядок; довга назва авто обрізається з трьома крапками. */
	.carbar { margin: 0; padding: 4px 16px; min-height: 48px; flex-wrap: nowrap; gap: 6px; background: var(--teal-soft); border-top: 1px solid #cfe7e9; }
	.carbar .carbar-text { flex: 1 1 0; min-width: 0; max-width: none; padding-top: 3px; /* оптична поправка: інакше текст стоїть вище за іконку й кнопки */ }
	.carbar .car-ico { display: block; }
	.carbar .btn { min-height: 36px; padding: 4px 10px; font-size: .88rem; }
}
@media (max-width:359.98px){ .carbar .btn { padding: 4px 8px; } }
}

.header-row > * { min-width: 0; }
div.search .dgwt-wcas-search-wrapp { max-width: 100%; min-width: 0; }
/* Головна зі збереженим авто: до підстановки блок невидимий і має висоту готового, щоб не було стрибка. Без JS через 2 с показуємо як є. */
.has-car .hero #finderCar:not(.is-saved) { height: 157px; overflow: hidden; }
.has-car .hero #finderCar:not(.is-saved) > * { visibility: hidden; animation: felgReveal 0s 2s forwards; }
@keyframes felgReveal { to { visibility: visible; } }
@media (max-width:639.98px){ .has-car .hero #finderCar:not(.is-saved) { height: 179px; } }

/* Телефон: пошук, розділи і панель авто (`.header-fold`, збирає chrome.js) їдуть як один блок під рядок логотипа. Смужка пошуку (`.fold-search`) за лупою плавно розкривається і посуває розділи та авто вниз. Instagram ховаємо: рядок інакше не вміщається. */
@media (max-width:1023.98px){
	.header { background: transparent; pointer-events: none; }
	.header-main, .header-fold { pointer-events: auto; }
	.header-fold { position: relative; z-index: 1; background: #fff; transition: transform .28s ease, visibility 0s linear 0s; }
	.head-compact .header-fold { transform: translateY(-100%); visibility: hidden; transition: transform .28s ease, visibility 0s linear .28s; }
	.logo img { height: 36px; }
	.header-row > div.search { display: none; }
	.header-actions .icon-btn-ig { display: none; }
	.fold-search { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows .28s ease, visibility 0s linear .28s; }
	.search-open .fold-search { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows .28s ease, visibility 0s linear 0s; }
	.fold-search-in { min-height: 0; overflow: hidden; }
	.fold-search .container { padding-top: 8px; padding-bottom: 8px; box-shadow: inset 0 -1px 0 var(--line); } /* роздільник між пошуком і розділами */
}
@media (min-width:1024px){ .search-toggle { display: none; } }
.search-toggle, .search-toggle:hover, .search-toggle:focus { background: transparent; } /* стан лише від aria-expanded: на сенсорних екранах :hover залипає після тапу */
.search-toggle[aria-expanded="true"] { background: var(--teal-soft); }
@media (max-width:339.98px){ .header-actions .icon-btn[data-contact="telegram"] { display: none; } }
@media (prefers-reduced-motion:reduce){ .header-fold, .fold-search { transition: none !important; } }

/* Телефон: контакти (Viber, Telegram) є в шапці, тож плаваючу кнопку з контактами не показуємо */
@media (max-width:1023.98px){ div.fab { display: none; } }

/* Вікно «Додано в кошик». */
.cart-dialog { border: 0; border-radius: var(--radius); padding: 20px; width: min(440px, calc(100% - 32px)); box-shadow: 0 20px 50px rgba(17,24,39,.35); color: var(--text); }
.cart-dialog::backdrop { background: rgba(17,24,39,.5); }
.cart-dialog h2 { margin: 0 0 12px; font-size: 1.2rem; }
.cd-note { margin: 0 0 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--amber-soft); color: var(--amber-text); font-size: .9rem; line-height: 1.4; }
.cart-dialog.is-error h2 { color: var(--red); }
.cart-dialog.is-error .cd-note { background: var(--red-soft); color: var(--red); }
.cart-dialog.is-error .cd-item, .cart-dialog.is-confirm .cd-item { display: none; }
.cd-item { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.cd-item img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; background: #eef0f3; flex: none; }
.cd-item div { display: grid; gap: 2px; min-width: 0; }
.cd-name { font-size: .95rem; line-height: 1.3; }
.cd-qty { color: var(--muted); font-size: .9rem; }
.cd-actions { display: grid; gap: 8px; }
@media (min-width: 480px) { .cd-actions { grid-template-columns: 1fr 1fr; } }
@media (prefers-reduced-motion: no-preference) { .cart-dialog[open] { animation: cdIn .18s ease-out; } @keyframes cdIn { from { opacity: 0; transform: translateY(8px); } } }
