/* Article and price-list overrides. Keep these after the original block styles. */
.js-feed .t-feed__post-title,
.js-feed .t-feed__post-descr,
.js-feed .t-feed__parts-switch-btn,
.t-feed__post-popup,
.t-feed__post-popup .t-title,
.t-feed__post-popup .t-name,
.t-feed__post-popup .t-text,
.t-feed__post-popup .t-descr,
.js-catalog .t-name,
.js-catalog .t-descr,
.site-service-dialog .t-name,
.site-service-dialog .t-descr {
  font-family: 'SiteSans', Arial, sans-serif !important;
}

.site-feed-restored .t-feed__post-title,
.js-catalog .t-catalog__card .t-catalog__card__title {
  font-size: clamp(18px, 1.55vw, 22px) !important;
  line-height: 1.35 !important;
  overflow-wrap: anywhere;
  white-space: normal;
}

.site-feed-restored .t-feed__post-descr,
.js-catalog .t-catalog__card .t-catalog__card__descr {
  font-size: 16px !important;
  line-height: 1.55 !important;
  overflow-wrap: anywhere;
}

.js-feed .t-feed__parts-switch-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.js-feed .t-feed__parts-switch-btn {
  max-width: 100%;
  margin: 0;
  font-size: 16px !important;
  line-height: 1.4;
}

.js-feed .t-feed__parts-switch-btn a {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  min-height: 44px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.site-feed-restored .t-feed__post-tag,
.t-feed__post-popup .t-feed__post-popup__tag,
.t-feed__post-popup .t-feed__post-popup__relevants-item-tag {
  font-family: 'SiteSans', Arial, sans-serif;
  font-size: 14px !important;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.t-feed__post-popup .t-feed__post-popup__content-wrapper,
.t-feed__post-popup .t-feed__post-popup__content,
.t-feed__post-popup .t-feed__post-popup__relevants-textwrapper {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}

.t-feed__post-popup .t-feed__post-popup__title {
  font-size: clamp(28px, 3.7vw, 46px) !important;
  line-height: 1.2 !important;
  overflow-wrap: anywhere;
}

.t-feed__post-popup .t-feed__post-popup__text,
.site-service-dialog .t-catalog__prod-popup__text {
  font-size: clamp(16px, 1.5vw, 18px) !important;
  line-height: 1.65 !important;
  overflow-wrap: anywhere;
}

.t-feed__post-popup .t-feed__post-popup__text :is(h2, h3, h4),
.site-service-dialog .t-catalog__prod-popup__text :is(h2, h3, h4) {
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.t-feed__post-popup .t-feed__post-popup__text h2 {
  font-size: clamp(24px, 3vw, 32px) !important;
}

.t-feed__post-popup .t-feed__post-popup__text h3 {
  font-size: clamp(21px, 2.5vw, 28px) !important;
}

.t-feed__post-popup .t-feed__post-popup__text h4 {
  font-size: clamp(18px, 2vw, 22px) !important;
}

.t-feed__post-popup .t-feed__post-popup__text :is(ul, ol),
.site-service-dialog .t-catalog__prod-popup__text :is(ul, ol) {
  padding-inline-start: 1.4em;
}

.t-feed__post-popup .t-feed__post-popup__text img,
.site-service-dialog .t-catalog__prod-popup__text img {
  max-width: 100%;
  height: auto;
}

/* The existing table wrapper owns horizontal scrolling, never the article page. */
.t-feed__post-popup .t-table__wrapper,
.site-service-dialog .t-table__wrapper {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.t-feed__post-popup .t-table__table,
.site-service-dialog .t-table__table {
  width: 100%;
  min-width: 100%;
  table-layout: auto;
}

.t-feed__post-popup .t-table__cell,
.site-service-dialog .t-table__cell {
  min-width: 9rem;
}

.t-feed__post-popup .t-table__cell-content,
.site-service-dialog .t-table__cell-content {
  box-sizing: border-box;
  width: auto;
  max-width: 24rem;
  padding: 12px;
  font-size: 16px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.js-catalog .t-catalog__card__price-wrapper,
.js-catalog .t-catalog__card__price,
.js-catalog .t-catalog__card__price-value,
.js-catalog .t-catalog__card__price-currency,
.site-service-dialog .t-catalog__prod-popup__price,
.site-service-dialog .t-catalog__prod-popup__price-wrapper {
  font-size: 18px !important;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.js-catalog .site-catalog-categories .t-catalog__parts-text-title,
.js-catalog .site-catalog-categories .t-catalog__parts-dropdown .t-descr {
  font-size: 16px !important;
  line-height: 1.4 !important;
}

.js-catalog .site-catalog-categories .t-catalog__parts-button-base {
  min-height: 44px;
}

.js-catalog .site-catalog-pagination {
  flex-wrap: wrap;
  gap: 6px;
  max-width: 100%;
}

.js-catalog .site-catalog-pagination button {
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  font-family: 'SiteSans', Arial, sans-serif;
  font-size: 16px;
}

.site-service-dialog .t-catalog__prod-popup__slider:empty {
  display: none;
}

.site-service-dialog .t-catalog__prod-popup__slider:empty + .t-catalog__prod-popup__info {
  box-sizing: border-box;
  float: none;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
}

.site-service-dialog .t-catalog__prod-popup__name {
  font-size: clamp(26px, 3.3vw, 40px) !important;
  line-height: 1.25 !important;
  overflow-wrap: anywhere;
}

@media (max-width: 960px) {
  .js-feed .site-feed-restored,
  .js-catalog .t-catalog__card-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }

  .js-feed .site-feed-restored::before,
  .js-feed .site-feed-restored::after,
  .js-catalog .t-catalog__card-list::before,
  .js-catalog .t-catalog__card-list::after {
    content: none;
  }

  .js-feed .site-feed-restored > .t-feed__grid-col,
  .js-catalog .t-catalog__card-list > .t-catalog__card {
    box-sizing: border-box;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0;
  }

  .js-catalog .site-catalog-categories .t-catalog__parts-above-single {
    scrollbar-width: thin;
    scroll-padding-inline: 12px;
  }

  .t-feed__post-popup .t-feed__post-popup__content {
    width: 100%;
    margin-inline: 0;
  }
}

@media (max-width: 640px) {
  .js-feed .site-feed-restored,
  .js-catalog .t-catalog__card-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .js-feed .site-feed-restored .t-feed__col-grid__post-wrapper {
    height: auto !important;
  }

  .t-feed__post-popup .t-feed__post-popup__container {
    padding-top: 76px;
    padding-bottom: 32px;
  }

  .t-feed__post-popup .t-feed__post-popup__content-wrapper {
    padding-inline: 16px;
  }

  .t-feed__post-popup .t-feed__post-popup__content {
    padding-inline: 0;
  }

  .t-feed__post-popup .t-feed__post-popup__close-wrapper {
    min-height: 56px;
    height: auto;
    padding: 12px 16px;
  }

  .t-feed__post-popup .t-feed__post-popup__close-text {
    font-size: 14px !important;
  }

  .site-service-dialog .t-catalog__prod-popup__container {
    padding: 24px 16px;
  }
}
