@font-face {
  font-family: "Montserrat";
  src: url("fonts/montserrat.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Roboto Condensed";
  src: url("fonts/roboto-condensed.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #18181a;
  --ink-2: #4a4a50;
  --muted: #7c7c84;
  --line: #e4e4e7;
  --bg: #f4f4f4;
  --card: #ffffff;
  --tile: #f4f4f4;
  --yellow: #fec200;
  --yellow-hover: #ffd23d;
  --yellow-soft: #fff4cc;
  --dark: #18181a;
  --dark-2: #232326;
  --danger: #c62828;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 8px 24px rgb(0 0 0 / 0.06);
  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-cond: "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 500 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3 { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }

/* ---------- шапка ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--dark);
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.04);
}
.topbar__row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 12px;
  height: 64px;
}
.logo img { height: 34px; width: auto; }
.search {
  display: flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 14px;
  background: #fff; border-radius: 12px;
  border: 2px solid transparent;
  transition: border-color .15s;
}
.search:focus-within { border-color: var(--yellow); }
.search svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 16px; }
.search input::placeholder { color: var(--muted); }

.cart-btn {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 16px;
  border-radius: 12px;
  background: var(--yellow); color: var(--ink);
  font-weight: 700; text-decoration: none;
  transition: background .15s;
}
.cart-btn:hover { background: var(--yellow-hover); }
.cart-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.icon-btn {
  width: 42px; height: 42px; padding: 0;
  display: grid; place-items: center;
  border: 0; border-radius: 12px;
  background: var(--dark-2); color: #fff;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: #333338; color: var(--yellow); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.cart-btn__count {
  min-width: 22px; height: 22px; padding: 0 6px;
  display: inline-grid; place-items: center;
  border-radius: 11px; background: var(--ink); color: #fff;
  font-size: 12px; font-weight: 700;
}

/* ---------- заголовок и фильтр ---------- */
.intro { padding: 28px 0 18px; }
.intro h1 {
  font-size: clamp(22px, 3.2vw, 32px);
  font-weight: 800; line-height: 1.15; letter-spacing: -0.01em;
  max-width: 820px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip {
  height: 38px; padding: 0 16px;
  border: 1.5px solid var(--line); border-radius: 19px;
  background: var(--card);
  font-size: 14px; font-weight: 600;
  transition: border-color .15s, background .15s;
}
.chip:hover { border-color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- сетка карточек ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding-bottom: 48px;
}
@media (min-width: 720px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; } }
@media (min-width: 1040px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; } }
.pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin: -16px 0 48px; }
.pager__btn {
  min-width: 44px; height: 44px; padding: 0 10px;
  border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--card); font-weight: 700; font-size: 15px;
  transition: border-color .15s, background .15s;
}
.pager__btn:hover:not(:disabled) { border-color: var(--ink-2); }
.pager__btn[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.pager__btn:disabled { opacity: 0.35; cursor: default; }
.pager__gap { min-width: 24px; text-align: center; color: var(--muted); }
.intro { scroll-margin-top: 72px; }
@media (max-width: 599px) { .intro { scroll-margin-top: 116px; } }

.card {
  display: flex; flex-direction: column;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow .2s;
}
.card:hover { box-shadow: var(--shadow); }
.card__media {
  position: relative; display: block;
  aspect-ratio: 3 / 4;
  background: var(--tile);
  border: 0; padding: 0; width: 100%;
  text-decoration: none;
}
.card__media > img { width: 100%; height: 100%; object-fit: cover; }
.card__media > img + img { position: absolute; inset: 0; opacity: 0; transition: opacity .12s; }
.card__media[data-slide="1"] > img + img { opacity: 1; }
.card__dots {
  position: absolute; left: 10px; right: 10px; bottom: 8px;
  display: flex; gap: 4px;
  opacity: 0; transition: opacity .15s;
}
.card__dots span { flex: 1; height: 3px; border-radius: 2px; background: rgb(0 0 0 / 0.18); }
.card__media[data-slide="0"] .card__dots span:first-child,
.card__media[data-slide="1"] .card__dots span:last-child { background: var(--ink); }
@media (hover: hover) { .card:hover .card__dots { opacity: 1; } }

.card__body { display: flex; flex-direction: column; flex: 1; gap: 6px; padding: 12px 12px 14px; }
.price { font-weight: 800; font-size: 20px; letter-spacing: -0.01em; white-space: nowrap; }
.card__title {
  font-family: var(--font-cond);
  font-size: 15px; font-weight: 500; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  text-decoration: none;
}
.card__title:hover { color: var(--ink-2); }
.card__meta {
  font-family: var(--font-cond); font-size: 13px; color: var(--muted); line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card__buy { margin-top: auto; padding-top: 8px; }

/* ---------- заглушка вместо фото ---------- */
.ph {
  container-type: inline-size;
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  width: 100%; aspect-ratio: 3 / 4;
  background: linear-gradient(180deg, #f7f7f7, #e9e9ea);
  text-align: center; color: var(--ink);
  overflow: hidden;
}
.ph__head {
  display: flex; justify-content: center;
  width: 100%; padding: 6cqw 0 5.5cqw;
  background: var(--dark);
  clip-path: polygon(0 0, 100% 0, 86% 100%, 14% 100%);
}
.ph__head img { width: 38cqw; height: auto; }
.ph__title {
  margin-top: 13cqw; padding: 0 8cqw;
  font: 800 8.2cqw/1.1 var(--font);
  text-transform: uppercase; letter-spacing: 0.01em;
  hyphens: auto;
}
.ph__bar {
  margin-top: 6cqw; padding: 1.8cqw 9cqw;
  background: var(--yellow);
  font: 700 5.2cqw/1.1 var(--font-cond);
  text-transform: uppercase; letter-spacing: 0.04em;
  clip-path: polygon(0 0, 100% 0, 94% 100%, 6% 100%);
}
.ph__fits {
  margin-top: auto; margin-bottom: 10cqw; padding: 0 8cqw;
  font: 700 5cqw/1.35 var(--font);
  text-transform: uppercase; color: var(--ink-2);
}
.ph--xs { background: var(--dark); justify-content: center; }
.ph--xs .ph__head { clip-path: none; padding: 0; }
.ph--xs .ph__head img { width: 80%; }
.ph--xs .ph__title, .ph--xs .ph__bar, .ph--xs .ph__fits { display: none; }
.gallery__ph { overflow: hidden; }
@media (min-width: 720px) { .gallery__ph { border-radius: var(--radius); } }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px;
  border: 0; border-radius: 12px;
  font-weight: 700; font-size: 15px; text-decoration: none;
  transition: background .15s, border-color .15s;
}
.btn--primary { background: var(--yellow); color: var(--ink); }
.btn--primary:hover { background: var(--yellow-hover); }
.btn--dark { background: var(--ink); color: #fff; }
.btn--dark:hover { background: #333338; }
.btn--ghost { background: transparent; border: 1.5px solid var(--line); }
.btn--ghost:hover { border-color: var(--ink-2); }
.btn--block { width: 100%; }
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.stepper {
  display: grid; grid-template-columns: 44px 1fr 44px;
  height: 44px; border-radius: 12px;
  background: var(--yellow-soft);
  overflow: hidden;
}
.stepper button {
  border: 0; background: transparent;
  font-size: 22px; font-weight: 600; line-height: 1;
}
.stepper button:hover { background: rgb(254 194 0 / 0.35); }
.stepper output { display: grid; place-items: center; font-weight: 700; }
.stepper--sm { grid-template-columns: 34px 36px 34px; height: 34px; border-radius: 10px; }
.stepper--sm button { font-size: 18px; }

/* ---------- модальные окна ---------- */
.sheet {
  width: 100%; max-width: 100%;
  height: 100%; max-height: 100%;
  margin: 0; padding: 0; border: 0;
  background: var(--card); color: var(--ink);
  overflow-y: auto; overscroll-behavior: contain;
}
.sheet::backdrop { background: rgb(12 12 14 / 0.55); }
.sheet__body { position: relative; min-height: 100%; }
.sheet__close {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 40px; height: 40px; border-radius: 20px;
  display: grid; place-items: center;
  border: 0; background: rgb(255 255 255 / 0.92);
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.12);
}
.sheet__close svg { width: 20px; height: 20px; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; }

@media (min-width: 720px) {
  .sheet--product {
    width: min(1080px, calc(100% - 48px)); height: auto; max-height: calc(100% - 48px);
    margin: auto; border-radius: 20px;
  }
  .sheet--cart {
    width: 460px; height: 100%; max-height: 100%;
    margin: 0 0 0 auto;
  }
}

/* ---------- карточка товара ---------- */
.pd { display: grid; gap: 20px; padding: 0 0 24px; }
@media (min-width: 720px) { .pd { grid-template-columns: minmax(0, clamp(260px, 42%, 470px)) minmax(0, 1fr); gap: 28px; padding: 24px; } }

.gallery { min-width: 0; }
.gallery__track {
  display: flex; overflow-x: auto;
  scroll-snap-type: x mandatory; scrollbar-width: none;
  background: var(--tile);
}
@media (min-width: 720px) { .gallery__track { border-radius: var(--radius); } }
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__track > img { flex: 0 0 100%; aspect-ratio: 3 / 4; object-fit: cover; scroll-snap-align: start; }
.gallery__thumbs { display: flex; gap: 8px; margin-top: 10px; padding: 0 16px; }
@media (min-width: 720px) { .gallery__thumbs { padding: 0; } }
.gallery__thumbs button {
  width: 60px; aspect-ratio: 3 / 4; padding: 0;
  border: 2px solid transparent; border-radius: 8px; overflow: hidden;
  background: var(--tile);
}
.gallery__thumbs button[aria-current="true"] { border-color: var(--ink); }
.gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; }

.pd__info { display: flex; flex-direction: column; gap: 18px; padding: 0 16px; min-width: 0; }
@media (min-width: 720px) { .pd__info { padding: 8px 36px 0 0; } }
.pd__title { font-size: clamp(20px, 2.4vw, 26px); font-weight: 800; line-height: 1.2; }
.pd__fits { font-family: var(--font-cond); font-size: 16px; color: var(--ink-2); margin-top: 6px; }
.pd__buybox {
  display: grid; gap: 12px;
  padding: 16px; border-radius: var(--radius);
  background: var(--bg);
}
.pd__buybox .price { font-size: 28px; }
.pd__kit { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-flex; align-items: center; height: 26px; padding: 0 10px;
  border-radius: 8px; background: var(--yellow); color: var(--ink);
  font-family: var(--font-cond); font-size: 14px; font-weight: 700;
}
.tag--soft { background: var(--card); color: var(--ink-2); font-weight: 500; }

.spec h3 {
  font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 8px;
}
.spec ul { list-style: none; margin: 0; padding: 0; }
.spec li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--line);
  font-family: var(--font-cond); font-size: 16px;
}
.spec li span:last-child { color: var(--ink-2); text-align: right; }
.oem { display: grid; gap: 12px; }
.oem__item { font-family: var(--font-cond); font-size: 15px; }
.oem__name { font-weight: 700; margin-bottom: 4px; }
.oem__row { display: grid; grid-template-columns: 150px 1fr; gap: 8px; padding: 3px 0; color: var(--ink-2); }
.oem__row code { font-family: var(--font-cond); font-weight: 600; color: var(--ink); letter-spacing: 0.02em; }

/* ---------- корзина ---------- */
.cart { display: flex; flex-direction: column; min-height: 100%; }
.cart__head { display: flex; align-items: center; gap: 4px; padding: 14px 64px 0 16px; }
.cart__tab {
  height: 40px; padding: 0 14px; border: 0; border-radius: 10px;
  background: transparent; font-weight: 700; font-size: 17px; color: var(--muted);
}
.cart__tab[aria-selected="true"] { color: var(--ink); background: var(--bg); }
.cart__list { list-style: none; margin: 0; padding: 8px 16px; flex: 1; }
.cart__line {
  display: grid; grid-template-columns: 64px 1fr; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.cart__thumb { display: block; width: 64px; border-radius: 8px; overflow: hidden; }
.cart__thumb > img { width: 64px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 8px; background: var(--tile); }
.cart__line-title { font-family: var(--font-cond); font-size: 15px; line-height: 1.3; }
.cart__line-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.cart__line-sum { font-weight: 800; white-space: nowrap; }
.link-btn { border: 0; background: none; padding: 0; color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 2px; }
.link-btn:hover { color: var(--danger); }
.link-btn--danger { color: var(--danger); font-weight: 700; }
.order__forget { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px; font-size: 14px; }
.cart__foot {
  position: sticky; bottom: 0;
  display: grid; gap: 12px;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  background: var(--card); border-top: 1px solid var(--line);
}
.cart__total { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; }
.cart__total .price { font-size: 24px; }
.cart__empty { padding: 48px 16px; text-align: center; color: var(--muted); display: grid; gap: 16px; justify-items: center; }

.order {
  display: grid; gap: 14px;
  margin: 12px 16px; padding: 18px;
  border-radius: var(--radius); background: var(--bg);
}
.order--fresh { background: var(--yellow-soft); }
.order__no { font-size: 13px; color: var(--muted); font-weight: 600; }
.order__no b { display: block; font-size: 26px; color: var(--ink); letter-spacing: 0.02em; margin-top: 2px; }
.order__ttl { margin-top: -6px; font-size: 14px; font-weight: 600; color: var(--danger); }
.order__lines { list-style: none; margin: 0; padding: 0; font-family: var(--font-cond); font-size: 15px; }
.order__lines li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.order__lines li span:last-child { white-space: nowrap; font-weight: 600; }
.order__phone { font-size: 22px; font-weight: 800; text-decoration: none; }
.order__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ---------- пустой поиск, тост ---------- */
.empty { display: grid; justify-items: center; gap: 14px; padding: 40px 0 80px; color: var(--ink-2); }
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 100;
  transform: translateX(-50%);
  padding: 12px 18px; border-radius: 12px;
  background: var(--ink); color: #fff; font-weight: 600; font-size: 14px;
  box-shadow: var(--shadow);
}

/* ---------- подвал ---------- */
.footer { background: var(--dark); color: #d9d9de; padding: 40px 0 28px; }
.footer__grid { display: grid; gap: 28px; }
@media (min-width: 720px) { .footer__grid { grid-template-columns: 1fr 1fr 1.3fr; } }
.footer__logo { height: 44px; width: auto; }
.footer__title { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--yellow); margin-bottom: 12px; }
.footer__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-family: var(--font-cond); font-size: 16px; }
.footer__list a { text-decoration: none; }
.footer__list a:hover { color: var(--yellow); }
.footer__list .muted { color: #8e8e96; }
.footer__mp {
  margin-top: 14px; padding: 0; border: 0; background: none;
  color: var(--yellow); font-family: var(--font-cond); font-size: 16px; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px;
}
.footer__mp:hover { color: var(--yellow-hover); }

.modal {
  width: min(380px, calc(100% - 32px));
  padding: 28px 20px 20px; border: 0; border-radius: 20px;
  background: var(--card); color: var(--ink);
}
.modal::backdrop { background: rgb(12 12 14 / 0.55); }
.modal__title { font-size: 20px; font-weight: 800; margin: 0 44px 18px 4px; }
.modal--notice { width: min(340px, calc(100% - 32px)); padding: 24px 20px 20px; }
.notice__text { margin: 0 0 18px; font-size: 16px; font-weight: 600; line-height: 1.4; text-align: center; }

.login { display: grid; gap: 12px; }
.field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input {
  height: 46px; padding: 0 14px;
  border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--card); font-size: 16px; font-weight: 500; color: var(--ink);
  outline: 0; transition: border-color .15s;
}
.field input:focus { border-color: var(--yellow); }
.login .btn { margin-top: 6px; }
.login__error { margin: 0; color: var(--danger); font-size: 14px; font-weight: 600; }
.login__alt { margin-top: 16px; text-align: center; font-size: 14px; color: var(--muted); }
.link-btn--strong { color: var(--ink); font-size: 14px; font-weight: 700; }
.link-btn--strong:hover { color: var(--ink-2); }
.mp__links { display: grid; gap: 10px; }
.mp__link { height: 52px; font-size: 17px; }
.mp__link[data-mp="OZON"] { background: #005bff; color: #fff; }
.mp__link[data-mp="OZON"]:hover { background: #1f6fff; }
.mp__link[data-mp="Я.Маркет"] { background: #ffdd2d; color: #000; }
.mp__link[data-mp="Я.Маркет"]:hover { background: #ffe666; }

.footer__legal {
  margin-top: 32px; padding-top: 20px; border-top: 1px solid #333338;
  font-family: var(--font-cond); font-size: 14px; color: #8e8e96;
  display: grid; gap: 6px;
}
.footer__legal p { margin: 0; }

/* ---------- узкие экраны ---------- */
@media (max-width: 599px) {
  .topbar__row { grid-template-columns: 1fr auto auto; grid-template-rows: 56px auto; height: auto; column-gap: 8px; row-gap: 0; padding-bottom: 10px; }
  .logo { justify-self: start; }
  .logo img { height: 28px; }
  .search { grid-column: 1 / -1; grid-row: 2; }
  .cart-btn { justify-self: end; padding: 0 12px; }
  .cart-btn__label { display: none; }
  .card__body { padding: 10px 10px 12px; }
  .price { font-size: 18px; }
  .card__title { font-size: 14px; }
  .oem__row { grid-template-columns: 1fr; gap: 0; }
}
