/* TZ-6: service page breadcrumbs on template--info */
.template--info .sm-service-crumbs {
  margin: 0 0 20px;
  padding: 14px 0 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #6b6b73;
}
.template--info .sm-service-crumbs .crumbs__link {
  color: #16161a;
  text-decoration: none;
  border-bottom: 1px solid rgba(22, 22, 26, 0.25);
}
.template--info .sm-service-crumbs .crumbs__link:hover {
  color: #d01c20;
  border-bottom-color: #d01c20;
}
.template--info .sm-service-crumbs .crumbs__point--active {
  color: #9a9aa2;
}

.sm-filter__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.sm-filter__skeleton { padding: 1rem; color: #8a8a8a; font-size: 0.9rem; }

.sm-tabs__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.sm-tabs__btn {
  background: #f3f4f6;
  border: 0;
  padding: 0.5rem 0.75rem;
  border-radius: 0.25rem;
}

.sm-tabs__btn.is-active { background: #d01c20; color: #fff; }
.sm-tabs__panel {
  display: none;
  margin-bottom: 0;
}
.sm-tabs__panel.is-active {
  display: block;
}

.sm-hero__subtitle--lead {
  font-size: 1.125rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.sm-hero__grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

@media (min-width: 992px) {
  .sm-hero__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(280px, 320px);
    align-items: start;
  }
}

.sm-hero__main,
.sm-hero__gallery,
.sm-hero__calc {
  min-width: 0;
}

.sm-hero__gallery img {
  width: 100%;
  height: auto;
  display: block;
}

.sm-hero__gallery .swiper,
.sm-hero__gallery .swiper-wrapper,
.sm-hero__gallery .swiper-slide {
  max-width: 100%;
}

.sm-hero__gallery .swiper-slide {
  width: 100% !important;
}

/* Блоки ТЗ раньше использовали класс темы .card — но в qmedia это плитка товара
   фиксированного размера (422×391, display:flex). Содержимое в неё не влезало
   и наезжало на следующие блоки, а таблицы внутри скрывались. */
.sm-card {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  min-height: 0;
  background: #fafafa;
  border-radius: 4px;
  padding: 24px;
  margin-bottom: 24px;
  overflow: visible;
}

.sm-card > :last-child {
  margin-bottom: 0;
}

.sm-card table {
  display: table;
  width: 100%;
}

@media (max-width: 767px) {
  .sm-card {
    padding: 16px;
  }
}

/* Ссылки на документы наследуют оформление темы (.file__item), а не остаются
   синими ссылками браузера по умолчанию. */
.sm-specs__doc-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #222;
  text-decoration: none;
  white-space: nowrap;
}

.sm-specs__doc-link:hover .file__item-name {
  color: #d01c20;
}

.sm-specs__doc-link .file__item-icon {
  color: #d01c20;
  width: 18px;
  min-width: 18px;
  height: 18px;
}

.sm-specs__docs .file__list,
.sm-docs__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sm-docs__list .file__item {
  color: #222;
  text-decoration: none;
}

.sm-docs__list .file__item:hover .file__item-name {
  color: #d01c20;
}

.sm-docs__list .file__item-icon {
  color: #d01c20;
  width: 18px;
  min-width: 18px;
  height: 18px;
}

/* Заголовки сортируемых колонок — кнопки, но выглядеть должны как заголовки. */
.sm-legacy-enhancements__table th button[data-sort] {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.sm-legacy-enhancements__table th button[data-sort]::after {
  content: " ⇅";
  opacity: 0.6;
}

/* В шаблоне подключён Swiper 5/6, где контейнер — .swiper-container.
   Без этих правил у корня галереи нет overflow: hidden, слайды встают в ряд
   и первый накрывает текст hero-секции. */
.sm-hero__gallery,
.sm-service-equipment .swiper {
  position: relative;
  overflow: hidden;
}

.sm-stock {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.sm-stock__dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: #22c55e;
}

.sm-stock--low_stock .sm-stock__dot { background: #eab308; }
.sm-stock--out_of_stock .sm-stock__dot { background: #ef4444; }

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.sm-specs__table,
.sm-sizes__table {
  width: 100%;
}

.sm-sizes__table {
  min-width: 36rem;
}

.sm-faq__item {
  margin-bottom: 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.25rem;
  padding: 0.75rem 1rem;
}

.sm-faq__item summary {
  cursor: pointer;
  font-weight: 600;
}

.sm-contacts__grid { display: grid; gap: 1.5rem; }

@media (min-width: 768px) {
  .sm-contacts__grid { grid-template-columns: 2fr 1fr; }
}

.sm-error { padding: 2rem 1rem; }

.sm-error__code {
  font-size: 3rem;
  font-weight: 700;
  color: #9ca3af;
  margin: 0;
}

.sm-error__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.sm-vertical-menu { margin-top: 2rem; }

.sm-vertical-menu .sm-menu__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  align-items: flex-start;
}

.sm-menu__group {
  margin-bottom: 0;
  min-width: 10rem;
}

.sm-menu__group strong {
  display: block;
  margin-bottom: 0.35rem;
}

.sm-menu__link {
  display: inline-block;
  margin: 0 0.5rem 0.35rem 0;
}

.sm-related__grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.sm-related-card {
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1rem;
  background: #fff;
}

.sm-related-card__link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.sm-related-card__title {
  display: block;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.sm-related-card__intro {
  display: block;
  font-size: 0.9rem;
  color: #4b5563;
}

.sm-hero__title {
  margin: 0 0 0.75rem;
  font-size: 1.75rem;
  line-height: 1.2;
}

.sm-protocols__gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.sm-protocols__gallery img {
  max-width: 200px;
  height: auto;
  border: 1px solid #e5e7eb;
  border-radius: 0.25rem;
}

.sm-protocols__note {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: #4b5563;
}

/* Hide legacy product blocks when TZ enhancements are active */
.template--product .template__main:has(.sm-legacy-enhancements) #product_content_title,
.template--product .template__main:has(.sm-legacy-enhancements) .main-image,
.template--product .template__main:has(.sm-legacy-enhancements) .product_content_swiper,
.template--product .template__main:has(.sm-legacy-enhancements) #order-inline,
.template--product .template__main:has(.sm-legacy-enhancements) #product_table,
.template--product .template__main:has(.sm-legacy-enhancements) #product_docs,
.template--product .template__main:has(.sm-legacy-enhancements) .main-image,
.template--product .template__main:has(.sm-legacy-enhancements) .product_content_swiper,
.template--product .template__main:has(.sm-legacy-enhancements) #order-inline,
.template--product .template__main:has(.sm-legacy-enhancements) #product_table {
  display: none !important;
}

/* Fallback for browsers without :has() — legacy template always renders sm-legacy-enhancements */
@supports not selector(:has(*)) {
  .template--product .template__main .main-image,
  .template--product .template__main .product_content_swiper,
  .template--product .template__main #order-inline,
  .template--product .template__main #product_table,
  .template--product .template__main #product_content_title,
  .template--product .template__main #product_docs {
    display: none !important;
  }
}

.template--product .template__main:has(.sm-legacy-enhancements) .card__about {
  margin-top: 1rem;
}

.template--product .template__main.container-card-main {
  overflow-x: clip;
  max-width: 100%;
}

.sm-docs__list {
  margin: 0;
  padding-left: 1.25rem;
}
.sm-dropzone { border: 2px dashed #d1d5db; padding: 1rem; text-align: center; }

/* ТЗ-4: вводный текст перед калькулятором — вдвое крупнее базового 15px темы.
   Селектор из трёх классов нужен, чтобы перебить правила темы для .content. */
.template--info .content.sm-calculator-intro {
  font-size: 2em;
}

.template--info .content.sm-calculator-intro p,
.template--info .content.sm-calculator-intro li {
  font-size: inherit;
  line-height: 1.4;
}

/* В теме .template__section:first-child — inline-block, и первая секция ужимается
   до shrink-to-fit. На странице калькулятора первой идёт именно она.
   Тема грузится ниже по документу, поэтому нужен селектор по id: при равной
   специфичности выигрывало бы правило темы. */
#sm-calculator-widget.template__section,
#sm-form-kp.template__section {
  display: block;
  width: auto;
}

/* ТЗ-4: универсальный калькулятор. Раскладка и палитра — по референсу из ТЗ
   (скриншот виджета калькулятор-металла.рф): тёмная плашка, две колонки выбора,
   чертёж сечения, форма справа, панель результата снизу. */
.sm-calc {
  --sm-calc-navy: #1d4471;
  --sm-calc-blue: #1b84d8;
  --sm-calc-blue-hover: #1670ba;
  --sm-calc-link: #3e7cb1;
  --sm-calc-head: #1f3864;
  --sm-calc-muted: #8a94a6;
  --sm-calc-border: #dde1e6;
  --sm-calc-panel: #f7f8fa;
  --sm-calc-active: #e9edf2;
  --sm-calc-ink: #1f2937;

  border: 1px solid var(--sm-calc-border);
  border-radius: 3px;
  background: #fff;
  color: var(--sm-calc-ink);
  overflow: hidden;
  margin-bottom: 24px;
}

.sm-calc__bar {
  background: var(--sm-calc-navy);
  padding: 14px 20px;
}

.sm-calc__bar-title {
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sm-calc__body {
  display: grid;
  grid-template-columns: 160px 200px minmax(0, 1fr) 300px;
  align-items: stretch;
}

.sm-calc__col {
  border-right: 1px solid var(--sm-calc-border);
  padding: 16px 0;
  min-width: 0;
}

.sm-calc__col--shape { background: var(--sm-calc-panel); }

.sm-calc__col-title {
  padding: 0 16px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sm-calc-muted);
}

.sm-calc__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sm-calc__item {
  display: block;
  width: 100%;
  border: 0;
  background: none;
  text-align: left;
  padding: 9px 16px;
  font-size: 0.95rem;
  line-height: 1.25;
  color: var(--sm-calc-link);
  cursor: pointer;
}

.sm-calc__item:hover { background: var(--sm-calc-active); }

.sm-calc__item.is-active {
  background: var(--sm-calc-active);
  color: var(--sm-calc-head);
  font-weight: 600;
}

.sm-calc__scheme {
  padding: 18px 24px;
  min-width: 0;
}

.sm-calc__scheme-title {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--sm-calc-head);
}

.sm-calc__drawing svg {
  display: block;
  width: 100%;
  max-width: 320px;
  height: auto;
  margin: 0 auto;
}

.sm-calc__form {
  border-left: 1px solid var(--sm-calc-border);
  padding: 18px 20px;
}

.sm-calc__tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 18px;
  border: 1px solid var(--sm-calc-border);
  border-radius: 2px;
  overflow: hidden;
}

.sm-calc__tab {
  border: 0;
  background: #fff;
  padding: 9px 6px;
  font-size: 0.85rem;
  color: var(--sm-calc-link);
  cursor: pointer;
}

.sm-calc__tab + .sm-calc__tab { border-left: 1px solid var(--sm-calc-border); }

.sm-calc__tab.is-active {
  background: var(--sm-calc-active);
  color: var(--sm-calc-head);
  font-weight: 600;
}

.sm-calc__field { margin-bottom: 14px; }

.sm-calc__field label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--sm-calc-head);
}

.sm-calc__control,
.sm-calc__input {
  display: flex;
  align-items: center;
  width: 100%;
  border: 1px solid var(--sm-calc-border);
  border-radius: 2px;
  background: #fff;
  min-height: 40px;
}

.sm-calc__control {
  display: block;
  padding: 0 10px;
  font-size: 0.95rem;
  color: var(--sm-calc-ink);
}

.sm-calc__input input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0 10px;
  font-size: 0.95rem;
  color: var(--sm-calc-ink);
  background: none;
}

.sm-calc__unit {
  flex: 0 0 auto;
  padding: 0 10px;
  font-size: 0.9rem;
  color: var(--sm-calc-muted);
}

.sm-calc__input.is-invalid,
.sm-calc__control.is-invalid { border-color: #b91c1c; }

.sm-calc__error {
  margin: 0 0 12px;
  font-size: 0.85rem;
  color: #b91c1c;
}

.sm-calc__submit,
.sm-calc__add {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 2px;
  padding: 12px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: var(--sm-calc-blue);
  cursor: pointer;
}

.sm-calc__submit:hover,
.sm-calc__add:hover { background: var(--sm-calc-blue-hover); }

.sm-calc__result {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 20px;
  border-top: 1px solid var(--sm-calc-border);
  background: var(--sm-calc-panel);
  padding: 18px 24px;
  transition: background 0.3s ease;
}

.sm-calc__result.is-updated { background: #e6f1fb; }

.sm-calc__result-grid {
  flex: 1 1 auto;
  display: grid;
  gap: 14px 32px;
  grid-template-columns: repeat(auto-fit, minmax(150px, auto));
  justify-content: start;
}

.sm-calc__result-label {
  display: block;
  font-size: 0.8rem;
  color: var(--sm-calc-muted);
}

.sm-calc__result-value {
  display: block;
  font-size: 1.05rem;
  color: var(--sm-calc-head);
}

.sm-calc__result-value strong { font-size: 1.5rem; font-weight: 700; }

.sm-calc__add {
  flex: 0 0 auto;
  width: auto;
  background: var(--sm-calc-navy);
}

.sm-calc__add:hover { background: #16355a; }

.sm-calc__note {
  margin: 0;
  padding: 12px 24px 16px;
  font-size: 0.85rem;
  color: var(--sm-calc-muted);
}

@media (max-width: 991px) {
  /* minmax(0, 1fr), а не 1fr: у 1fr min-width: auto, и колонка растягивается
     под min-content ленты «чипсов» вместо того, чтобы дать ей прокрутку. */
  .sm-calc__body { grid-template-columns: minmax(0, 1fr); }

  .sm-calc__col,
  .sm-calc__form {
    border: 0;
    border-bottom: 1px solid var(--sm-calc-border);
    min-width: 0;
  }

  .sm-calc__col { padding: 12px 0; }

  .sm-calc__col-title { padding: 0 16px 8px; }

  /* Вертикальные списки на узком экране превращаются в ленту «чипсов». */
  .sm-calc__list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 16px 4px;
    -webkit-overflow-scrolling: touch;
  }

  .sm-calc__item {
    width: auto;
    flex: 0 0 auto;
    border: 1px solid var(--sm-calc-border);
    border-radius: 999px;
    padding: 7px 14px;
    white-space: nowrap;
    background: #fff;
  }

  .sm-calc__item.is-active { border-color: var(--sm-calc-head); }

  .sm-calc__scheme { padding: 16px; }

  .sm-calc__drawing svg { max-width: 240px; }

  .sm-calc__form { padding: 16px; }

  .sm-calc__result { padding: 16px; }

  .sm-calc__add { width: 100%; }
}

.sm-legacy-enhancements__section + .sm-legacy-enhancements__section { margin-top: 2rem; }
.sm-legacy-enhancements__details { display: grid; grid-template-columns: minmax(10rem, 1fr) 2fr; gap: 0.5rem 1.5rem; margin: 0; }
.sm-legacy-enhancements__details dt { font-weight: 700; }
.sm-legacy-enhancements__details dd { margin: 0; }
.sm-legacy-enhancements__table-wrap { max-width: 100%; overflow-x: auto; }
.sm-legacy-enhancements__table { width: 100%; min-width: 36rem; border-collapse: collapse; }
.sm-legacy-enhancements__table th,
.sm-legacy-enhancements__table td { padding: 0.75rem; border: 1px solid #ddd; text-align: left; }
.sm-legacy-enhancements__calculator { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 1rem; align-items: end; }
.sm-legacy-enhancements__calculator label { display: grid; gap: 0.35rem; font-weight: 700; }
.sm-legacy-enhancements__calculator input,
.sm-legacy-enhancements__search input { width: 100%; max-width: 16rem; box-sizing: border-box; padding: 0.65rem; border: 1px solid #ddd; }
.sm-legacy-enhancements__result { padding-bottom: 0.65rem; white-space: nowrap; }
.sm-legacy-enhancements__note { margin: 0.75rem 0 0; font-size: 0.9em; }
.sm-legacy-enhancements__search { display: block; margin-bottom: 1rem; }
.sm-legacy-enhancements__table th button { padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }

@media (max-width: 575px) {
  .sm-legacy-enhancements__calculator { grid-template-columns: 1fr; }
  .sm-legacy-enhancements__details { grid-template-columns: 1fr; gap: 0.25rem; }
  .sm-legacy-enhancements__details dd + dt { margin-top: 0.75rem; }
}

.sm-filter__open { display: none; }
.sm-filter__overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 40;
}
.sm-filter__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  min-width: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #8a8a8a;
  cursor: pointer;
}
.sm-filter__close:hover { color: #222; }
.sm-filter__close .feather { width: 20px; height: 20px; }
.sm-filter__panel-head,
.sm-filter__actions { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; margin: 0.5rem 0 1rem; }
.sm-filter__tag {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 0.75rem;
  color: #222;
  font-size: 0.9rem;
  text-decoration: none;
  background-color: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 2px;
  transition: 0.25s ease-in-out;
}
.sm-filter__tag:hover { color: #d01c20; border-color: #d01c20; }
/* Фильтр каталога (ТЗ-3) собран из компонентов темы qmedia: .input, .checkbox,
   .button, .card__section-title. Здесь — только раскладка и стрелка группы,
   повторяющая поведение .nav-left__arrow в сайдбаре. */
.sm-filter__title { margin-bottom: 1rem; padding-bottom: 0; font-size: 1.5rem; }

.sm-filter__group { border-top: 1px solid #e8e8e8; }
.sm-filter__group:first-of-type { border-top: none; }

.sm-filter__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 12px 0;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}
/* Родная стрелка <details> заменяется на feather-иконку темы. */
.sm-filter__summary::-webkit-details-marker { display: none; }
.sm-filter__summary::marker { content: ""; }

.sm-filter__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  min-width: 36px;
  color: #8a8a8a;
  transition: 0.25s ease-in-out;
}
.sm-filter__arrow .feather { width: 20px; height: 20px; }
.sm-filter__summary:hover .sm-filter__arrow { color: #222; }
.sm-filter__group[open] > .sm-filter__summary .sm-filter__arrow { transform: rotate(180deg); }

.sm-filter__fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.5rem;
  padding: 0 0 1.25rem;
}

.sm-filter__range-inputs { display: flex; gap: 0.5rem; }
.sm-filter__range-inputs .input { width: 100%; min-width: 0; }

.sm-filter__options { min-width: 0; padding: 0; border: 0; margin: 0; }
/* Тема задаёт <legend> размер 1.5rem — в фильтре он должен читаться
   как обычная подпись поля, наравне с .form__label у диапазонов. */
.sm-filter__options legend.form__label {
  margin-bottom: 0.75rem;
  padding: 0;
  font-size: 1rem;
  line-height: 1.4;
}

.sm-filter__option { padding: 6px 0; }
.sm-filter__option .checkbox__title { padding-right: 0.5rem; }
.sm-filter__option-count { margin-left: auto; color: #8a8a8a; font-size: 0.9rem; }
.sm-filter__option.is-empty { opacity: 0.4; cursor: default; }

.sm-filter__actions { padding-top: 1rem; border-top: 1px solid #e8e8e8; }

.sm-filter__panel-title { font-size: 1.2rem; font-weight: 500; }
.sm-filter.is-busy .sm-filter__panel { opacity: 0.6; }

.sm-sticky-cta {
  display: none;
  position: sticky;
  bottom: 0;
  z-index: 30;
  gap: 0.75rem;
  padding: 0.75rem;
  background: #fff;
  border-top: 1px solid #e5e7eb;
}
.sm-sticky-cta .btn { min-height: 44px; min-width: 44px; }
.sm-dropzone__preview { list-style: none; padding: 0; margin: 0.75rem 0 0; }
.sm-dropzone__preview li { display: flex; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.35rem; }
.sm-menu-toggle { display: none; margin: 1rem 0; }
.sm-industry, .sm-service-blocks { display: grid; gap: 1rem; }
@media (max-width: 767px) {
  .sm-filter__open { display: inline-flex; min-height: 44px; }
  .sm-filter__panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(100%, 22rem);
    background: #fff;
    z-index: 50;
    padding: 1rem;
    overflow: auto;
    transform: translateX(110%);
    transition: transform 0.2s ease;
  }
  .sm-filter.is-open .sm-filter__panel,
  .sm-filter__panel.is-open { transform: translateX(0); }
  .sm-tabs__nav { display: none; }
  .sm-tabs__panel { display: block; }
  .sm-sticky-cta { display: flex; }
  .sm-menu-toggle { display: inline-flex; min-height: 44px; }
  .sm-vertical-menu { display: none; }
  .sm-vertical-menu.is-open { display: block; }
  body.sm-filter-open { overflow: hidden; }
}
@media (min-width: 768px) {
  /* Шапка выдвижной панели нужна только в мобильном режиме: на десктопе
     роль заголовка играет .sm-filter__title. */
  .sm-filter__overlay, .sm-filter__close, .sm-filter__panel-head { display: none; }
  .sm-tabs__accordion details summary { display: none; }
  .sm-tabs__accordion details.sm-tabs__panel:not(.is-active) {
    display: none !important;
  }
  .sm-tabs__accordion details.sm-tabs__panel.is-active {
    display: block !important;
  }
}

/* Legacy product shell (#product_content + sidebar): full-width TZ blocks */
.template--product .template__main:has(.sm-legacy-enhancements) #product_content,
.template--product .template__main #product_content:has(.sm-legacy-enhancements) {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.template--product .template__main:has(.sm-legacy-enhancements) #product_content .card__left,
.template--product .template__main:has(.sm-legacy-enhancements) #product_content .card__right,
.template--product .template__main #product_content:has(.sm-legacy-enhancements) .card__left,
.template--product .template__main #product_content:has(.sm-legacy-enhancements) .card__right {
  display: none !important;
}

.template--product .template__main:has(.sm-legacy-enhancements) .sm-legacy-enhancements,
.template--product .template__main .sm-legacy-enhancements {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.sm-legacy-enhancements .content table,
.sm-legacy-enhancements .sm-legacy-enhancements__table,
.sm-legacy-enhancements .sm-specs__table {
  min-width: 0;
  width: 100%;
}

.sm-legacy-enhancements .sm-legacy-enhancements__table-wrap,
.sm-legacy-enhancements .table-responsive {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.sm-legacy-enhancements .content .table {
  display: block;
  margin: 0;
  max-width: 100%;
  overflow-x: auto;
}

.sm-legacy-enhancements .content .table .table__body {
  min-width: 0;
  padding: 0;
}

.sm-specs__table {
  table-layout: fixed;
}

.sm-specs__table th:nth-child(1),
.sm-specs__table td:nth-child(1) { width: 24%; }
.sm-specs__table th:nth-child(2),
.sm-specs__table td:nth-child(2) { width: 46%; }
.sm-specs__table th:nth-child(3),
.sm-specs__table td:nth-child(3) { width: 30%; }

.sm-specs__doc-link {
  display: inline-block;
  font-size: 0.9rem;
}

.sm-logistics__list,
.sm-cases__list {
  margin: 0;
  padding-left: 1.1rem;
}

.sm-logistics__list li,
.sm-cases__list li {
  margin-bottom: 0.5rem;
}

.sm-protocols__gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.sm-related__grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.sm-related-card__link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.sm-related-card__image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.35rem;
  margin-bottom: 0.5rem;
}

.sm-related-card__title {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.sm-related-card__intro {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
  color: #6b7280;
  font-size: 0.92rem;
  line-height: 1.45;
}

/* Карточки ряда тянутся до высоты самой длинной. Раскладываем содержимое
   колонкой, чтобы под коротким текстом не оставалось пустой рамки. */
.sm-related-card {
  display: flex;
}

.sm-related-card__link {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.sm-related-card__image {
  display: block;
  aspect-ratio: 8 / 5;
  margin-bottom: 0.5rem;
  border-radius: 0.35rem;
  overflow: hidden;
}

.sm-related-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  margin-bottom: 0;
}

.sm-related-card__image--empty {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

.sm-form__microcopy {
  margin: 0.75rem 0 0;
  color: #6b7280;
  font-size: 0.9rem;
}

.sm-hero__gallery {
  position: relative;
  min-height: 240px;
  aspect-ratio: 3 / 2;
}

.sm-hero__gallery .swiper-slide img,
.sm-hero__gallery .swiper-slide picture {
  display: block;
  width: 100%;
  height: auto;
}

.sm-hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sm-hero__cta .btn {
  flex: 1 1 auto;
  max-width: 100%;
}

@media (min-width: 768px) {
  .template--product .template__main:has(.sm-legacy-enhancements) .sm-hero__grid,
  .template--product .template__main .sm-hero__grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  }

  .template--product .template__main:has(.sm-legacy-enhancements) .sm-hero__calc,
  .template--product .template__main .sm-hero__calc {
    grid-column: 1 / -1;
  }

  .template--product .template__main:has(.sm-legacy-enhancements) .sm-legacy-enhancements__calculator,
  .template--product .template__main .sm-legacy-enhancements__calculator {
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  }
}

.template--product .template__main:has(.sm-legacy-enhancements) .product_delivery,
.template--product .template__main:has(.sm-legacy-enhancements) .product_delivery {
  display: none;
}

.template--product .template__main:has(.sm-related-articles) > .template__section:has(.news__list),
.template--product .template__main:has(.sm-related-articles) > .template__section:has(.news__list) {
  display: none;
}

.sm-catalog-usps__list {
  margin: 0;
  padding-left: 1.2rem;
}

.sm-catalog-usps__list li {
  margin-bottom: 0.35rem;
}


/* Прогресс загрузки файлов (ТЗ-5 §2.2) */
.sm-dropzone__progress{display:block;width:100%;height:8px;margin-top:10px;border:none;border-radius:4px;background:#eee;appearance:none;-webkit-appearance:none}
.sm-dropzone__progress::-webkit-progress-bar{background:#eee;border-radius:4px}
.sm-dropzone__progress::-webkit-progress-value{background:#d01c20;border-radius:4px}
.sm-dropzone__progress::-moz-progress-bar{background:#d01c20;border-radius:4px}

/* ---------- ТЗ-6: блоки страницы услуги ---------- */

.sm-card__title { margin: 0 0 0.75rem; font-size: 1.35rem; line-height: 1.25; }
.sm-card__subtitle { margin: 1.25rem 0 0.5rem; font-size: 1.05rem; }

/* Блок 1. Индикатор загрузки производства. */
.sm-load { margin: 18px 0 22px; max-width: 460px; }
.sm-load__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13px; }
.sm-load__label { color: #6b6b73; }
.sm-load__value { font-weight: 700; color: #d01c20; font-size: 15px; }
.sm-load__track { margin-top: 6px; height: 8px; border-radius: 4px; background: #e6e6e3; overflow: hidden; }
.sm-load__bar { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #d01c20, #ff5b5b); }
.sm-load__hint { margin: 6px 0 0; font-size: 12.5px; color: #6b6b73; }

/* Кнопка-якорь к форме расчёта в hero. */
.cta--anchor { display: inline-flex; align-items: center; justify-content: center; }

/* Блок 2. Матрица возможностей — таблица со скроллом на узких экранах. */
.sm-matrix { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sm-matrix__table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 14.5px; }
.sm-matrix__table th, .sm-matrix__table td { padding: 10px 12px; border-bottom: 1px solid #e6e6e3; text-align: left; vertical-align: top; }
.sm-matrix__table thead th { background: #f4f4f1; font-weight: 600; white-space: nowrap; }
.sm-matrix__table tbody th { font-weight: 600; }

/* Блоки 4 и «факторы цены» — нумерованные списки. */
.sm-deflist, .sm-stages, .sm-factors { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.sm-stages { counter-reset: none; }
.sm-deflist__item, .sm-stages__item, .sm-factors__item { position: relative; padding-left: 44px; }
.sm-deflist__num, .sm-stages__num, .sm-factors__num {
  position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #d01c20; color: #fff; font-size: 14px; font-weight: 700;
}
.sm-deflist__title, .sm-stages__title, .sm-factors__title { display: block; }
.sm-deflist__text, .sm-stages__text, .sm-factors__text { margin: 2px 0 0; color: #4b4b53; }

/* Блок 3. Парк оборудования. */
.sm-equipment__figure { margin: 0; }
.sm-equipment__figure img { width: 100%; height: auto; border-radius: 8px; display: block; }
.sm-equipment__caption { display: block; margin-top: 8px; font-size: 14px; }
.sm-equipment__caption strong { display: block; }
.sm-equipment__caption span { color: #6b6b73; }

/* Блок 5. Лид-магниты. */
.sm-magnets { display: grid; gap: 10px; margin-top: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.sm-magnet { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid #e6e6e3; border-radius: 8px; text-decoration: none; color: inherit; }
.sm-magnet:hover { border-color: #d01c20; }
.sm-magnet__title { font-weight: 600; }
.sm-magnet__action { font-size: 13px; color: #d01c20; }

/* Блок 6. Кейсы. */
.sm-case { padding: 4px; }
.sm-case__title { margin: 0 0 10px; font-size: 1.05rem; }
.sm-case__list { margin: 0; }
.sm-case__row { display: grid; grid-template-columns: 96px 1fr; gap: 10px; padding: 6px 0; border-bottom: 1px solid #ececea; }
.sm-case__row dt { font-weight: 600; color: #6b6b73; }
.sm-case__row dd { margin: 0; }

/* Блок 8. Зона перетаскивания файлов. */
.sm-dropzone__area { position: relative; border: 2px dashed #d1d5db; border-radius: 8px; padding: 18px 14px; cursor: pointer; transition: border-color .15s, background-color .15s; }
.sm-dropzone__area.is-dragover { border-color: #d01c20; background: #fdf2f2; }
.sm-dropzone__area:focus-visible { outline: 2px solid #d01c20; outline-offset: 2px; }
.sm-dropzone__call { margin: 0 0 10px; color: #4b4b53; }
.sm-dropzone__link { color: #d01c20; text-decoration: underline; }
.sm-dropzone__hint { margin: 8px 0 0; font-size: 12.5px; color: #6b6b73; }
.sm-dropzone__file { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid #ececea; }
.sm-dropzone__remove { border: 0; background: none; font-size: 20px; line-height: 1; color: #6b6b73; cursor: pointer; padding: 0 4px; }
.sm-dropzone__remove:hover { color: #d01c20; }
.sm-dropzone__msg { font-size: 13px; color: #6b6b73; padding: 4px 0; }
.sm-dropzone__msg.is-error { color: #d01c20; }
.sm-form__lead, .sm-form__nda { font-size: 13px; color: #6b6b73; }

/* Honeypot: поле не должно быть видно человеку, но и display:none у поля не ставим. */
.sm-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Блок 10. SEO-текст под кат. */
.sm-service-seo > summary { cursor: pointer; font-weight: 600; }
.sm-service-seo__body { margin-top: 12px; }

@media (max-width: 575px) {
  .sm-case__row { grid-template-columns: 1fr; gap: 2px; }
  .sm-card__title { font-size: 1.2rem; }
}

/* animate.css на страницах услуг не грузится (см. плагин smServiceAssetTrim),
   но сообщение об успешной отправке формы использует её классы. */
@keyframes smZoomIn { from { opacity: 0; transform: scale3d(.3, .3, .3); } 50% { opacity: 1; } }
.form-messages.zoomIn.animated { animation: smZoomIn .5s both; }
.form-messages { margin-top: 12px; padding: 10px 14px; border-radius: 8px; }
.form-messages.success { background: #eaf7ee; color: #1c6b32; }
.form-messages.error { background: #fdf2f2; color: #b3171b; }

.sm-form-actions__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}
.sm-form-actions__list .button { margin: 0; }
@media (max-width: 600px) {
  .sm-form-actions__list { flex-direction: column; align-items: stretch; }
}

/* Аккордеон вопросов и ответов.
   В styles.css те же правила вложены в #faq и работают только на одной странице;
   здесь они же, но без привязки к идентификатору, — чтобы блок выглядел одинаково
   на странице FAQ, в карточке товара и на страницах услуг. */
.accordion { max-width: 1300px; margin: 0 auto; }
.accordion__item { background: #FAFAFA; margin-bottom: 10px; }
.accordion__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px 24px 25px;
  cursor: pointer;
  font-weight: 600;
}
.accordion__icon { font-size: 22px; transition: transform 0.4s ease; }
.accordion__content {
  max-height: 0;
  overflow: hidden;
  color: #777;
  line-height: 1.6;
  transition: max-height 0.4s ease;
  max-width: 800px;
  padding-left: 25px;
}
/* Ответы бывают длиннее прежнего лимита в 200px, поэтому запас больше. */
.accordion__item.active .accordion__content { max-height: 2000px; padding-bottom: 15px; }
.accordion__item.active .accordion__icon { transform: rotate(45deg); }

/* Призыв к действию под статьёй и блок связанных товаров. */
.sm-blog-cta .container { text-align: center; }
.sm-blog-cta__text { margin: 0 auto 20px; max-width: 720px; }
.sm-blog-cta .button { display: inline-block; }

/* Раскладка крошек. На страницах услуг подключается свой набор стилей, и
   базовых правил .crumbs из постраничного CSS в нём не было — список
   выстраивался в столбик. Повторяем оформление остальных разделов. */
.template--info .sm-service-crumbs .crumbs__list {
  display: flex;
  flex-wrap: wrap;
}
.template--info .sm-service-crumbs .crumbs__point {
  margin: 2px 8px 2px 0;
}
.template--info .sm-service-crumbs .crumbs__point::after {
  content: "/";
  margin-left: 8px;
}
.template--info .sm-service-crumbs .crumbs__point:last-child {
  margin-right: 0;
}
.template--info .sm-service-crumbs .crumbs__point:last-child::after {
  display: none;
}

/* Блоки под статьёй выводятся секциями. В qmedia.css есть унаследованное
   правило .template__section:first-child{display:inline-block}: когда связанных
   товаров у статьи нет, первым потомком становится призыв к действию и
   сжимается до ширины содержимого. Держим эти секции блочными. */
.template__main .template__section.sm-blog-cta,
.template__main .template__section.sm-related-products {
  display: block;
  width: 100%;
}

/* Список товаров в блоке «Материалы для этой услуги» и «Связанные товары».
   Классы card__title / sm-product-card в наборах стилей не оформлены: ссылки
   получали браузерный синий, а вложенная .sm-card давала карточку в карточке
   с двойными отступами. Оформляем списком ссылок внутри одной карточки. */
.sm-product-card {
  margin: 0;
  padding: 0;
  background: none;
}
.sm-product-card + .sm-product-card {
  margin-top: 14px;
}
.sm-product-card .card__title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.4;
  font-weight: 600;
}
.sm-product-card .card__title a {
  color: #16161a;
  text-decoration: none;
  border-bottom: 1px solid rgba(22, 22, 26, 0.25);
}
.sm-product-card .card__title a:hover {
  color: #d01c20;
  border-bottom-color: #d01c20;
}
.sm-product-card .card__text {
  margin: 6px 0 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: #6b6b73;
}

/* Страница калькулятора. Вводный текст шёл вплотную к краю секции, а содержимое
   карточек — с отступом 24px: на странице получалось два разных левых края. */
.template--info .content.sm-calculator-intro {
  padding-left: 24px;
  padding-right: 24px;
}

.sm-calculator-note .content ul {
  margin: 0.75rem 0 0;
  padding-left: 1.25rem;
}

.sm-calculator-note .content li {
  margin-bottom: 0.5rem;
}

/* Блок заявки стоит вплотную к блоку консультации — выравниваем так же, по центру. */
.sm-form-actions--center {
  text-align: center;
}

.sm-form-actions--center .sm-form-actions__list {
  justify-content: center;
}
