@font-face {
  font-family: 'CSIcons';
  src: url('/Automotive_parts/assets/CSIcons.ttf?v=20261010cs1') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: block;
}

/**
 * Adaptive-слой автотоваров (VI breakpoint-дисциплина).
 * FREEZE desktop >1008px: не переписываем десктопную структуру —
 * только @media / .breakpoint-mobile и скрытие mobile-only виджетов на desktop.
 *
 * Scope: body.td-parts-page | .wm-page | .om-page | .mb-page | .afyc-hub-page
 */

/* ===== Mobile-only виджеты: на desktop полностью скрыты ===== */
.ks-mp-mobile-chips,
.ks-mp-bottom-nav,
.ks-mp-recv--mobile-only {
  display: none !important;
}

body.breakpoint-desktop .ks-mp-mobile-chips,
body.breakpoint-desktop .ks-mp-bottom-nav {
  display: none !important;
}

/* ===== Desktop restore (страховка) ===== */
@media (min-width: 1009px) {
  body.td-parts-page .ks-mp-mobile-chips,
  body.wm-page .ks-mp-mobile-chips,
  body.om-page .ks-mp-mobile-chips,
  body.mb-page .ks-mp-mobile-chips,
  body.afyc-hub-page .ks-mp-mobile-chips,
  body.td-parts-page .ks-mp-bottom-nav,
  body.wm-page .ks-mp-bottom-nav,
  body.om-page .ks-mp-bottom-nav,
  body.mb-page .ks-mp-bottom-nav,
  body.afyc-hub-page .ks-mp-bottom-nav {
    display: none !important;
  }
}

/* ===== Tokens ===== */
body.td-parts-page,
body.wm-page,
body.om-page,
body.mb-page,
body.afyc-hub-page {
  --ks-mp-accent: #e23737;
  --ks-mp-chip-radius: 12px;
  --ks-mp-hairline: 0.5px;
  --ks-mp-chip-bg: #fff;
  --ks-mp-chip-text: #1a1a1a;
  --ks-mp-chip-border: rgba(0, 0, 0, 0.12);
  --ks-mp-nav-bg: #ffffff;
  --ks-mp-nav-text: #4a4a4a;
  --ks-mp-recv-bg: #f6f6f9;
  --ks-mp-recv-text: #1a1a1a;
  --ks-mp-recv-muted: #6b6b70;
}

body.dark-theme.td-parts-page,
body.dark-theme.wm-page,
body.dark-theme.om-page,
body.dark-theme.mb-page,
body.dark-theme.afyc-hub-page,
body.td-parts-page.dark-theme,
body.wm-page.dark-theme,
body.om-page.dark-theme,
body.mb-page.dark-theme,
body.afyc-hub-page.dark-theme {
  --ks-mp-chip-bg: #1c1c1e;
  --ks-mp-chip-text: #f2f2f4;
  --ks-mp-chip-border: rgba(255, 255, 255, 0.16);
  --ks-mp-nav-bg: #121214;
  --ks-mp-nav-text: #a0a0a5;
  --ks-mp-recv-bg: #1c1c1e;
  --ks-mp-recv-text: #f2f2f4;
  --ks-mp-recv-muted: #a0a0a5;
}

/* ===== Блок получения (аддитивно, виден на всех ширинах) ===== */
.ks-mp-recv {
  margin: 10px 0 4px;
  padding: 10px 12px;
  border-radius: var(--ks-mp-chip-radius);
  background: var(--ks-mp-recv-bg);
  border: var(--ks-mp-hairline) solid var(--ks-mp-chip-border);
  color: var(--ks-mp-recv-text);
  font-size: 13px;
  line-height: 1.35;
}
.ks-mp-recv__city {
  color: var(--ks-mp-accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
}
.ks-mp-recv__city:focus-visible {
  outline: 2px solid var(--ks-mp-accent);
  outline-offset: 2px;
}
.ks-mp-recv__body {
  color: var(--ks-mp-recv-muted);
}
.ks-mp-recv__body strong {
  color: var(--ks-mp-recv-text);
  font-weight: 600;
}
.ks-mp-recv.is-loading .ks-mp-recv__body {
  opacity: 0.7;
}

/* ===== Mobile < 768 / breakpoint-mobile ===== */
@media (max-width: 767px) {
  body.td-parts-page,
  body.wm-page,
  body.om-page,
  body.mb-page,
  body.afyc-hub-page {
    overflow-x: clip;
  }

  /* Громоздкие desktop-фильтры → скрыть на ленте; в drawer (.mp-sf__sidebar) — показывать */
  body.breakpoint-mobile .ap-home-more-filters,
  body.breakpoint-mobile .ap-home-more-filters__grid,
  body.breakpoint-mobile .ap-home-search-box__row.ap-home-filter-actions--tools,
  body.breakpoint-mobile .wm-catalog-vehicle-filters .wm-filter-selects,
  body.breakpoint-mobile .part-offers-filter-select {
    display: none !important;
  }
  body.breakpoint-mobile .mp-sf__sidebar .ap-home-more-filters,
  body.breakpoint-mobile .mp-sf__sidebar .ap-home-more-filters__grid {
    display: flex !important;
    flex-direction: column;
  }

  /* Горизонтальная лента chips (mobile standard) */
  .ks-mp-mobile-chips {
    display: flex !important;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px 12px 10px;
    margin: 0;
    scrollbar-width: none;
  }
  .ks-mp-mobile-chips::-webkit-scrollbar {
    display: none;
  }
  .ks-mp-mobile-chips__chip {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0 14px;
    border-radius: var(--ks-mp-chip-radius);
    border: var(--ks-mp-hairline) solid var(--ks-mp-chip-border);
    background: var(--ks-mp-chip-bg);
    color: var(--ks-mp-chip-text);
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    white-space: nowrap;
  }
  .ks-mp-mobile-chips__chip.is-active {
    border-color: var(--ks-mp-accent);
    color: var(--ks-mp-accent);
  }

  /* Уже существующие chip-ленты — радиус/hairline под стандарт */
  body.breakpoint-mobile .ap-ads-catalog-chip,
  body.breakpoint-mobile .wm-filter-chip {
    border-radius: var(--ks-mp-chip-radius) !important;
    border-width: var(--ks-mp-hairline) !important;
    min-height: 44px;
  }

  /* Типоразмеры SERP: сколько влезет в ряд (не жёсткие 3 колонки) */
  body.breakpoint-mobile .wm-size-suggest__chips {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 6px;
  }
  body.breakpoint-mobile .wm-size-suggest__chip {
    width: auto;
    box-sizing: border-box;
    min-height: 44px;
    padding: 6px 4px;
    border-radius: var(--ks-mp-chip-radius) !important;
    border-width: var(--ks-mp-hairline) !important;
    font-size: 11px;
    line-height: 1.15;
    text-align: center;
    white-space: normal;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
  }

  /* Bottom Navigation Bar */
  .ks-mp-bottom-nav {
    display: flex !important;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1400;
    height: 56px;
    padding: 0 4px;
    align-items: stretch;
    justify-content: space-around;
    background: var(--ks-mp-nav-bg);
    border-top: var(--ks-mp-hairline) solid var(--ks-mp-chip-border);
    /* иначе iOS/Android могут раздуть подписи относительно DevTools */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }
  .ks-mp-bottom-nav__item {
    flex: 1 1 0;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--ks-mp-nav-text);
    text-decoration: none;
    font-weight: 400;
    line-height: 1.1;
    background: none;
    border: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  /* только подпись; style.css `span{16px}` иначе съедает */
  .ks-mp-bottom-nav__item-label,
  .ks-mp-bottom-nav__item > span:not(.ks-mp-bottom-nav__icon) {
    font-size: 13px !important;
    font-weight: 400;
    line-height: 1.1;
    color: inherit;
  }
  .ks-mp-bottom-nav__item.is-active {
    color: var(--ks-mp-accent);
  }
  .ks-mp-bottom-nav__icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    overflow: hidden;
    flex: 0 0 16px;
    font-size: 16px !important;
  }
  .ks-mp-bottom-nav__icon--cs {
    font-family: 'CSIcons', sans-serif !important;
    font-size: 16px !important;
    font-weight: normal;
    font-style: normal;
    font-variant: normal;
    text-transform: none;
    line-height: 16px;
    height: 16px;
    width: 16px;
    letter-spacing: 0;
    text-align: center;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  .ks-mp-bottom-nav__svg {
    display: block;
    width: 16px;
    height: 16px;
  }
  body.breakpoint-mobile .container-page,
  body.breakpoint-mobile .wrapper,
  body.breakpoint-mobile .wm-wrap,
  body.breakpoint-mobile .afyc-hub__wrap {
    padding-bottom: 72px !important;
  }

  /* Adaptive mobile: site footer лишний (есть bottom-nav). Desktop >767 не трогаем. */
  body.breakpoint-mobile.td-parts-page .big_wrapper-footer,
  body.breakpoint-mobile.wm-page .big_wrapper-footer,
  body.breakpoint-mobile.om-page .big_wrapper-footer,
  body.breakpoint-mobile.mb-page .big_wrapper-footer,
  body.breakpoint-mobile.afyc-hub-page .big_wrapper-footer,
  body.breakpoint-mobile.td-parts-page footer.footer,
  body.breakpoint-mobile.wm-page footer.footer,
  body.breakpoint-mobile.om-page footer.footer,
  body.breakpoint-mobile.mb-page footer.footer,
  body.breakpoint-mobile.afyc-hub-page footer.footer {
    display: none !important;
  }

  /*
   * FAB «наверх» + support — выше bottom-nav (56px + safe-area),
   * стеком без наезда на «Профиль» и друг на друга.
   * arrow ≈ 42px; зазоры 14 / 12.
   */
  body.td-parts-page .arrow-up,
  body.wm-page .arrow-up,
  body.om-page .arrow-up,
  body.mb-page .arrow-up,
  body.afyc-hub-page .arrow-up {
    bottom: calc(56px + 14px + env(safe-area-inset-bottom, 0px));
    right: 14px;
  }
  body.td-parts-page .ks-support-fab,
  body.wm-page .ks-support-fab,
  body.om-page .ks-support-fab,
  body.mb-page .ks-support-fab,
  body.afyc-hub-page .ks-support-fab {
    bottom: calc(56px + 14px + 42px + 12px + env(safe-area-inset-bottom, 0px));
    right: 14px;
  }
}

/* Tablet 768–1008: без bottom-bar, без ломки desktop-фильтров */
@media (min-width: 768px) and (max-width: 1008px) {
  .ks-mp-bottom-nav,
  .ks-mp-mobile-chips {
    display: none !important;
  }
}

/* ===== Hover isolation (нет залипания на таче) ===== */
@media (hover: none) {
  body.td-parts-page .catalog-slide:hover,
  body.td-parts-page .ap-home-feed-grid .catalog-slide:hover,
  body.wm-page .catalog-slide:hover,
  body.td-parts-page .mp-ads-card:hover,
  body.wm-page .wm-card:hover,
  body.om-page .om-card:hover,
  body.mb-page .mb-card:hover {
    box-shadow: none !important;
    transform: none !important;
    filter: none !important;
  }
}

@media (hover: hover) {
  /* Место для явных desktop-hover карточек; существующие hover в chrome CSS не трогаем. */
  body.td-parts-page .ks-mp-recv__city:hover {
    opacity: 0.85;
  }
}

/* Offer description: no horizontal overflow on narrow screens (**** / long OEM lines) */
@media (max-width: 1008px) {
  body.td-parts-page .mp-ads-wizard-preview-detail .items-catalog__description,
  body.td-parts-page .mp-ads-wizard-preview-detail .items-catalog__description-item,
  body.td-parts-page .mp-ads-wizard-preview-detail .items-catalog__content_block,
  body.wm-page .mp-ads-wizard-preview-detail .items-catalog__content_block,
  body.om-page .mp-ads-wizard-preview-detail .items-catalog__content_block,
  body.mb-page .mp-ads-wizard-preview-detail .items-catalog__content_block {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  body.td-parts-page .mp-ads-wizard-preview-detail .items-catalog__content_block,
  body.wm-page .mp-ads-wizard-preview-detail .items-catalog__content_block,
  body.om-page .mp-ads-wizard-preview-detail .items-catalog__content_block,
  body.mb-page .mp-ads-wizard-preview-detail .items-catalog__content_block {
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-word;
    overflow-x: hidden;
  }
}

/* Sheet «Что вы хотите разместить?» — как МП PostAdContourSheet (раздел «Для авто»). */
.ks-mp-place-sheet {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.ks-mp-place-sheet.is-open {
  display: flex;
}
.ks-mp-place-sheet__bg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}
.ks-mp-place-sheet__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  max-height: min(90vh, 480px);
  overflow: auto;
  background: #fff;
  color: #353433;
  border-radius: 16px 16px 0 0;
  padding: 16px 12px calc(16px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.16);
}
body.dark-theme .ks-mp-place-sheet__panel,
.dark-theme .ks-mp-place-sheet__panel {
  background: #1e1e1e;
  color: #eee;
}
.ks-mp-place-sheet__close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: #aaa;
}
.ks-mp-place-sheet__title {
  margin: 0 28px 12px 4px;
  font-size: 17px;
  font-weight: 600;
}
.ks-mp-place-sheet__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.ks-mp-place-sheet__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 100px;
  padding: 10px 8px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  border: 1.5px solid transparent;
  border-radius: 12px;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
}
.ks-mp-place-sheet__card.is-preselect,
.ks-mp-place-sheet__card:hover {
  border-color: #e23737;
}
.ks-mp-place-sheet__card.is-preselect .ks-mp-place-sheet__label {
  color: #e23737;
  font-weight: 700;
}
.ks-mp-place-sheet__icon {
  display: block;
  width: 52px;
  height: 52px;
  object-fit: contain;
}
.ks-mp-place-sheet__label {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
}

/* Хлебные крошки: только desktop; на адаптиве скрываем во всех MP-разделах */
@media (max-width: 1008px) {
  body.td-parts-page .breadcrumb-wrap,
  body.wm-page .breadcrumb-wrap,
  body.om-page .breadcrumb-wrap,
  body.mb-page .breadcrumb-wrap,
  body.afyc-hub-page .breadcrumb-wrap,
  body.breakpoint-mobile .breadcrumb-wrap {
    display: none !important;
  }

  /* После скрытия крошек H1 цеплял FAB избранного/корзины — отступ только на адаптиве */
  body.td-parts-page .items-catalog__title,
  body.wm-page .items-catalog__title,
  body.om-page .items-catalog__title,
  body.mb-page .items-catalog__title,
  body.breakpoint-mobile .items-catalog__title {
    padding-top: 12px;
    padding-bottom: 24px;
  }

  /* AFYC: без quick-chips; H1 ниже кругов избранного/корзины */
  body.afyc-hub-page .ks-mp-mobile-chips {
    display: none !important;
  }
  body.afyc-hub-page .afyc-hub__h1,
  body.afyc-hub-page .afyc-hub__intro {
    padding-top: 28px;
  }
}
