/* WM chrome: портальные Inter + html font-size 10px (как /extend/css/style.css). */
@font-face {
  font-family: Inter-Bold;
  src: url("/extend/fonts/Inter-Bold.ttf");
  font-display: swap;
}
@font-face {
  font-family: Inter-Medium;
  src: url("/extend/fonts/Inter-Medium.ttf");
  font-display: swap;
}
@font-face {
  font-family: Inter-SemiBold;
  src: url("/extend/fonts/Inter-SemiBold.ttf");
  font-display: swap;
}
@font-face {
  font-family: Inter-Regular;
  src: url("/extend/fonts/Inter-Regular.ttf");
  font-display: swap;
}

:root {
  --wm-chrome-bg: #f8f8f7;
  --wm-chrome-text: #353433;
  --wm-chrome-muted: #6b6562;
  --wm-chrome-accent: #e23737;
  --wm-chrome-border: #e4e2df;
}

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

html {
  font-size: 10px;
}

html,
body.wm-page {
  margin: 0;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--wm-chrome-bg);
  color: var(--wm-chrome-text);
  font-family: Inter-Medium, Inter-Regular, sans-serif;
}

body.wm-page {
  font-size: 1.6rem;
  line-height: 1.4;
}

body.wm-page.wm-mwv-embed .wm-chrome,
body.wm-page.wm-mwv-embed .wm-chrome-footer {
  display: none !important;
}

.wm-chrome {
  background: #fff;
  border-bottom: 1px solid var(--wm-chrome-border);
  position: relative;
  z-index: 40;
}

.wm-chrome__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.2rem 1.6rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  min-width: 0;
}

.wm-chrome__burger {
  display: none;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  flex: 0 0 auto;
}

.wm-chrome__burger span,
.wm-chrome__burger span::before,
.wm-chrome__burger span::after {
  display: block;
  width: 2rem;
  height: 0.2rem;
  background: #353433;
  border-radius: 1px;
  position: relative;
}
.wm-chrome__burger span::before,
.wm-chrome__burger span::after {
  content: '';
  position: absolute;
  left: 0;
}
.wm-chrome__burger span::before { top: -0.7rem; }
.wm-chrome__burger span::after { top: 0.7rem; }

.wm-chrome__brand {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: var(--wm-chrome-text);
  font-family: Inter-Bold, sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  flex-shrink: 1;
  min-width: 0;
}

.wm-chrome__brand img {
  height: 2.8rem;
  width: auto;
  display: block;
}

.wm-chrome__brand-sub {
  display: none;
}

.wm-chrome__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1.4rem;
  flex: 0 0 auto;
  min-width: 0;
}

/* Красная точка «есть избранное» — как в portal header.css */
.wm-chrome a.header-fav.fav-isset {
  position: relative;
}
.wm-chrome a.header-fav.fav-isset::before {
  content: '';
  position: absolute;
  top: -5px;
  right: -5px;
  width: 8px;
  height: 8px;
  background-color: #E23737;
  border-radius: 50%;
}

.wm-chrome__icon,
.wm-chrome__icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: var(--wm-chrome-text);
  text-decoration: none;
  position: relative;
}

.wm-chrome__login {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--wm-chrome-muted);
  font-size: 1.4rem;
  font-family: Inter-Regular, sans-serif;
}

.wm-chrome__avatar-btn {
  display: block;
  width: 3.2rem;
  height: 3.2rem;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 50%;
}

.wm-chrome__avatar {
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 1px solid transparent;
}

.wm-chrome__profile.is-open .wm-chrome__avatar {
  border-color: #9b3131;
}

.wm-chrome__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.8rem 1.6rem;
  border-radius: 1.2rem;
  background: var(--wm-chrome-accent);
  color: #fff;
  text-decoration: none;
  font-size: 1.2rem;
  line-height: 1.2;
  font-family: Inter-Medium, sans-serif;
  white-space: nowrap;
}

.wm-chrome__cta span { color: #fff; text-align: left; }
.wm-chrome__cta:hover { background: #e54d4d; color: #fff; }
.wm-chrome__cta svg { flex: 0 0 auto; }

.wm-chrome__profile,
.wm-chrome__notif { position: relative; }

.wm-chrome__popup {
  position: absolute;
  top: calc(100% + 1rem);
  right: 0;
  min-width: 22rem;
  background: #fff;
  border: 1px solid var(--wm-chrome-border);
  border-radius: 1.2rem;
  box-shadow: 0 1.2rem 2.8rem rgba(0, 0, 0, 0.12);
  padding: 1.2rem;
  z-index: 50;
  font-size: 1.4rem;
}

.wm-chrome__popup a {
  display: block;
  padding: 0.8rem 0.6rem;
  color: var(--wm-chrome-text);
  text-decoration: none;
}

.wm-chrome__popup a:hover { color: var(--wm-chrome-accent); }
.wm-chrome__popup-name {
  font-family: Inter-SemiBold, sans-serif;
  border-bottom: 1px solid var(--wm-chrome-border);
  margin-bottom: 0.4rem;
  padding-bottom: 1rem !important;
}
.wm-chrome__popup-exit {
  color: var(--wm-chrome-accent) !important;
  margin-top: 0.4rem;
  border-top: 1px solid var(--wm-chrome-border);
  padding-top: 1rem !important;
}
.wm-chrome__popup-title { margin: 0 0 0.8rem; font-family: Inter-SemiBold, sans-serif; }
.wm-chrome__popup-empty { margin: 0; color: var(--wm-chrome-muted); }

.wm-chrome__contour {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.6rem 1.2rem;
  min-width: 0;
}

/* Drawer (бургер) */
.wm-chrome__drawer {
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: #fff;
  padding: 1.6rem;
  display: none;
  flex-direction: column;
  gap: 1.2rem;
  overflow-y: auto;
}
.wm-chrome__drawer.is-open { display: flex; }
.wm-chrome__drawer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
}
.wm-chrome__drawer-close {
  width: 3.2rem;
  height: 3.2rem;
  border: 0;
  background: none;
  font-size: 2.8rem;
  line-height: 1;
  cursor: pointer;
  color: #353433;
}
.wm-chrome__drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 1.2rem;
}
.wm-chrome__drawer-nav a {
  display: block;
  padding: 1.2rem 0.4rem;
  color: #353433;
  text-decoration: none;
  font-size: 1.6rem;
  font-family: Inter-Medium, sans-serif;
  border-bottom: 1px solid #f0eeeb;
}
.wm-chrome__drawer-nav a:hover { color: var(--wm-chrome-accent); }

.wm-chrome-footer {
  border-top: 1px solid var(--wm-chrome-border);
  background: #fff;
  margin-top: 2.8rem;
}
.wm-chrome-footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.6rem 2.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem 2.4rem;
  align-items: center;
  color: var(--wm-chrome-muted);
  font-size: 1.4rem;
}
.wm-chrome-footer a { color: var(--wm-chrome-text); text-decoration: none; }
.wm-chrome-footer a:hover { color: var(--wm-chrome-accent); }
.wm-chrome-footer__copy { margin-left: auto; }

#open-chat.unread { position: relative; }
#open-chat.unread::after {
  content: '';
  position: absolute;
  top: -0.2rem;
  right: -0.2rem;
  width: 0.8rem;
  height: 0.8rem;
  background: var(--wm-chrome-accent);
  border-radius: 50%;
}

/* Контур: не раздувать подписи на узком экране */
body.wm-page .portal-contour-nav__label {
  font-family: Inter-Bold, sans-serif;
}
@media (max-width: 640px) {
  body.wm-page .portal-contour-nav__label {
    font-size: 1.2rem;
    padding: 0.8rem 0.4rem 1rem;
  }
  body.wm-page .wm-chrome__contour {
    padding-left: 1.2rem;
    padding-right: 1.2rem;
  }
}

/* Мобильная шапка как на портале ≤1000px: бургер | лого | bell/chat | + */
@media (max-width: 1000px) {
  .wm-chrome__burger { display: block; }

  .wm-chrome__inner {
    padding: 1.2rem 1.6rem;
    gap: 1rem;
  }

  .wm-chrome__brand {
    flex: 1 1 auto;
    justify-content: flex-start;
  }

  .wm-chrome__actions {
    gap: 1.2rem;
  }

  /* В баре: только уведомления/чат (если есть) + круглая CTA. Остальное — в бургере. */
  .wm-chrome__login,
  .wm-chrome__profile,
  .wm-chrome__desktop-only,
  a.header-fav {
    display: none !important;
  }

  .wm-chrome__cta span { display: none; }
  .wm-chrome__cta {
    width: 4.2rem;
    height: 4.2rem;
    border-radius: 50%;
    padding: 0;
  }

  .wm-chrome__contour {
    overflow: hidden;
  }
}

@media (min-width: 1001px) {
  .wm-chrome__mobile-only { display: none !important; }
}

/* Mobile: Шины / Диски / Колёса в сборе перед bottom-nav (вместо «В каталог…»). */
.wm-mobile-offer-switch {
  display: none;
}
@media (max-width: 900px) {
  body.wm-page .afyc-footer-plaque {
    display: none !important;
  }
  body.wm-page .wm-mobile-offer-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: stretch;
    margin: 16px 12px calc(56px + 18px + env(safe-area-inset-bottom, 0px));
    padding: 0;
    box-sizing: border-box;
  }
  body.wm-page .wm-mobile-offer-switch__item {
    flex: 1 1 calc(33.33% - 8px);
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px 8px;
    border: 1px solid rgba(226, 55, 55, 0.55);
    border-radius: 12px;
    background: #fff;
    color: #E23737;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    box-sizing: border-box;
  }
  body.wm-page .wm-mobile-offer-switch__item.is-active {
    background: #E23737;
    border-color: #E23737;
    color: #fff;
  }
}

/* Корзина: не уезжать за экран */
body.wm-page .wm-cart-fab {
  right: 1.6rem !important;
  left: auto !important;
  max-width: calc(100vw - 3.2rem);
}

/* Чипы: absolute input без position:relative у label раздувал scrollWidth */
body.wm-page .wm-filter-chip {
  display: inline-flex;
  align-items: center;
  padding-right: 6px;
  border-right: 1px solid #cecece;
  position: relative;
}
body.wm-page .wm-filter-chip input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}
body.wm-page .wm-filter-chips-wrap,
body.wm-page .wm-filter-chips {
  max-width: 100%;
  min-width: 0;
}
/* Sticky sidebar: .ap-home-field label {display:block} ломал ряд зима/лето/шипы */
body.wm-page .mp-sf__sidebar .wm-filter-chip:not([hidden]),
body.wm-page .mp-sf__sidebar label.wm-filter-chip:not([hidden]) {
  display: inline-flex !important;
  flex-direction: row;
  align-items: center;
}
body.wm-page .mp-sf__sidebar .wm-filter-chip[hidden],
body.wm-page .mp-sf__sidebar label.wm-filter-chip[hidden] {
  display: none !important;
}

/* FAB: не привязывать к трансформированным предкам / overflow-контейнерам */
body.wm-page .wm-cart-fab {
  position: fixed !important;
  right: 16px !important;
  left: auto !important;
  transform: none !important;
  z-index: 10040;
}
body.wm-page .wm-fav-fab {
  position: fixed !important;
  right: 76px !important;
  left: auto !important;
  transform: none !important;
  z-index: 10040;
}
@media (max-width: 900px) {
  /* Паритет AP: FAB 36px на строке fixed-поиска (header 50px) */
  body.wm-page .wm-cart-fab {
    right: 8px !important;
    top: calc(var(--mp-sf-sticky-top, 50px) + 10px) !important;
    bottom: auto !important;
  }
  body.wm-page .wm-fav-fab {
    right: 50px !important;
    top: calc(var(--mp-sf-sticky-top, 50px) + 10px) !important;
    bottom: auto !important;
  }
  body.wm-page .wm-cart-link,
  body.wm-page .wm-fav-link {
    width: 36px !important;
    height: 36px !important;
  }
  body.wm-page .wm-cart-link svg,
  body.wm-page .wm-fav-link svg {
    width: 18px !important;
    height: 18px !important;
  }
}

/* Контентная оболочка на всю ширину экрана; колонка — .wm-wrap. */
body.wm-page .new-container.td-wizard-shell,
body.wm-page .td-wizard-shell {
  max-width: 100%;
  min-width: 0;
  overflow-x: clip;
}
/* Портальный хеадер: полоса 100%, внутренности упакованы в контентную ширину. */
body.wm-page .header .new-container {
  max-width: 1220px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}
/* .wm-wrap — контентная колонка 1200px (не растягивать на весь экран) */
body.wm-page .wm-wrap {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  min-width: 0;
}
