﻿/* ============================================================
   AutoParts — стили
   ============================================================ */

:root {
  --bg:          #f4f6f9;
  --bg-alt:      #ffffff;
  --surface:     #ffffff;
  --surface-2:   #f8fafc;
  --ink:         #101828;
  --ink-2:       #475467;
  --ink-3:       #98a2b3;
  --line:        #e4e8ef;
  --line-2:      #eef1f6;
  --brand:       #e07b42;
  --brand-dark:  #c96a35;
  --brand-soft:  #fbeee5;
  --brand-light: #f4b183;
  --brand-ink:   #101828;
  --brand-text:  #a85c32;
  --accent:      #1d4ed8;
  --ok:          #12805c;
  --ok-soft:     #e6f6ef;
  --warn:        #b54708;
  --warn-soft:   #fef3e6;
  --danger:      #d42620;

  --r-sm: 10px;
  --r:    14px;
  --r-lg: 20px;
  --r-xl: 28px;

  --sh-1: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --sh-2: 0 4px 10px rgba(16, 24, 40, .06), 0 12px 28px rgba(16, 24, 40, .08);
  --sh-3: 0 20px 50px rgba(16, 24, 40, .18);

  --maxw: 1320px;

  --t: .2s cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; }

/* атрибут hidden должен побеждать любые display из этой таблицы */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h, 177px) + 14px); }

body {
  margin: 0;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

body.no-scroll { overflow: hidden; }

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 800; letter-spacing: -.02em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 0 0 var(--r-sm) 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border: 1px solid transparent; border-radius: var(--r-sm);
  background: transparent; cursor: pointer; font-weight: 700; font-size: 14px;
  white-space: nowrap; transition: background var(--t), color var(--t), border-color var(--t), transform var(--t), box-shadow var(--t);
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--brand); color: var(--brand-ink); box-shadow: 0 6px 18px rgba(224, 123, 66, .28); }
.btn--primary:hover { background: var(--brand-dark); }
.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink-3); background: var(--surface-2); }
.btn--dark { background: var(--ink); color: #fff; }
.btn--dark:hover { background: #000; }
.btn--link { padding: 6px 4px; color: var(--ink-3); font-weight: 600; }
.btn--link:hover { color: var(--brand-text); }
.btn--lg { padding: 15px 28px; font-size: 15px; }
.btn--block { width: 100%; }
.btn--icon svg { width: 18px; height: 18px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.is-added { background: var(--ok); box-shadow: none; }

/* ---------------- Header ---------------- */
.header {
  position: sticky; top: 0; z-index: 60;
  background: var(--surface); border-bottom: 1px solid var(--line);
}

.header__top {
  background: var(--brand); color: var(--brand-ink); font-size: 13px;
  background-image: linear-gradient(90deg, #e07b42 0%, #d4703a 100%);
}
.header__top-inner { display: flex; align-items: center; justify-content: space-between; height: 38px; }
.header__contacts { display: flex; align-items: center; gap: 16px; }
.header__phone { font-weight: 800; letter-spacing: .01em; }
.header__phone:hover { color: var(--brand-ink); text-decoration: underline; }
.header__schedule { color: rgba(16, 24, 40, .78); }
.header__links { display: flex; gap: 20px; color: rgba(16, 24, 40, .84); }
.header__links a:hover { color: var(--brand-ink); text-decoration: underline; }

.header__main {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 24px;
  padding-top: 14px; padding-bottom: 14px;
}

.logo { display: inline-flex; align-items: center; flex-shrink: 0; }
.logo__img {
  display: block; height: 88px; width: auto; max-width: 400px; object-fit: contain;
  transition: opacity .2s;
}
.logo:hover .logo__img { opacity: .82; }

.search { position: relative; display: flex; align-items: center; width: 100%; max-width: 560px; justify-self: center; }
.search__icon {
  position: absolute; left: 16px; width: 19px; height: 19px; color: var(--ink-3); pointer-events: none;
}
.search input {
  width: 100%; padding: 13px 120px 13px 46px; border: 1px solid var(--line);
  border-radius: var(--r-sm); background: var(--surface-2); font-size: 14px;
  transition: border-color var(--t), background var(--t);
}
.search input::placeholder { color: var(--ink-3); }
.search input:focus { outline: none; border-color: var(--brand); background: #fff; }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.search__btn { position: absolute; right: 5px; padding: 9px 18px; }

.cart-btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface);
  cursor: pointer; font-weight: 700; transition: all var(--t);
}
.cart-btn svg { width: 21px; height: 21px; }
.cart-btn:hover { border-color: var(--brand); color: var(--brand-text); }
.cart-btn__count {
  min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px;
  background: var(--brand); color: var(--brand-ink); font-size: 12.5px; font-weight: 800;
  display: grid; place-items: center;
}
.cart-btn.bump { animation: bump .35s; }
@keyframes bump {
  0% { transform: scale(1); } 40% { transform: scale(1.09); } 100% { transform: scale(1); }
}

/* ---------------- Hero ---------------- */
.hero {
  position: relative; overflow: hidden;
  background: var(--ink);
  color: #fff; padding: 60px 0 64px;
}
.hero__bg { position: absolute; inset: 0; z-index: 0; background: var(--ink); }
.hero__slide {
  position: absolute; inset: 0; display: block;
  background-position: center 85%; background-size: cover; background-repeat: no-repeat;
  opacity: 0; transition: opacity 1.1s ease;
}
.hero__slide.is-on { opacity: 1; }
/* точечное затемнение отдельных кадров */
.hero__slide--dim::before { content: ''; position: absolute; inset: 0; background: rgba(16, 24, 40, .30); }
/* вуаль обязана лежать ПОВЕРХ фото: слайды — дети .hero__bg и перекрыли бы его фон */
.hero__bg::after {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background:
    radial-gradient(1100px 400px at 88% -12%, rgba(224, 123, 66, .16), transparent 62%),
    radial-gradient(760px 380px at 6% 8%, rgba(29, 78, 216, .10), transparent 60%),
    linear-gradient(90deg, rgba(16, 24, 40, .90) 0%, rgba(16, 24, 40, .80) 52%, rgba(16, 24, 40, .88) 100%);
}
.hero__inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.25fr .85fr; gap: 52px; align-items: center; }

.badge {
  display: inline-block; padding: 7px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16);
  font-size: 12.5px; font-weight: 700; letter-spacing: .02em; color: #ffc9b0;
}
.hero h1 { margin: 20px 0 16px; font-size: clamp(30px, 4.4vw, 50px); }
.hero h1 span { color: var(--brand-light); }
.hero__text > p { color: rgba(255, 255, 255, .72); max-width: 560px; font-size: 16px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero .btn--ghost { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.2); }
.hero .btn--ghost:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.4); }

.hero__stats { display: flex; flex-wrap: wrap; gap: 36px; margin-top: 42px; }
.hero__stats b { display: block; font-size: 27px; font-weight: 800; letter-spacing: -.02em; }
.hero__stats span { font-size: 13px; color: rgba(255,255,255,.58); }

.hero__card {
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--r-xl); padding: 26px; backdrop-filter: blur(10px);
}
.car-select h2 { font-size: 19px; margin-bottom: 18px; }

/* ---------------- Fields ---------------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.field > span i { color: var(--brand-text); font-style: normal; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: #fff; font-size: 14px; color: var(--ink); transition: border-color var(--t), box-shadow var(--t);
}
.field select option { color: var(--ink); background: #fff; }
.field textarea { resize: vertical; }
.field__static {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface-2); font-size: 14px; font-weight: 800; color: var(--ink);
  letter-spacing: .01em; user-select: none;
}
.field select {
  appearance: none; cursor: pointer; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a2b3' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(224, 123, 66, .14);
}
.field.has-error input, .field.has-error select { border-color: var(--danger); }
.error { display: none; font-size: 12px; color: var(--danger); font-style: normal; margin-top: 5px; }
.field.has-error .error { display: block; }

.car-select .field > span { color: rgba(255,255,255,.72); }
.car-select .btn { margin-top: 4px; }
.car-select__note { margin-top: 14px; font-size: 12.5px; color: rgba(255,255,255,.6); text-align: center; }
.car-select__note.done { color: #7ee2b8; font-weight: 700; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

/* ---------------- Sections ---------------- */
.section { padding: 62px 0; }
.section--alt { background: var(--bg-alt); border-block: 1px solid var(--line-2); }
.section__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 30px; flex-wrap: wrap; }
.section__title { font-size: clamp(24px, 3vw, 32px); }
.section__sub { color: var(--ink-2); margin-top: 8px; }

/* ---------------- Groups ---------------- */
.groups-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 16px; }
.group-card {
  position: relative; overflow: hidden; padding: 22px; border: 1px solid var(--line);
  border-radius: var(--r-lg); background: var(--surface); cursor: pointer; text-align: left;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
  display: flex; flex-direction: column; gap: 12px; width: 100%;
}
.group-card:hover { transform: translateY(-3px); box-shadow: var(--sh-2); border-color: transparent; }
.group-card::after {
  content: ''; position: absolute; inset: 0; opacity: .06; pointer-events: none;
  background: radial-gradient(160px 90px at 100% 0%, var(--gc), transparent 70%);
}
.group-card__icon {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  color: #fff; background: var(--gc);
}
.group-card__icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.group-card h3 { font-size: 16.5px; }
.group-card p { font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.group-card__count { margin-top: auto; padding-top: 10px; font-size: 12.5px; font-weight: 700; color: var(--gc); }

/* ---------------- Catalog ---------------- */
.catalog { display: grid; grid-template-columns: 264px 1fr; gap: 26px; align-items: start; }
/* Подбор по автомобилю стоит рядом с фильтрами: фильтры слева во всю
   высоту, подбор — справа сверху, товары — под ним. */
.catalog > .filters { grid-column: 1; grid-row: 1 / span 2; }
.catalog > .catalog__car { grid-column: 2; grid-row: 1; }
.catalog > .products { grid-column: 2; grid-row: 2; }

.filters {
  position: sticky; top: calc(var(--header-h, 177px) + 9px); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 20px;
}
.filters__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.filters__head h3 { font-size: 17px; }
.filters__group { padding: 16px 0; border-top: 1px solid var(--line-2); }
.filters__group h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-bottom: 12px; }
.filters__list { display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow-y: auto; }
.filters__list--scroll { max-height: 176px; padding-right: 4px; }
.filters__list::-webkit-scrollbar { width: 5px; }
.filters__list::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

.check {
  display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px;
  cursor: pointer; font-size: 13.5px; transition: background var(--t); user-select: none;
}
.check:hover { background: var(--surface-2); }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check__box {
  width: 18px; height: 18px; flex: none; border: 1.6px solid var(--line); border-radius: 5px;
  display: grid; place-items: center; transition: all var(--t);
}
.check__box::after {
  content: ''; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0;
  transform: rotate(-45deg) scale(.4); opacity: 0; transition: all var(--t); margin-top: -2px;
}
.check input:checked + .check__box { background: var(--brand); border-color: var(--brand); }
.check input:checked + .check__box::after { opacity: 1; transform: rotate(-45deg) scale(1); }
.check input:focus-visible + .check__box { outline: 2px solid var(--brand); outline-offset: 2px; }
.check__text { flex: 1; color: var(--ink-2); }
.check input:checked ~ .check__text { color: var(--ink); font-weight: 700; }
.check__num { font-size: 12px; color: var(--ink-3); }

.range { position: relative; height: 30px; display: flex; align-items: center; }
.range::before,
.range::after {
  content: ''; position: absolute; left: 0; right: 0; height: 4px; border-radius: 2px;
  pointer-events: none;
}
.range::before { background: var(--line); }
.range::after {
  background: var(--brand);
  left: calc(var(--p, 0) * 100%);
  right: calc((1 - var(--q, 1)) * 100%);
}
.range input[type=range] {
  position: absolute; width: 100%; pointer-events: none; appearance: none; background: none; height: 30px;
}
.range input[type=range]::-webkit-slider-runnable-track { background: transparent; height: 4px; }
.range input[type=range]::-moz-range-track { background: transparent; height: 4px; }
.range input[type=range]::-webkit-slider-thumb {
  appearance: none; pointer-events: all; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 2px solid var(--brand); box-shadow: var(--sh-1); cursor: grab; margin-top: 0;
}
.range input[type=range]::-moz-range-thumb {
  pointer-events: all; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 2px solid var(--brand); box-shadow: var(--sh-1); cursor: grab;
}
#priceMin { z-index: 2; }
#priceMax { z-index: 1; }
.range__values { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; margin-top: 6px; }

.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; color: var(--ink-2); }
.switch input { position: absolute; opacity: 0; }
.switch__track {
  width: 40px; height: 23px; flex: none; border-radius: 999px; background: var(--line);
  padding: 3px; transition: background var(--t);
}
.switch__thumb {
  display: block; width: 17px; height: 17px; border-radius: 50%; background: #fff;
  box-shadow: var(--sh-1); transition: transform var(--t);
}
.switch input:checked + .switch__track { background: var(--brand); }
.switch input:checked + .switch__track .switch__thumb { transform: translateX(17px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--brand); outline-offset: 2px; }

.products__bar { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.products__count { color: var(--ink-2); font-size: 14px; flex: 1; }
.products__count b { color: var(--ink); }
.sort { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-3); }
.sort select {
  padding: 9px 34px 9px 12px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); cursor: pointer; appearance: none; font-size: 13.5px; font-weight: 600;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a2b3' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
}
.filters-toggle { display: none; }

.products__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }

.card {
  display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--sh-2); border-color: transparent; }
.card__media {
  position: relative; height: 152px; display: grid; place-items: center; overflow: hidden;
  background: var(--surface-2);
  background: linear-gradient(145deg, color-mix(in srgb, var(--gc) 14%, #fff), color-mix(in srgb, var(--gc) 4%, #fff));
}
.card__media::before {
  content: ''; position: absolute; width: 190px; height: 190px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--gc) 22%, transparent), transparent 70%);
}
.card__icon { position: relative; width: 74px; height: 74px; color: var(--gc); opacity: .85; }
.card__icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.card__tags { position: absolute; top: 10px; left: 10px; display: flex; flex-direction: column; gap: 5px; z-index: 1; }
.tag {
  align-self: flex-start; padding: 4px 9px; border-radius: 999px; font-size: 11.5px;
  font-weight: 800; letter-spacing: .01em; background: var(--ink); color: #fff;
}
.tag--sale { background: var(--brand); color: var(--brand-ink); }
.tag--hit { background: var(--accent); }
.tag--out { background: var(--ink-3); }
.card__group {
  position: absolute; bottom: 10px; left: 10px; padding: 4px 9px; border-radius: 999px;
  background: rgba(255,255,255,.86); backdrop-filter: blur(4px); font-size: 11.5px; font-weight: 700; color: var(--ink-2);
}

/* Фотография товара. Пока её нет — показывается иконка группы (см. .card__icon). */
.card__shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: var(--surface-2);
  cursor: zoom-in;
  display: block;
}

.card__photo { width: 100%; height: 100%; object-fit: cover; display: block; }

.card__shot:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }

.card__photos {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(28,36,44,.78);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
}

.card__zoom {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,.9);
  color: var(--ink-2);
  font-size: 14px;
  line-height: 28px;
  text-align: center;
  opacity: 0;
  transition: opacity .18s ease;
}

.card__shot:hover .card__zoom, .card__shot:focus-visible .card__zoom { opacity: 1; }

/* С фото подложка-подсветка группы не нужна */
.card__shot ~ .card__group { z-index: 1; }

.card__body { padding: 15px 16px 16px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.card__brand { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--ink-3); }
.card__brand b { color: var(--ink-2); font-weight: 800; font-size: 12.5px; letter-spacing: .01em; }
.card__rating { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--ink-2); }
.card__rating svg { width: 13px; height: 13px; fill: #f79009; stroke: none; }
.card__name { font-size: 15px; font-weight: 700; line-height: 1.35; letter-spacing: -.01em; }
.card__art { font-size: 12px; color: var(--ink-3); font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; }
.card__foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line-2); }
.card__price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.card__price b { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.card__price s { color: var(--ink-3); font-size: 14px; }
.card__stock { font-size: 12.5px; font-weight: 700; margin-top: 3px; }
.card__stock--in { color: var(--ok); }
.card__stock--few { color: var(--warn); }
.card__stock--out { color: var(--ink-3); }
.card__add { width: 100%; margin-top: 11px; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
/* Плашки активных фильтров. Пока фильтров нет, блок не должен держать
   пустой отступ — поэтому прячем контейнер, когда внутри пусто. */
.section__tools { margin: 0 0 22px auto; width: fit-content; }
.section__tools:not(:has(.chips > *)) { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-dark); font-size: 12.5px; font-weight: 700;
}
.chip button { display: grid; place-items: center; width: 16px; height: 16px; padding: 0; border: 0; border-radius: 50%;   background: rgba(224, 123, 66, .2); color: inherit; cursor: pointer; font-size: 13px; line-height: 1; }
.chip button:hover { background: var(--brand); color: var(--brand-ink); }
.chip--clear { background: var(--ink); color: #fff; cursor: pointer; border: 0; }
.chip--clear:hover { background: #000; }

.products__more { margin-top: 22px; }
.empty { text-align: center; padding: 60px 20px; }
.empty__icon { font-size: 44px; }
.empty h3 { margin: 14px 0 8px; font-size: 20px; }
.empty p { color: var(--ink-2); margin-bottom: 18px; }

/* ---------------- Advantages ---------------- */
.adv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 28px; }
.adv { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; }
.adv__icon { font-size: 30px; margin-bottom: 12px; }
.adv h3 { font-size: 17px; margin-bottom: 8px; }
.adv p { font-size: 13.5px; color: var(--ink-2); }

/* ---------------- News ----------------
   Новости идут друг под другом в одну колонку на всех ширинах.
   Отступы и кегли ужаты: блок не должен съедать высоту экрана */
.news-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 20px; }
.news-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px 18px;
  display: flex; flex-direction: column;
  min-width: 0;
}
.news-card__meta { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; flex-wrap: wrap; }
.news-card__tag {
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
  color: var(--brand-text); background: var(--brand-soft);
  border-radius: 999px; padding: 3px 9px;
}
.news-card__meta time { font-size: 12.5px; color: var(--ink-3); }
.news-card__title { font-size: 15.5px; margin-bottom: 5px; }

/* Заголовок новости открывает её целиком */
.news-card__link {
  display: block; width: 100%; padding: 0; border: 0;
  background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.news-card__link:hover { color: var(--brand-text); }
.news-card__link:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 4px; }

/* Текст приходит из редактора админки, поэтому это div с готовой разметкой */
.news-card__text { font-size: 13px; color: var(--ink-2); margin: 0; }
.news-card__text > *:first-child { margin-top: 0; }
.news-card__text > *:last-child { margin-bottom: 0; }
.news-card__text p { margin: 0 0 7px; }
.news-card__text h3 { font-size: 14px; margin: 10px 0 5px; }
.news-card__text h4 { font-size: 13px; margin: 9px 0 4px; }
.news-card__text ul, .news-card__text ol { margin: 0 0 7px; padding-left: 19px; }
.news-card__text li { margin-bottom: 2px; }
.news-card__text blockquote {
  margin: 8px 0; padding: 4px 11px;
  border-left: 3px solid var(--brand); color: var(--ink-3);
}
.news-card__text a { color: var(--brand-text); }
.news-card__text img { max-width: 100%; border-radius: 8px; }

/* На главной новость обрезана до анонса: полный текст открывается по клику */
.news-card__text--clamp {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card__more {
  margin-top: 10px; align-self: flex-start;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface-2); color: var(--brand-text);
  font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.news-card__more:hover { background: var(--brand-soft); border-color: var(--brand); }
.news-card__more:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.news-card__more-ph { color: var(--ink-3); font-weight: 400; }

/* Архив: остальные новости скрыты за кнопкой */
.news-more { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 10px; }
/* .news-more задаёт display, поэтому [hidden] из UA-таблицы нужно перебить явно */
.news-more[hidden] { display: none; }
.news-more__btn { margin-top: 12px; display: inline-flex; align-items: center; gap: 8px; }
.news-more__count {
  font-size: 12px; font-weight: 600; line-height: 1;
  color: var(--ink-2); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 9px;
}

/* ---------------- Footer ---------------- */
.footer { background: var(--ink); color: rgba(255,255,255,.72); padding: 52px 0 0; }
.footer__inner { display: grid; grid-template-columns: 1.6fr 1fr 1.2fr; gap: 36px; padding-bottom: 40px; }
.footer h4 { color: #fff; font-size: 14px; margin-bottom: 14px; }
.footer li { margin-bottom: 9px; font-size: 13.5px; }
.footer a:hover { color: #fff; }
/* fut.png — графика на прозрачном фоне (белых пикселей в файле нет), подложка не нужна */
.footer__brand { display: block; width: 200px; height: auto; }
.footer__bottom {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 18px 20px; border-top: 1px solid rgba(255,255,255,.12); font-size: 12.5px; color: rgba(255,255,255,.45);
}

/* ---------------- Drawer / Cart ---------------- */
.drawer-overlay {
  position: fixed; inset: 0; z-index: 90; background: rgba(16, 24, 40, .5);
  backdrop-filter: blur(2px); animation: fade .25s;
}
@keyframes fade { from { opacity: 0; } }

.drawer {
  position: fixed; top: 0; right: 0; z-index: 100; width: min(440px, 100%);
  height: 100dvh; display: flex; flex-direction: column; background: var(--surface);
  box-shadow: var(--sh-3); animation: slideIn .3s cubic-bezier(.32, .72, 0, 1);
}
@keyframes slideIn { from { transform: translateX(100%); } }

.drawer__head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 22px; border-bottom: 1px solid var(--line); flex: none;
}
.drawer__head h2 { font-size: 19px; }
.drawer__head h2 span { color: var(--ink-3); font-weight: 600; }
.drawer__close {
  width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line);
  border-radius: 9px; background: var(--surface); cursor: pointer; color: var(--ink-2); transition: all var(--t);
}
.drawer__close svg { width: 18px; height: 18px; }
.drawer__close:hover { background: var(--surface-2); color: var(--ink); border-color: var(--ink-3); }

.drawer__body { flex: 1; overflow-y: auto; padding: 16px 22px; }
.drawer__foot { flex: none; padding: 18px 22px 22px; border-top: 1px solid var(--line); background: var(--surface-2); }

.cart-item { display: grid; grid-template-columns: 62px 1fr; gap: 13px; padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.cart-item:last-child { border-bottom: 0; }
.cart-item__media {
  width: 62px; height: 62px; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface-2);
  background: linear-gradient(145deg, color-mix(in srgb, var(--gc) 16%, #fff), color-mix(in srgb, var(--gc) 5%, #fff));
  color: var(--gc);
}
.cart-item__media svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.cart-item__name { font-size: 13.5px; font-weight: 700; line-height: 1.35; }
.cart-item__meta { font-size: 12px; color: var(--ink-3); margin: 3px 0 9px; }
.cart-item__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.qty button {
  width: 30px; height: 30px; border: 0; background: var(--surface-2); cursor: pointer;
  color: var(--ink-2); font-size: 16px; line-height: 1; transition: background var(--t);
}
.qty button:hover { background: var(--line-2); color: var(--ink); }
.qty span { min-width: 34px; text-align: center; font-weight: 800; font-size: 13.5px; }
.cart-item__price { font-weight: 800; font-size: 15px; }
.cart-item__del { border: 0; background: none; color: var(--ink-3); cursor: pointer; padding: 4px; font-size: 12px; text-decoration: underline; }
.cart-item__del:hover { color: var(--danger); }

.cart-empty { text-align: center; padding: 60px 20px; }
.cart-empty div { font-size: 44px; }
.cart-empty h3 { margin: 14px 0 8px; font-size: 18px; }
.cart-empty p { color: var(--ink-2); font-size: 14px; }

.summary { margin-bottom: 16px; }
.summary__row { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-2); padding: 4px 0; }
.summary__row--total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; font-size: 19px; font-weight: 800; color: var(--ink); }
.summary__row--free { color: var(--ok); font-weight: 700; }

/* ---------------- Order ---------------- */
.drawer--order { width: min(560px, 100%); }
.order { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.order__body { flex: 1; overflow-y: auto; padding: 18px 22px; }
.order__block { margin-bottom: 26px; }
.order__block h3 { font-size: 15px; margin-bottom: 12px; }
.order__policy { font-size: 11.5px; color: var(--ink-3); text-align: center; margin-top: 12px; }

.radios { display: flex; flex-direction: column; gap: 8px; }
.radio { display: flex; align-items: flex-start; gap: 12px; padding: 13px 15px; border: 1.5px solid var(--line); border-radius: var(--r-sm); cursor: pointer; transition: all var(--t); }
.radio:hover { border-color: var(--ink-3); }
.radio input { position: absolute; opacity: 0; }
.radio:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.radio__mark { width: 19px; height: 19px; flex: none; margin-top: 2px; border: 1.8px solid var(--line); border-radius: 50%; position: relative; }
.radio input:checked + .radio__mark { border-color: var(--brand); }
.radio input:checked + .radio__mark::after {
  content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--brand);
}
.radio input:focus-visible + .radio__mark { outline: 2px solid var(--brand); outline-offset: 2px; }
.radio__text b { display: block; font-size: 14px; }
.radio__text i { font-style: normal; font-size: 12.5px; color: var(--ink-2); }

.drawer--success { width: min(420px, 100%); }
.success { padding: 40px 32px 32px; text-align: center; display: flex; flex-direction: column; height: 100%; }
.success__icon {
  width: 72px; height: 72px; margin: 0 auto 20px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ok-soft); color: var(--ok); font-size: 34px; font-weight: 800;
}
.success h2 { font-size: 24px; margin-bottom: 10px; }
.success > p { color: var(--ink-2); font-size: 14px; }
.success__box {
  display: flex; align-items: center; justify-content: space-between; margin: 24px 0 16px;
  padding: 16px 20px; background: var(--surface-2); border: 1px dashed var(--line); border-radius: var(--r);
}
.success__box span { font-size: 13px; color: var(--ink-2); }
.success__box b { font-size: 20px; letter-spacing: .04em; }
.success__note { font-size: 12.5px !important; margin-bottom: auto; }
.success .btn { margin-top: 24px; }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 120; transform: translateX(-50%);
  padding: 13px 22px; border-radius: 999px; background: var(--ink); color: #fff;
  font-weight: 700; font-size: 14px; box-shadow: var(--sh-2); animation: toastIn .3s;
  max-width: calc(100% - 32px); text-align: center;
}
.toast.ok { background: var(--ok); }
.toast.err { background: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 16px); } }

/* ---------------- Responsive ---------------- */
@media (max-width: 1180px) {
  .hero__inner { grid-template-columns: 1fr; gap: 34px; }
  .hero__card { max-width: 520px; }
}

@media (max-width: 1024px) {
  .footer__inner { grid-template-columns: 1fr 1fr; gap: 28px; }
  .footer__col:first-child { grid-column: 1 / -1; }
  .catalog { grid-template-columns: 1fr; }
  .catalog > .filters,
  .catalog > .catalog__car,
  .catalog > .products { grid-column: auto; grid-row: auto; }
  .catalog__car { margin-bottom: 18px; }
  .filters {
    position: fixed; top: 0; left: 0; z-index: 100; width: min(340px, 88vw); height: 100dvh;
    border-radius: 0; overflow-y: auto; transform: translateX(-100%); transition: transform .3s cubic-bezier(.32,.72,0,1);
  }
  .filters.open { transform: none; box-shadow: var(--sh-3); }
  .filters-toggle { display: inline-flex; }
}

@media (max-width: 860px) {
  .header__top { display: none; }
  .header__main { grid-template-columns: auto 1fr; grid-template-areas: 'logo cart' 'search search'; gap: 12px; }
  .logo { grid-area: logo; }
  .cart-btn { grid-area: cart; }
  .search { grid-area: search; }
  .cart-btn__label { display: none; }
  .search input { padding-right: 106px; }
  .filters { top: 0; }
}

@media (max-width: 720px) {
  .section { padding: 44px 0; }
  .hero { padding: 42px 0; }
  .hero__stats { gap: 24px; }
  .hero__stats b { font-size: 22px; }
  .grid2 { grid-template-columns: 1fr; }
  .footer__inner { grid-template-columns: 1fr; gap: 24px; }
  .products__bar { flex-wrap: wrap; }
  .sort { width: 100%; }
  .sort select { flex: 1; }
  .drawer__head, .drawer__body, .drawer__foot { padding-left: 16px; padding-right: 16px; }
}

@media (max-width: 480px) {
  .products__grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .card__media { height: 124px; }
  .card__name { font-size: 13.5px; }
  .card__price b { font-size: 17px; }
  .card__body { padding: 12px; }
  .hero h1 { font-size: 27px; }
  .logo__text { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}

/* ---------------- Catalog page ---------------- */
/* Текст только для экранных читалок: визуально скрыт, но доступен поиску и assistive-технологиям */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* Компактный подбор по автомобилю на светлом фоне */
.car-select--compact {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 20px 22px; box-shadow: var(--sh-1);
}
.car-select--compact h2 { font-size: 16px; margin-bottom: 14px; }
.car-select--compact .field > span { color: var(--ink-2); }
.car-select__row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: end; }
.car-select__row .field { margin-bottom: 0; }
.car-select__row .field > span { font-size: 11.5px; margin-bottom: 4px; }
.car-select__row .field select { padding: 10px 12px; padding-right: 34px; font-size: 13.5px; }
.car-select__row .field__static { padding: 10px 12px; font-size: 13.5px; }
.car-select__row .btn { white-space: nowrap; }
.car-select--compact .car-select__note {
  margin-top: 12px; font-size: 12.5px; color: var(--ink-2); text-align: left;
}
.car-select--compact .car-select__note.done { color: #0f9d58; }

/* Кнопка перехода в каталог на главной — протектор внедорожной шины:
   плитка tread.png (крупные блоки, широкие канавки, ряды смещены на половину шага,
   блоки завалены — направленный рисунок), сверху плотное затемнение: рисунок
   читается фактурой, а не блеском, и не спорит с оранжевой кнопкой */
.catalog-cta {
  display: grid; place-items: center;
  background-color: #232833;
  background-image:
    linear-gradient(180deg, rgba(14,20,32,.42), rgba(14,20,32,.20) 42%, rgba(14,20,32,.48)),
    url("../img/tread.png");
  background-size: auto, 96px 96px;
  background-repeat: no-repeat, repeat;
  border-block: 1px solid #0d1420;
}
.catalog-cta .container { display: grid; place-items: center; }
/* на тёмном фоне оранжевая кнопка сама даёт >3:1 по границе (WCAG 1.4.11),
   поэтому достаточно мягкой тени — светлое кольцо было бы лишним акцентом */
.catalog-cta .btn { box-shadow: 0 10px 24px rgba(0,0,0,.55); }

@media (max-width: 640px) {
  .car-select__row { grid-template-columns: 1fr 1fr; }
  .car-select__row .btn { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .car-select__row { grid-template-columns: 1fr; }
  .car-select__row .btn { grid-column: auto; }
  .car-select--compact { padding: 16px; }
  .logo__img { height: 42px; }
}

/* ------------------------------------------------------- просмотр фото */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox[hidden] { display: none; }

.lightbox__back {
  position: absolute;
  inset: 0;
  background: rgba(14, 19, 24, .88);
  backdrop-filter: blur(3px);
}

.lightbox__box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(1100px, 100%);
  max-height: 100%;
}

.lightbox__fig {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
}

.lightbox__img {
  display: block;
  max-width: min(1000px, calc(100vw - 140px));
  max-height: calc(100vh - 110px);
  border-radius: 8px;
  background: var(--surface-2);
  object-fit: contain;
}

.lightbox__cap {
  color: #cbd5de;
  font-size: 12.5px;
  text-align: center;
}

.lightbox__x, .lightbox__nav {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.lightbox__x:hover, .lightbox__nav:hover { background: rgba(255, 255, 255, .24); }
.lightbox__x:focus-visible, .lightbox__nav:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.lightbox__x {
  position: absolute;
  top: -46px;
  right: 0;
  font-size: 16px;
}

.lightbox__nav[hidden] { display: none; }

/* --------------------------------------------- открытая новость */

.newsview { z-index: 80; }

.newsview__box {
  position: relative;
  width: min(760px, 100%);
  max-height: 100%;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: 0 24px 60px rgba(14, 19, 24, .32);
  overflow: hidden;
}

.newsview__scroll {
  max-height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 22px 24px 26px;
}

.newsview__meta { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 8px; }
.newsview__meta time { font-size: 12.5px; color: var(--ink-3); }
.newsview__title { font-size: 21px; line-height: 1.28; margin: 0 0 12px; }
.newsview__text { font-size: 14.5px; color: var(--ink-2); }
.newsview__text p { margin: 0 0 9px; }
.newsview__text > *:last-child { margin-bottom: 0; }

/* Фотографии новости — только здесь, внутри открытой новости */
.newsview__photos {
  display: flex; flex-direction: column; gap: 10px; margin-top: 16px;
}
.newsview__photos:empty { margin-top: 0; }

.newsview__photo {
  padding: 0; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface-2); overflow: hidden; cursor: zoom-in; display: block;
}
.newsview__photo img { display: block; width: 100%; height: auto; }
.newsview__photo:hover { border-color: var(--brand); }
.newsview__photo:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.newsview__x {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  display: grid; place-items: center;
  width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%;
  background: var(--surface-2); color: var(--ink-2);
  font-size: 15px; line-height: 1; cursor: pointer;
}
.newsview__x:hover { background: var(--brand-soft); color: var(--brand-text); }
.newsview__x:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

@media (max-width: 640px) {
  .newsview { padding: 12px; }
  .newsview__scroll { padding: 18px 16px 20px; }
  .newsview__title { font-size: 18px; padding-right: 34px; }
}

@media (max-width: 640px) {
  .lightbox { padding: 12px; }
  .lightbox__img { max-width: calc(100vw - 32px); max-height: calc(100vh - 130px); }
  .lightbox__nav { width: 36px; height: 36px; }
}
