/* Шрифты лежат локально: витрина не делает ни одного внешнего запроса. */
@font-face {
  font-family: 'Poiret One';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/poiret-one-cyrillic-400-normal.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Poiret One';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/poiret-one-latin-400-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/fonts/onest-cyrillic-wght-normal.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/fonts/onest-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/fonts/onest-latin-ext-wght-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2113, U+A720-A7FF;
}

:root {
  --paper: #ffffff;
  --indigo: #1f2a5c;
  --wash: #e8ecf5;
  --fog: #5f6680;
  --seam: #d5dbe8;
  --selvedge: #b8323a;
  --online: #2e7d57;

  --font-display: 'Poiret One', 'Century Gothic', 'Futura', sans-serif;
  --font-text: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --gutter: 16px;
  --top-h: 56px;
  --bar-h: 73px;
  --radius-control: 6px;
  --radius-bubble: 18px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: var(--top-h);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--indigo);
  font: 400 16px/1.5 var(--font-text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 2px;
}

body.chat-open {
  overflow: hidden;
}

/* --- Шапка ----------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  height: var(--top-h);
  padding: 0 6px 0 var(--gutter);
  background: var(--paper);
  border-bottom: 1px solid var(--seam);
  transition: border-color 0.25s;
}

.topbar__back {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-left: -12px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.topbar__logo {
  font: 400 28px/1 var(--font-display);
  text-decoration: none;
  transition: opacity 0.3s, transform 0.3s;
}

.topbar__link {
  display: flex;
  align-items: center;
  height: 44px;
  margin-left: auto;
  padding: 0 10px;
  font-size: 15px;
  text-decoration: none;
}

.topbar__link[aria-current='page'] {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

.topbar__cart {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
}

.topbar__count {
  position: absolute;
  top: 5px;
  right: 3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--selvedge);
  color: var(--paper);
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
}

/* Пока огромный логотип героя на экране, шапка без логотипа и без линии. */
.topbar--bare {
  border-color: transparent;
}

.topbar--bare .topbar__logo {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

/* --- Каталог --------------------------------------------------------------- */

.hero {
  margin-bottom: 28px;
}

.hero__img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--wash);
}

.hero__link {
  display: block;
}

/* Кегль, отступ и поля логотипа выставляет fitWordmark() по реальным краям букв. */
.hero__mark {
  margin: 0;
  padding: 0 var(--gutter);
  font: 400 34vw/1 var(--font-display);
  white-space: nowrap;
}

.hero__lead {
  max-width: 34ch;
  margin: 22px 0 0;
  padding: 0 var(--gutter);
  font-size: 18px;
  line-height: 1.45;
}

.filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  padding: 0 var(--gutter);
  overflow-x: auto;
  scrollbar-width: none;
}

.filters::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: none;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--seam);
  border-radius: var(--radius-control);
  background: var(--paper);
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
}

.chip[aria-pressed='true'] {
  border-color: var(--indigo);
  background: var(--indigo);
  color: var(--paper);
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tile--wide {
  grid-column: 1 / -1;
}

.tile__link {
  display: block;
  text-decoration: none;
}

.tile__img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: var(--wash);
}

.tile__img--square {
  aspect-ratio: 1 / 1;
}

.tile__text {
  padding: 10px 10px 0;
}

.tile--wide .tile__text {
  padding: 12px var(--gutter) 0;
}

.tile__name {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
}

.tile__price {
  margin: 3px 0 0;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.price--sale {
  color: var(--selvedge);
}

.price__old {
  margin-left: 6px;
  color: var(--fog);
  font-weight: 400;
  text-decoration: line-through;
}

/* --- Капсула Paddock ------------------------------------------------------- */

/* Шапка капсулы инвертирует палитру марки: индиго вместо бумаги. */
.hero--night {
  padding-bottom: 32px;
  background: var(--indigo);
  color: var(--paper);
}

.capsule {
  margin-top: 40px;
}

.capsule__title {
  margin: 0;
  padding: 0 var(--gutter);
  font-size: 21px;
  font-weight: 500;
  line-height: 1.25;
}

.capsule__text {
  max-width: 46ch;
  margin: 6px 0 18px;
  padding: 0 var(--gutter);
  color: var(--fog);
  font-size: 15px;
}

.capsule__note {
  max-width: 46ch;
  margin: 20px 0 0;
  padding: 0 var(--gutter);
  color: var(--fog);
  font-size: 13px;
}

/* Питборд: табличка вместо фото у железа партнёров. Индекс модели
   подгоняется по ширине таблички (--fit выставляет fitPlates()). */
.plate {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  aspect-ratio: 3 / 4;
  padding: 14px 12px 12px;
  background: var(--indigo);
  color: var(--paper);
  container-type: inline-size;
}

.plate__brand,
.plate__kind {
  font-size: 13px;
  line-height: 1.3;
}

.plate__brand {
  font-weight: 500;
}

.plate__kind {
  color: var(--seam);
}

.plate__code {
  font: 400 calc(var(--fit, 30) * 1cqi) / 1 var(--font-display);
  white-space: nowrap;
}

.plate--big {
  width: 100%;
  padding: 24px var(--gutter);
}

.plate--big .plate__brand,
.plate--big .plate__kind {
  font-size: 16px;
}

.plate--mini {
  width: 72px;
  height: 96px;
  padding: 6px;
  justify-content: center;
}

.plate--mini .plate__brand,
.plate--mini .plate__kind {
  display: none;
}

/* --- Товар ----------------------------------------------------------------- */

body.has-buybar {
  padding-bottom: calc(var(--bar-h) + var(--safe-b));
}

.product__img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: var(--wash);
}

.product__info {
  max-width: 560px;
  padding: 18px var(--gutter) 8px;
}

.product__figure {
  margin: 0;
}

.product__img--wide {
  aspect-ratio: 3 / 2;
}

.credit {
  margin: 8px 0 0;
  padding: 0 var(--gutter);
  color: var(--fog);
  font-size: 12px;
}

.credit a {
  color: inherit;
}

.product__brand {
  margin: 0 0 4px;
  color: var(--fog);
  font-size: 15px;
}

.specs {
  margin: 24px 0 0;
  border-top: 1px solid var(--seam);
}

.specs__row {
  display: grid;
  grid-template-columns: 7.5em 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--seam);
  font-size: 15px;
}

.specs__row dt {
  color: var(--fog);
}

.specs__row dd {
  margin: 0;
}

.product__name {
  margin: 0;
  font-size: 21px;
  font-weight: 500;
  line-height: 1.25;
}

.product__price {
  margin: 6px 0 0;
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.field {
  margin-top: 24px;
}

.field__label {
  margin: 0 0 10px;
  color: var(--fog);
  font-size: 14px;
}

.field__value {
  color: var(--indigo);
}

.swatches {
  display: flex;
  gap: 12px;
}

.swatch {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--seam);
  border-radius: 50%;
  cursor: pointer;
}

.swatch[aria-pressed='true'] {
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--indigo);
}

.sizes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.size {
  min-width: 54px;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--seam);
  border-radius: var(--radius-control);
  background: var(--paper);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

.size[aria-pressed='true'] {
  border-color: var(--indigo);
  background: var(--indigo);
  color: var(--paper);
}

.field__error {
  margin: 10px 0 0;
  color: var(--selvedge);
  font-size: 14px;
}

.product__model {
  margin: 12px 0 0;
  color: var(--fog);
  font-size: 14px;
}

.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--indigo);
  font-size: 15px;
  text-align: left;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
}

.product__ask {
  margin-top: 14px;
}

.product__about {
  max-width: 60ch;
  margin: 28px 0 20px;
}

.more {
  border-top: 1px solid var(--seam);
}

.more:last-of-type {
  border-bottom: 1px solid var(--seam);
}

.more__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  font-weight: 500;
  list-style: none;
  cursor: pointer;
}

.more__summary::-webkit-details-marker {
  display: none;
}

.more__summary::after {
  content: '+';
  font-size: 22px;
  font-weight: 300;
}

.more[open] .more__summary::after {
  content: '−';
}

.more__body {
  margin: 0 0 14px;
  font-size: 15px;
}

.buybar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  display: flex;
  gap: 8px;
  padding: 12px var(--gutter) calc(12px + var(--safe-b));
  border-top: 1px solid var(--seam);
  background: var(--paper);
}

.buybar__chat {
  display: grid;
  flex: none;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--indigo);
  border-radius: var(--radius-control);
  background: var(--paper);
  cursor: pointer;
}

/* --- Кнопки и поля --------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 20px;
  border: 1px solid var(--indigo);
  border-radius: var(--radius-control);
  background: var(--indigo);
  color: var(--paper);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

.button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.button--quiet {
  background: var(--paper);
  color: var(--indigo);
}

.button--grow {
  flex: 1;
}

.button--block {
  width: 100%;
}

.input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--seam);
  border-radius: var(--radius-control);
  background: var(--paper);
  color: var(--indigo);
  font: inherit;
  font-size: 16px;
}

.input:focus {
  border-color: var(--indigo);
  outline: none;
}

/* --- Промокод -------------------------------------------------------------- */

.promo {
  margin-top: 28px;
}

.promo__label {
  display: block;
  margin-bottom: 10px;
  color: var(--fog);
  font-size: 14px;
}

.promo__row {
  display: flex;
  gap: 8px;
}

.promo__msg {
  margin: 10px 0 0;
  color: var(--selvedge);
  font-size: 14px;
}

.promo--on {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-control);
  background: var(--wash);
}

.promo--on p {
  margin: 0;
  font-size: 15px;
}

/* --- Корзина --------------------------------------------------------------- */

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 28px var(--gutter) 24px;
}

.page__title {
  margin: 0 0 24px;
  font: 400 48px/1 var(--font-display);
}

.page__text {
  margin: 0 0 24px;
}

.cart-list {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--seam);
  list-style: none;
}

.cart-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--seam);
}

.cart-row__img {
  width: 72px;
  height: 96px;
  object-fit: cover;
  background: var(--wash);
}

.cart-row__img--contain {
  object-fit: contain;
}

.cart-row__name {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
}

.cart-row__meta {
  margin: 4px 0 0;
  color: var(--fog);
  font-size: 14px;
}

.cart-row__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

.cart-row__price {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--seam);
  border-radius: var(--radius-control);
}

.stepper__btn {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 18px;
  cursor: pointer;
}

.stepper__qty {
  min-width: 20px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.summary {
  margin: 24px 0 0;
}

.summary__row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.summary__row dt,
.summary__row dd {
  margin: 0;
}

.summary__row--total {
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--seam);
  font-size: 18px;
  font-weight: 600;
}

.checkout {
  display: flex;
  gap: 8px;
  margin-top: 24px;
}

.checkout__info {
  display: grid;
  flex: none;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--seam);
  border-radius: var(--radius-control);
  background: var(--paper);
  color: var(--fog);
  cursor: pointer;
}

.checkout__info[aria-expanded='true'] {
  border-color: var(--indigo);
  color: var(--indigo);
}

/* Плашка-подсказка под строкой оформления; хвостик смотрит на кнопку ⓘ. */
.note-bubble {
  position: relative;
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: var(--radius-control);
  background: var(--indigo);
  color: var(--paper);
  font-size: 14px;
  line-height: 1.45;
}

.note-bubble::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 18px;
  width: 12px;
  height: 12px;
  background: var(--indigo);
  transform: rotate(45deg);
}

/* --- Подвал ---------------------------------------------------------------- */

.footer {
  margin-top: 56px;
  padding: 40px var(--gutter) calc(32px + var(--safe-b));
  border-top: 1px solid var(--seam);
  color: var(--fog);
  font-size: 14px;
}

.footer p {
  max-width: 46ch;
  margin: 0 0 6px;
}

.footer .footer__mark {
  margin-bottom: 16px;
  color: var(--indigo);
  font: 400 36px/1 var(--font-display);
}

/* --- Тост ------------------------------------------------------------------ */

.toast {
  position: fixed;
  right: var(--gutter);
  bottom: calc(16px + var(--safe-b));
  left: var(--gutter);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-control);
  background: var(--indigo);
  color: var(--paper);
  font-size: 15px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
}

.toast.is-visible {
  opacity: 1;
  transform: none;
}

.toast a {
  flex: none;
  color: var(--paper);
  font-weight: 500;
}

body.has-buybar .toast {
  bottom: calc(var(--bar-h) + 12px + var(--safe-b));
}

/* --- Чат ------------------------------------------------------------------- */

.chat {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  background: var(--paper);
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.chat.is-open {
  transform: none;
}

.chat__head {
  display: flex;
  flex: none;
  align-items: center;
  gap: 12px;
  height: 60px;
  padding: 0 6px 0 var(--gutter);
  border-bottom: 1px solid var(--seam);
}

.chat__avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--indigo);
  color: var(--paper);
  font: 400 24px/1 var(--font-display);
}

.chat__title {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.chat__title strong {
  font-size: 16px;
  font-weight: 600;
}

.chat__status {
  color: var(--fog);
  font-size: 13px;
}

.chat__status[data-kind='online']::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--online);
  vertical-align: 1px;
}

.chat__close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-left: auto;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.chat__log {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  padding: 16px var(--gutter);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.msg {
  position: relative;
  display: flex;
  flex-direction: column;
  max-width: 82%;
  touch-action: pan-y;
  transition: transform 0.18s ease;
}

.msg.is-swiping {
  transition: none;
}

/* Значок ответа выезжает слева, пока сообщение тянут вправо. */
.msg::before {
  content: '';
  position: absolute;
  top: 50%;
  left: -34px;
  width: 26px;
  height: 26px;
  margin-top: -13px;
  border-radius: 50%;
  background: var(--wash) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10 7 5 12l5 5M5 12h9a5 5 0 0 1 5 5v1' fill='none' stroke='%231f2a5c' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat;
  opacity: 0;
  transition: opacity 0.15s;
}

.msg.is-swiping::before {
  opacity: 0.45;
}

.msg.is-armed::before {
  opacity: 1;
}

.msg__line {
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
}

.msg--me .msg__line {
  flex-direction: row-reverse;
}

.msg--me {
  align-self: flex-end;
  align-items: flex-end;
}

.msg--them {
  align-self: flex-start;
  align-items: flex-start;
}

.msg__text {
  min-width: 0;
  margin: 0;
  padding: 9px 13px;
  border-radius: var(--radius-bubble);
  font-size: 16px;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.msg--me .msg__text {
  border-bottom-right-radius: 6px;
  background: var(--indigo);
  color: var(--paper);
}

.msg--them .msg__text {
  border-bottom-left-radius: 6px;
  background: var(--wash);
}

.msg__meta {
  margin-top: 4px;
  color: var(--fog);
  font-size: 12px;
}

.msg__meta[data-state='failed'] {
  color: var(--selvedge);
}

/* Кнопка меню сообщения: видна при наведении, на тач-экранах вместо неё
   долгое нажатие и свайп. */
.msg__more {
  display: grid;
  flex: none;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--fog);
  opacity: 0;
  cursor: pointer;
}

.msg:hover .msg__more,
.msg.is-active .msg__more,
.msg__more:focus-visible {
  opacity: 1;
}

.msg.is-active .msg__text {
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--seam);
}

.msg.is-flash .msg__text {
  animation: msg-flash 1.2s ease-out;
}

@keyframes msg-flash {
  0%,
  35% {
    box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--fog);
  }
  100% {
    box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px transparent;
  }
}

@media (hover: none) {
  .msg__more {
    display: none;
  }

  .msg__text {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }
}

/* Цитата внутри ответа; нажатие прокручивает к оригиналу. */
.msg__quote {
  display: -webkit-box;
  width: 100%;
  margin: 0 0 6px;
  padding: 4px 8px;
  overflow: hidden;
  border: 0;
  border-left: 3px solid currentColor;
  border-radius: 4px;
  background: rgba(31, 42, 92, 0.08);
  color: inherit;
  font: inherit;
  font-size: 13px;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  opacity: 0.85;
  cursor: pointer;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.msg--me .msg__quote {
  background: rgba(255, 255, 255, 0.14);
}

.msg__reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.msg__reactions:empty {
  display: none;
}

.reaction {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 8px;
  border: 1px solid var(--seam);
  border-radius: 13px;
  background: var(--paper);
  color: var(--indigo);
  font-size: 13px;
  cursor: pointer;
}

.reaction[aria-pressed='true'] {
  border-color: var(--indigo);
  background: var(--wash);
}

.msg-menu {
  position: absolute;
  z-index: 2;
  padding: 6px;
  border: 1px solid var(--seam);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: 0 16px 32px -12px rgba(31, 42, 92, 0.45);
}

.msg-menu__reactions {
  display: flex;
  gap: 2px;
}

.msg-menu__emoji {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.msg-menu__emoji[aria-pressed='true'] {
  background: var(--wash);
}

.msg-menu__actions {
  display: flex;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--seam);
}

.msg-menu__action {
  flex: 1;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--indigo);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

.msg-menu__action:hover,
.msg-menu__emoji:hover {
  background: var(--wash);
}

.chat__reply {
  display: flex;
  flex: none;
  align-items: center;
  gap: 10px;
  padding: 8px 6px 8px var(--gutter);
  border-top: 1px solid var(--seam);
}

.chat__reply-text {
  flex: 1;
  min-width: 0;
  padding-left: 10px;
  border-left: 3px solid var(--indigo);
  font-size: 13px;
  line-height: 1.35;
}

.chat__reply-text strong {
  display: block;
  font-weight: 600;
}

.chat__reply-text span {
  display: block;
  overflow: hidden;
  color: var(--fog);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat__reply-cancel {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--fog);
  cursor: pointer;
}

.chat__reply:not([hidden]) + .msg-menu + .chat__bar,
.chat__reply:not([hidden]) + .chat__bar {
  border-top: 0;
}

.chat__note {
  align-self: center;
  max-width: 32ch;
  margin: 6px 0;
  color: var(--fog);
  font-size: 13px;
  text-align: center;
}

.chat__bar {
  display: flex;
  flex: none;
  gap: 8px;
  padding: 8px var(--gutter) calc(8px + var(--safe-b));
  border-top: 1px solid var(--seam);
}

.chat__input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 22px;
  background: var(--wash);
  color: var(--indigo);
  font: inherit;
  font-size: 16px;
}

.chat__input::placeholder {
  color: var(--fog);
}

.chat__input:focus-visible {
  outline-offset: 0;
}

.chat__send {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--indigo);
  color: var(--paper);
  cursor: pointer;
}

/* --- Планшет и десктоп ----------------------------------------------------- */

@media (min-width: 720px) {
  :root {
    --gutter: 24px;
  }

  body.chat-open {
    overflow: auto;
  }

  .chat {
    top: auto;
    right: 24px;
    bottom: 24px;
    left: auto;
    width: 380px;
    height: min(640px, calc(100vh - 48px));
    border: 1px solid var(--seam);
    border-radius: 12px;
    box-shadow: 0 24px 48px -20px rgba(31, 42, 92, 0.4);
    opacity: 0;
    transform: translateY(16px);
    transition: transform 0.22s, opacity 0.22s;
  }

  .chat.is-open {
    opacity: 1;
    transform: none;
  }

  .chat__head {
    border-radius: 12px 12px 0 0;
  }

  .toast {
    right: auto;
    left: 50%;
    min-width: 340px;
    transform: translate(-50%, 8px);
  }

  .toast.is-visible {
    transform: translate(-50%, 0);
  }
}

@media (min-width: 960px) {
  .hero {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 4fr);
    grid-template-rows: 1fr auto;
    gap: 0 40px;
    padding-right: var(--gutter);
  }

  .hero__link {
    grid-row: 1 / 3;
  }

  .hero__img {
    max-height: calc(100vh - var(--top-h));
  }

  .hero__mark {
    align-self: end;
    padding: 0;
  }

  .hero__lead {
    margin-bottom: 8px;
    padding: 0;
  }

  .filters {
    flex-wrap: wrap;
  }

  .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-flow: dense;
  }

  .tile--wide {
    grid-column: span 2;
    grid-row: span 2;
  }

  /* Широкая плитка занимает 2×2 ячейки: фото заполняет всё место над подписью
     и не раздувает высоту рядов. */
  .tile--wide .tile__link {
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  .tile--wide .tile__media {
    position: relative;
    flex: 1;
    min-height: 0;
  }

  .tile--wide .tile__img {
    position: absolute;
    inset: 0;
    height: 100%;
    aspect-ratio: auto;
  }

  body.has-buybar {
    padding-bottom: 0;
  }

  .product {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
    align-items: start;
    gap: 48px;
    padding-right: var(--gutter);
  }

  .product__media {
    position: sticky;
    top: var(--top-h);
  }

  .product__img,
  .plate--big {
    height: calc(100vh - var(--top-h));
    aspect-ratio: auto;
  }

  .plate--big {
    padding: 32px;
  }

  /* Горизонтальное фото железа не режем под высоту экрана. */
  .product__img--wide {
    height: auto;
    aspect-ratio: 3 / 2;
  }

  .product__info {
    padding: 40px 0 0;
  }

  .buybar {
    position: static;
    margin-top: 28px;
    padding: 0;
    border: 0;
  }

  body.has-buybar .toast {
    bottom: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .topbar,
  .topbar__logo,
  .toast,
  .chat,
  .msg,
  .msg::before {
    transition: none;
  }

  .msg.is-flash .msg__text {
    animation: none;
  }
}
