/**
 * Импортированный HTML с avtotent.kz (main.site-main): сетка вместо Owl Carousel.
 * Подключается при работе через CDN Tailwind, когда resources/css/app.css не загружен.
 */
:root {
    --font-display: 'Manrope', 'Plus Jakarta Sans', ui-sans-serif, system-ui, sans-serif;
}

/* Главная: старый блок с картинками скрыт — вместо него сетка k1–k5 в home.blade.php */
.home-materials-legacy .middle-edit-block {
    display: none !important;
}

.legacy-content {
    width: 100%;
    max-width: 100%;
    font-size: 1.02rem;
    line-height: 1.75;
    color: #334155;
}

/* Страницы разделов (page.blade) без Vite */
.legacy-content--inner {
    background: transparent;
    padding: 0;
    border: 0;
}

/* См. page.blade: .site-page-body и .site-page-legacy */
.site-page-body {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2rem;
}

@media (min-width: 640px) {
    .site-page-body {
        gap: 2.5rem;
    }
}

.legacy-content--inner.site-page-legacy {
    width: 100%;
    min-width: 0;
    border: 0;
    background: transparent;
    padding: 0;
}

/* Внутренние h1 из старого импорта дублируют шапку страницы. */
.legacy-content--inner.site-page-legacy > h1:first-of-type {
    display: none !important;
}

/* Базовая адаптивная страховка для импортированного контента. */
.legacy-content--inner.site-page-legacy :where(p, li, td, th, h1, h2, h3, h4, h5, h6, a, span) {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.legacy-content--inner.site-page-legacy img,
.legacy-content--inner.site-page-legacy video,
.legacy-content--inner.site-page-legacy iframe {
    max-width: 100% !important;
    height: auto !important;
}

/* Длинные строки в пре/коде и встроенные объекты — не раздувают viewport на мобиле */
.legacy-content--inner.site-page-legacy pre,
.legacy-content--inner.site-page-legacy .wp-block-preformatted {
    box-sizing: border-box;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.legacy-content--inner.site-page-legacy object,
.legacy-content--inner.site-page-legacy embed {
    max-width: 100%;
    height: auto;
}

/* h1 внутри тела встречается в старом импорте как подзаголовок секции. */
.legacy-content--inner.site-page-legacy > h1 {
    box-sizing: border-box;
    max-width: 56rem;
    margin: 1.75rem auto 0.8rem;
    padding: 0;
    font-family: var(--font-display);
    font-size: clamp(1.25rem, 3.6vw, 1.8rem);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: #0f172a;
    text-align: center !important;
}

/* Остатки форм Megagroup: делаем поля видимыми и удобными на мобиле. */
.legacy-megagroup-import .lp-form-tpl__item-field > input,
.legacy-megagroup-import .lp-form-tpl__item-field > textarea,
.legacy-megagroup-import .lp-form-tpl__item-field > select {
    width: 100%;
    border: 1px solid rgb(226 232 240);
    background: #fff;
    color: #0f172a;
    border-radius: 0.75rem;
    padding: 0.65rem 0.8rem;
    box-sizing: border-box;
}

@media (max-width: 640px) {
    .legacy-content--inner.site-page-legacy {
        font-size: 0.98rem;
        line-height: 1.65;
    }

    .legacy-table-scroll {
        border-radius: 0.75rem;
    }

    .legacy-table-scroll th,
    .legacy-table-scroll td {
        padding: 0.45rem 0.5rem !important;
    }
}

/* Финишная полировка текстовых страниц услуг */
.legacy-content--inner[data-page-slug='izgotovleniye-tentov'],
.legacy-content--inner[data-page-slug='tent-na-gazel'],
.legacy-content--inner[data-page-slug='pologa-ukryvnyye-tenty'],
.legacy-content--inner[data-page-slug='nashi-raboty'] {
    max-width: 58rem;
    margin-left: auto;
    margin-right: auto;
}

.legacy-content--inner[data-page-slug='izgotovleniye-tentov'] > h2,
.legacy-content--inner[data-page-slug='tent-na-gazel'] > h2,
.legacy-content--inner[data-page-slug='pologa-ukryvnyye-tenty'] > h2,
.legacy-content--inner[data-page-slug='nashi-raboty'] > h2 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    text-align: center !important;
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 2.8vw, 1.6rem);
    font-weight: 700;
    color: #0f172a;
}

.legacy-content--inner[data-page-slug='izgotovleniye-tentov'] > p:not(:has(img)),
.legacy-content--inner[data-page-slug='tent-na-gazel'] > p:not(:has(img)),
.legacy-content--inner[data-page-slug='pologa-ukryvnyye-tenty'] > p:not(:has(img)),
.legacy-content--inner[data-page-slug='nashi-raboty'] > p:not(:has(img)) {
    max-width: 52rem;
    margin: 0 auto 1rem;
    line-height: 1.68;
    color: rgb(51 65 85);
}

.legacy-content--inner[data-page-slug='izgotovleniye-tentov'] > p:has(> img),
.legacy-content--inner[data-page-slug='tent-na-gazel'] > p:has(> img),
.legacy-content--inner[data-page-slug='pologa-ukryvnyye-tenty'] > p:has(> img),
.legacy-content--inner[data-page-slug='nashi-raboty'] > p:has(> img) {
    margin: 1rem auto 1.15rem;
    text-align: center !important;
}

.legacy-content--inner[data-page-slug='izgotovleniye-tentov'] > p:has(> img) > img,
.legacy-content--inner[data-page-slug='tent-na-gazel'] > p:has(> img) > img,
.legacy-content--inner[data-page-slug='pologa-ukryvnyye-tenty'] > p:has(> img) > img,
.legacy-content--inner[data-page-slug='nashi-raboty'] > p:has(> img) > img {
    width: min(100%, 24rem) !important;
    max-width: min(100%, 24rem) !important;
    height: auto !important;
    border-radius: 0.75rem;
    border: 1px solid rgb(241 245 249);
    box-shadow: 0 4px 16px -8px rgba(15, 23, 42, 0.12);
}

.legacy-content--inner[data-page-slug='izgotovleniye-tentov'] > ul,
.legacy-content--inner[data-page-slug='tent-na-gazel'] > ul,
.legacy-content--inner[data-page-slug='pologa-ukryvnyye-tenty'] > ul,
.legacy-content--inner[data-page-slug='nashi-raboty'] > ul {
    max-width: 52rem;
    margin: 0.75rem auto 1.25rem;
    line-height: 1.62;
    color: rgb(51 65 85);
}

/* Серии фото "Наши работы" и похожие блоки — равномерной сеткой */
.legacy-content--inner[data-page-slug='nashi-raboty'] > p:has(> img + img) {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 0.75rem;
    align-items: start;
}

.legacy-content--inner[data-page-slug='nashi-raboty'] > p:has(> img + img) > img {
    width: 100% !important;
    max-width: none !important;
}

/* Полировка разделов-контейнеров (не прайсы): Комплектующие/Ткани/О компании/Продукция */
.legacy-content--inner[data-page-slug='komplektuyushchiye'],
.legacy-content--inner[data-page-slug='tkani'],
.legacy-content--inner[data-page-slug='o_kompanii'],
.legacy-content--inner[data-page-slug='produktsiya'] {
    max-width: 60rem;
    margin-left: auto;
    margin-right: auto;
}

.legacy-content--inner[data-page-slug='komplektuyushchiye'] > p,
.legacy-content--inner[data-page-slug='tkani'] > p,
.legacy-content--inner[data-page-slug='o_kompanii'] > p,
.legacy-content--inner[data-page-slug='produktsiya'] > p {
    line-height: 1.68;
    color: rgb(51 65 85);
}

.legacy-content--inner[data-page-slug='komplektuyushchiye'] > p:has(> img),
.legacy-content--inner[data-page-slug='tkani'] > p:has(> img),
.legacy-content--inner[data-page-slug='produktsiya'] > p:has(> img) {
    text-align: center !important;
    margin: 0.8rem auto 1.1rem;
}

.legacy-content--inner[data-page-slug='komplektuyushchiye'] > p:has(> img) > img,
.legacy-content--inner[data-page-slug='tkani'] > p:has(> img) > img,
.legacy-content--inner[data-page-slug='produktsiya'] > p:has(> img) > img {
    width: min(100%, 30rem) !important;
    max-width: min(100%, 30rem) !important;
    height: auto !important;
    border-radius: 0.8rem;
    border: 1px solid rgb(241 245 249);
    box-shadow: 0 4px 16px -8px rgba(15, 23, 42, 0.12);
}

.legacy-content--inner[data-page-slug='tkani'] .mce-s3-button,
.legacy-content--inner[data-page-slug='produktsiya'] .mce-s3-button {
    width: min(100%, 19rem) !important;
    max-width: min(100%, 19rem) !important;
    height: auto !important;
}

.legacy-content--inner[data-page-slug='o_kompanii'] .homepage {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    align-items: start;
}

@media (min-width: 900px) {
    .legacy-content--inner[data-page-slug='o_kompanii'] .homepage {
        grid-template-columns: minmax(0, 1fr) minmax(16rem, 20rem);
        gap: 1.25rem;
    }
}

.legacy-content--inner[data-page-slug='o_kompanii'] .homepage__pic {
    justify-self: center;
}

.legacy-content--inner[data-page-slug='o_kompanii'] .homepage__pic img {
    width: min(100%, 16rem) !important;
    height: auto !important;
    border-radius: 0.75rem;
    border: 1px solid rgb(241 245 249);
    box-shadow: 0 4px 16px -8px rgba(15, 23, 42, 0.12);
}

.legacy-content--inner[data-page-slug='o_kompanii'] .localtext p {
    text-align: left !important;
    line-height: 1.68;
    color: rgb(51 65 85);
}

/* Импорт: абзац только с картинкой/превью — перебиваем inline text-align:left */
.legacy-content--inner.site-page-legacy p:has(> img),
.legacy-content--inner.site-page-legacy p:has(> a img) {
    text-align: center !important;
}

.legacy-content--inner.site-page-legacy p:has(> img + img) {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 1rem;
}

.legacy-content--inner.site-page-legacy p > img {
    display: inline-block;
    width: min(100%, 22rem) !important;
    max-width: min(100%, 22rem) !important;
    height: auto !important;
    border-radius: 0.75rem;
    border: 1px solid rgb(241 245 249);
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
    vertical-align: middle;
}

.legacy-content--inner.site-page-legacy .legacy-article-img-link img {
    display: inline-block;
    width: min(100%, 22rem) !important;
    max-width: min(100%, 22rem) !important;
    height: auto !important;
    border-radius: 0.75rem;
    border: 1px solid rgb(241 245 249);
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
    vertical-align: middle;
}

/*
 * Любая таблица в .legacy-content с превью в первой колонке: перебиваем .legacy-article-img-link img и p > img
 * (height:auto + ширина до 22rem) — одинаковая высота строк. Главная + разделы (не только .site-page-legacy).
 */
.legacy-content .legacy-table-scroll tbody td:first-child > p,
.legacy-content table tbody td:first-child > p {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 0 !important;
}

.legacy-content .legacy-table-scroll tbody td:first-child img,
.legacy-content .legacy-table-scroll tbody td:first-child .legacy-article-img-link img,
.legacy-content .legacy-table-scroll tbody td:first-child p > img,
.legacy-content table tbody td:first-child img,
.legacy-content table tbody td:first-child .legacy-article-img-link img,
.legacy-content table tbody td:first-child p > img {
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: 2.75rem !important;
    height: 2.75rem !important;
    max-width: none !important;
    min-width: 0 !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center !important;
    vertical-align: middle !important;
    border-radius: 0.375rem;
    border: 1px solid rgb(241 245 249);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

@media (min-width: 640px) {
    .legacy-content .legacy-table-scroll tbody td:first-child img,
    .legacy-content .legacy-table-scroll tbody td:first-child .legacy-article-img-link img,
    .legacy-content .legacy-table-scroll tbody td:first-child p > img,
    .legacy-content table tbody td:first-child img,
    .legacy-content table tbody td:first-child .legacy-article-img-link img,
    .legacy-content table tbody td:first-child p > img {
        width: 3rem !important;
        height: 3rem !important;
    }
}

/* Заголовки в теле страницы (импорт может задать text-align inline) */
.legacy-content--inner.site-page-legacy > h2 {
    box-sizing: border-box;
    max-width: 48rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    margin-left: auto;
    margin-right: auto;
    padding: 0;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.025em;
    color: #0f172a;
    text-align: center !important;
}

.legacy-content--inner.site-page-legacy > h2:first-child {
    margin-top: 0;
}

@media (min-width: 640px) {
    .legacy-content--inner.site-page-legacy > h2 {
        font-size: 1.65rem;
    }
}

.legacy-content--inner.site-page-legacy > h3 {
    box-sizing: border-box;
    max-width: 48rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    margin-left: auto;
    margin-right: auto;
    padding: 0;
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.02em;
    color: #1e293b;
    text-align: center !important;
}

@media (min-width: 640px) {
    .legacy-content--inner.site-page-legacy > h3 {
        font-size: 1.25rem;
    }
}

/* Несколько таблиц на странице — вкладки (public/js/legacy-multi-table-tabs.js) */
.legacy-table-tabs {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
    .legacy-table-tabs {
        gap: 1rem;
    }
}

.legacy-table-tabs__row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.legacy-table-tab {
    border-radius: 0.75rem;
    border: 1px solid rgb(226 232 240);
    background: #fff;
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgb(51 65 85);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition:
        border-color 0.15s ease,
        background-color 0.15s ease,
        box-shadow 0.15s ease;
    cursor: pointer;
}

@media (min-width: 640px) {
    .legacy-table-tab {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

.legacy-table-tab:hover {
    border-color: rgb(199 210 254);
    background: rgba(238, 242, 255, 0.5);
}

.legacy-table-tab--active {
    border-color: rgb(129 140 248);
    background: rgba(238, 242, 255, 0.9);
    color: rgb(55 48 163);
    box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.35);
}

.legacy-table-tabs__show-all {
    align-self: flex-start;
    border-radius: 0.5rem;
    border: 1px dashed rgb(203 213 225);
    background: transparent;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: rgb(71 85 105);
    cursor: pointer;
    transition:
        border-color 0.15s ease,
        background-color 0.15s ease;
}

@media (min-width: 640px) {
    .legacy-table-tabs__show-all {
        font-size: 0.875rem;
        padding: 0.4rem 0.85rem;
    }
}

.legacy-table-tabs__show-all:hover {
    border-color: rgb(148 163 184);
    background: rgb(248 250 252);
    color: rgb(15 23 42);
}

.legacy-table-tabs__show-all--on {
    border-style: solid;
    border-color: rgb(165 180 252);
    background: rgba(238, 242, 255, 0.85);
    color: rgb(67 56 202);
}

.legacy-table-panel {
    min-width: 0;
}

.legacy-table-panel[hidden] {
    display: none !important;
}

/*
 * Обёртка таблицы: без overflow — иначе при overflow-x:auto браузер делает overflow-y:auto,
 * блок становится scroll-контейнером и колесо «крутит» не страницу (эффект iframe).
 * Широкая таблица даёт горизонтальный скролл у окна документа.
 */
.legacy-table-scroll {
    margin: 1.5rem 0;
    max-width: 100%;
    overflow: visible;
    border-radius: 1rem;
    border: 1px solid rgb(226 232 240 / 0.7);
    background: rgba(248, 250, 252, 0.35);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

/* Поиск по строкам (public/js/legacy-multi-table-tabs.js) */
.legacy-table-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgb(226 232 240 / 0.85);
}

@media (min-width: 640px) {
    .legacy-table-toolbar {
        flex-direction: row;
        align-items: center;
        gap: 0.75rem;
    }
}

.legacy-table-toolbar__label {
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgb(71 85 105);
}

@media (min-width: 640px) {
    .legacy-table-toolbar__label {
        font-size: 0.875rem;
    }
}

.legacy-table-toolbar__input {
    min-width: 0;
    flex: 1 1 auto;
    border-radius: 0.5rem;
    border: 1px solid rgb(226 232 240);
    background: #fff;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: rgb(15 23 42);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.legacy-table-toolbar__input::placeholder {
    color: rgb(148 163 184);
}

.legacy-table-toolbar__input:focus {
    outline: none;
    border-color: rgb(129 140 248);
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2);
}

.legacy-table-toolbar__select {
    min-width: 0;
    max-width: 100%;
    flex: 1 1 auto;
    border-radius: 0.5rem;
    border: 1px solid rgb(226 232 240);
    background: #fff;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgb(15 23 42);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    cursor: pointer;
}

@media (min-width: 640px) {
    .legacy-table-toolbar__select {
        max-width: 28rem;
    }
}

.legacy-table-toolbar__select:focus {
    outline: none;
    border-color: rgb(129 140 248);
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2);
}

@media print {
    .legacy-table-scroll {
        max-height: none !important;
        overflow: visible !important;
    }

    .legacy-table-scroll thead th {
        position: static !important;
    }
}

.legacy-table-scroll table {
    /* 100% контейнера: заголовки с max-width переносятся на несколько строк, таблица не уезжает */
    width: 100% !important;
    min-width: 100%;
    max-width: 100%;
    table-layout: auto !important;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    border: 0;
    font-size: 0.875rem;
    line-height: 1.45;
    color: #334155;
    background: #fff;
    box-shadow: none;
}

.legacy-table-scroll th,
.legacy-table-scroll td {
    /* !important — поверх padding: 1px из inline-стилей импорта */
    padding: 0.5rem 0.65rem !important;
    vertical-align: middle;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
    border-bottom: 1px solid rgb(226 232 240) !important;
    color: rgb(51 65 85) !important;
    background-color: transparent !important;
}

@media (min-width: 640px) {
    .legacy-table-scroll th,
    .legacy-table-scroll td {
        padding: 0.6rem 0.85rem !important;
    }
}

.legacy-table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    box-sizing: border-box;
    min-width: 0;
    /* Перенос длинных подписей столбцов (тг, опт, рулон…) */
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
    background: transparent !important;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0.02em;
    line-height: 1.25;
    color: #475569 !important;
    text-align: left;
    vertical-align: bottom;
    border-bottom: 1px solid rgb(226 232 240) !important;
    box-shadow: none;
    max-width: 9.5rem;
    padding-top: 0.45rem !important;
    padding-bottom: 0.45rem !important;
}

.legacy-table-scroll col:first-child {
    width: auto !important;
}

.legacy-table-scroll thead th:first-child {
    width: auto !important;
    min-width: 0;
    max-width: 7.5rem !important;
    box-sizing: border-box;
    padding-left: 0.3rem !important;
    padding-right: 0.3rem !important;
    font-size: 0.65rem !important;
    line-height: 1.2 !important;
    text-align: center !important;
    vertical-align: bottom !important;
}

/* Дубль заголовка секции в thead (рядом уже H1 страницы) — скрываем */
.legacy-table-scroll thead tr.legacy-pricelist-section-title-row {
    display: none !important;
}

.legacy-table-scroll thead th:nth-child(2) {
    max-width: 5.5rem !important;
    text-align: left !important;
    /* как у tbody — иначе inline text-align:center из импорта смещает заголовки относительно данных */
    padding-left: 2.75rem !important;
}

.legacy-table-scroll thead th:nth-child(3),
.legacy-table-scroll thead th:nth-child(4) {
    max-width: 6.5rem !important;
    text-align: left !important;
    padding-left: 2.75rem !important;
}

/* Длинные заголовки по ценам/рулону — сужаем, текст уходит в 2–3 строки */
.legacy-table-scroll thead th:nth-child(n + 5) {
    min-width: 0;
    max-width: 7.5rem !important;
    text-align: center !important;
    vertical-align: bottom !important;
}

@media (min-width: 640px) {
    .legacy-table-scroll thead th {
        font-size: 0.75rem;
    }

    .legacy-table-scroll thead th:first-child {
        max-width: 8rem !important;
    }

    .legacy-table-scroll thead th:nth-child(n + 5) {
        max-width: 8.5rem !important;
    }
}

@media (min-width: 1024px) {
    .legacy-table-scroll thead th:nth-child(n + 5) {
        max-width: 9.5rem !important;
    }
}

.legacy-table-scroll tbody tr:nth-child(even) td {
    background: rgba(248, 250, 252, 0.5) !important;
}

.legacy-table-scroll tbody tr:hover td {
    background: rgba(238, 242, 255, 0.35) !important;
}

.legacy-table-scroll tbody tr:has(td[colspan]) td {
    background: rgb(51 65 85) !important;
    color: #fff !important;
    text-align: center !important;
    font-weight: 600;
    font-size: 0.8125rem;
    padding-top: 0.65rem !important;
    padding-bottom: 0.65rem !important;
    border-bottom-color: rgb(51 65 85) !important;
}

.legacy-table-scroll tbody td:first-child {
    width: 7.5rem !important;
    max-width: 7.5rem !important;
    min-width: 7rem !important;
    box-sizing: border-box;
    padding-left: 0.4rem !important;
    padding-right: 2.75rem !important;
    vertical-align: middle !important;
    text-align: center !important;
}

.legacy-table-scroll tbody td:first-child a {
    display: block !important;
    width: fit-content !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.legacy-table-scroll tbody td:nth-child(2),
.legacy-table-scroll tbody td:nth-child(3),
.legacy-table-scroll tbody td:nth-child(4) {
    text-align: left !important;
    min-width: 0;
    /* зазор от колонки с фото */
    padding-left: 2.75rem !important;
}

/* Название/артикул — перенос длинной строки, иначе таблица тянет страницу */
.legacy-table-scroll tbody td:nth-child(2) {
    white-space: normal !important;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: min(20rem, 32vw);
}

.legacy-table-scroll tbody td:nth-child(n+5) {
    min-width: 5.5rem;
    text-align: center;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.legacy-table-scroll td img {
    display: block;
    margin: 0 auto;
    max-height: 3.5rem;
    max-width: 3.5rem;
    border-radius: 0.375rem;
    object-fit: cover;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    border: 1px solid rgb(241 245 249);
}

/* Страницы разделов: без рамки блока, акцент на ценах (типичные 7 колонок) */
.legacy-content--inner .legacy-table-scroll {
    border: 0;
    background: transparent;
    box-shadow: none;
}

.legacy-content--inner .legacy-table-scroll thead th {
    /* wrap — стабильные многострочные заголовки; balance в узких th даёт сбои */
    text-wrap: wrap;
    color: #000000 !important;
    font-weight: 700 !important;
}

.legacy-content--inner .legacy-table-scroll tbody tr {
    transition: background-color 0.15s ease;
}

/* Пятая колонка («Оптовая цена» и т.п.): числа и подписи в ячейках — жирные */
.legacy-content--inner.site-page-legacy:not([data-page-slug='uslugi'])
    .legacy-table-scroll
    tbody
    td:nth-child(5) {
    font-weight: 700 !important;
}

/*
 * Импорт без thead (data-legacy-header-in-tbody — ставит SiteContentRewriter): первая строка tbody = подписи столбцов.
 * Атрибут вместо :has(thead) — иначе в старых Safari весь селектор игнорируется и стили «шапки» пропадают.
 */
.legacy-content--inner.site-page-legacy:not([data-page-slug='uslugi'])
    .legacy-table-scroll[data-legacy-header-in-tbody='1']
    tbody
    tr:first-child
    td {
    color: #000000 !important;
    font-size: 0.75rem;
    font-weight: 700 !important;
    line-height: 1.25;
    text-align: center !important;
}

.legacy-content--inner.site-page-legacy:not([data-page-slug='uslugi'])
    .legacy-table-scroll[data-legacy-header-in-tbody='1']
    tbody
    tr:first-child
    td:nth-child(2),
.legacy-content--inner.site-page-legacy:not([data-page-slug='uslugi'])
    .legacy-table-scroll[data-legacy-header-in-tbody='1']
    tbody
    tr:first-child
    td:nth-child(3),
.legacy-content--inner.site-page-legacy:not([data-page-slug='uslugi'])
    .legacy-table-scroll[data-legacy-header-in-tbody='1']
    tbody
    tr:first-child
    td:nth-child(4) {
    text-align: left !important;
    padding-left: 2.75rem !important;
}

.legacy-content--inner.site-page-legacy:not([data-page-slug='uslugi'])
    .legacy-table-scroll[data-legacy-header-in-tbody='1']
    tbody
    tr:first-child
    td
    strong {
    color: inherit !important;
    font-weight: inherit !important;
    font-size: inherit !important;
}

@media (max-width: 639px) {
    .legacy-content--inner.site-page-legacy:not([data-page-slug='uslugi'])
        .legacy-table-scroll[data-legacy-header-in-tbody='1']
        tbody
        tr:first-child
        td {
        font-size: 0.7rem;
    }
}

/*
 * Прайс внутри разделов: ширина таблицы по содержимому (не сжимать колонки), без переносов —
 * горизонтальный скролл у article (page.blade). Страница «Услуги» — отдельная вёрстка карточек.
 */
.legacy-content--inner.site-page-legacy:not([data-page-slug='uslugi']) .legacy-table-scroll table {
    width: max-content !important;
    min-width: 100%;
    max-width: none !important;
}

.legacy-content--inner.site-page-legacy:not([data-page-slug='uslugi']) .legacy-table-scroll :is(th, td) {
    white-space: nowrap !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    hyphens: manual !important;
    -webkit-hyphens: manual;
}

.legacy-content--inner.site-page-legacy:not([data-page-slug='uslugi']) .legacy-table-scroll thead th {
    max-width: none !important;
    text-wrap: nowrap;
}

.legacy-content--inner.site-page-legacy:not([data-page-slug='uslugi'])
    .legacy-table-scroll
    thead
    th:nth-child(2),
.legacy-content--inner.site-page-legacy:not([data-page-slug='uslugi'])
    .legacy-table-scroll
    thead
    th:nth-child(3),
.legacy-content--inner.site-page-legacy:not([data-page-slug='uslugi'])
    .legacy-table-scroll
    thead
    th:nth-child(4),
.legacy-content--inner.site-page-legacy:not([data-page-slug='uslugi'])
    .legacy-table-scroll
    thead
    th:nth-child(n + 5),
.legacy-content--inner.site-page-legacy:not([data-page-slug='uslugi'])
    .legacy-table-scroll
    thead
    th:first-child {
    max-width: none !important;
}

.legacy-content--inner.site-page-legacy:not([data-page-slug='uslugi']) .legacy-table-scroll tbody td:nth-child(2) {
    white-space: nowrap !important;
    max-width: none !important;
}

/*
 * roliki-kolca-natyazhiteli: порядок колонок Изображение | Наименование | Код | Артикул | Цена — не как в типовом прайсе (там 2-й столбец «Код»).
 */
.legacy-content--inner[data-page-slug='roliki-kolca-natyazhiteli'].site-page-legacy:not([data-page-slug='uslugi'])
    .legacy-table-scroll
    thead
    tr:not(.legacy-pricelist-section-title-row)
    th:nth-child(2) {
    max-width: min(22rem, 40vw) !important;
    text-transform: none !important;
    text-align: left !important;
}

.legacy-content--inner[data-page-slug='roliki-kolca-natyazhiteli'].site-page-legacy:not([data-page-slug='uslugi'])
    .legacy-table-scroll
    tbody
    td:nth-child(2) {
    white-space: normal !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    max-width: min(24rem, 46vw) !important;
    font-weight: 400 !important;
    font-size: 0.875rem !important;
    line-height: 1.45 !important;
    color: rgb(51 65 85) !important;
    text-transform: none !important;
}

.legacy-content--inner[data-page-slug='roliki-kolca-natyazhiteli'].site-page-legacy:not([data-page-slug='uslugi'])
    .legacy-table-scroll
    tbody
    td:nth-child(3),
.legacy-content--inner[data-page-slug='roliki-kolca-natyazhiteli'].site-page-legacy:not([data-page-slug='uslugi'])
    .legacy-table-scroll
    tbody
    td:nth-child(4) {
    white-space: nowrap !important;
    max-width: none !important;
    font-variant-numeric: tabular-nums;
}

/*
 * Только ячейки «цена + кнопка Заказать»: flex по центру. Обычная цена без кнопки — обычная ячейка.
 */
.legacy-content--inner.site-page-legacy:not([data-page-slug='uslugi'])
    .legacy-table-scroll
    tbody
    td:nth-child(5):has(.mce-s3-button) {
    display: flex !important;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    vertical-align: middle;
}

.legacy-content--inner.site-page-legacy:not([data-page-slug='uslugi'])
    .legacy-table-scroll
    tbody
    td:nth-child(5):has(.mce-s3-button)
    .mce-s3-button {
    display: block;
    line-height: 0;
}

.legacy-content--inner.site-page-legacy:not([data-page-slug='uslugi'])
    .legacy-table-scroll
    tbody
    td:nth-child(5):has(.mce-s3-button)
    .mce-s3-button
    img {
    display: block;
    width: auto;
    max-width: min(100%, 7.5rem);
    height: auto;
    max-height: 2.25rem;
}

.legacy-content--inner[data-page-slug='tkan-pvkh-prozrachnaya']
    .site-product-sheet
    .min-w-0.flex-1
    > a,
.legacy-content--inner[data-page-slug='tkan-pvkh-prozrachnaya']
    .site-product-sheet
    .min-w-0.flex-1
    > a:hover,
.legacy-content--inner[data-page-slug='tkan-pvkh-prozrachnaya']
    .site-product-sheet
    .min-w-0.flex-1
    > a:focus-visible {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Старый вид без обёртки (если HTML без прохода через rewriter) */
.legacy-content > table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    min-width: min(100%, 640px);
}

.legacy-content > table th,
.legacy-content > table td {
    border: 1px solid #f1f5f9;
    padding: 0.65rem 0.85rem;
}

.legacy-content > table th {
    background: linear-gradient(to bottom, #f8fafc, #f1f5f9);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #475569;
}

.legacy-content a {
    color: #2f43b8;
    font-weight: 600;
}

.legacy-content a:hover {
    color: #3d56e6;
}

.legacy-content img {
    max-width: 100%;
    height: auto;
}

/*
 * Хабы разделов (скобы, комплектующие): сетка .localpagelist2 с avtotent —
 * оригинальный submenu.css не подключается, задаём сетку и карточки здесь.
 */
.legacy-content .localpagelist2 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
    gap: 1rem;
    margin: 1.25rem 0 2rem;
    width: 100%;
}

.legacy-content .localpagelist2__block {
    display: flex;
    min-height: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    padding: 1rem 0.65rem;
    border-radius: 1rem;
    border: 1px solid rgb(226 232 240);
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    text-decoration: none;
    color: #334155;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.35;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        color 0.15s ease;
}

.legacy-content .localpagelist2__block:hover {
    border-color: rgb(199 210 254 / 0.9);
    box-shadow: 0 10px 28px -8px rgba(15, 23, 42, 0.12);
    color: #0f172a;
}

.legacy-content .localpagelist2__block-pic,
.legacy-content .localpic.localpagelist2__block-pic {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
}

.legacy-content .localpagelist2__block-pic img,
.legacy-content .localpagelist2__block .localpic img {
    width: 100%;
    max-width: 7.5rem;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 0.75rem;
    border: 1px solid rgb(241 245 249);
}

.legacy-content .localpagelist2__block-text {
    display: block;
    text-align: center;
    hyphens: auto;
}

@media (min-width: 640px) {
    .legacy-content .localpagelist2 {
        grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
        gap: 1.25rem;
    }

    .legacy-content .localpagelist2__block {
        padding: 1.25rem 0.85rem;
        font-size: 0.875rem;
    }
}

/* Крупная иллюстрация над сеткой на странице «Комплектующие» */
.legacy-content--inner:has(.localpagelist2) > p:first-of-type:has(img) img {
    display: block;
    max-width: min(100%, 42rem);
    width: auto !important;
    height: auto !important;
    margin: 0 auto 1.5rem;
    border-radius: 1rem;
    border: 1px solid rgb(241 245 249);
    box-shadow: 0 4px 20px -4px rgba(15, 23, 42, 0.1);
}

/* Заголовок в теле дублирует h1 в шапке страницы */
.legacy-content--inner:has(.localpagelist2) > h1:first-of-type {
    display: none;
}

/* Нижний список тех же подразделов — дублирует сетку карточек */
.legacy-content--inner:has(.localpagelist2) ul.page-subpages.g-submenu {
    display: none;
}

.legacy-content .site-main__inner {
    margin-bottom: 3.5rem;
}

.legacy-content .site-main__inner:last-child {
    margin-bottom: 0;
}


.legacy-content .edit-block-title,
.legacy-content .content-block-title {
    font-family: var(--font-display);
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
}

@media (min-width: 640px) {
    .legacy-content .edit-block-title,
    .legacy-content .content-block-title {
        font-size: 1.875rem;
    }
}

/* Карточки каталога: прямые дети — .item (обёртка Owl) */
.legacy-content .edit-block-in.owl-carousel,
.legacy-content .edit-block-in {
    display: grid;
    width: 100%;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.legacy-content .edit-block-in.owl-carousel > .item {
    min-width: 0;
}

@media (min-width: 640px) {
    .legacy-content .edit-block-in.owl-carousel,
    .legacy-content .edit-block-in {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .legacy-content .edit-block-in.owl-carousel,
    .legacy-content .edit-block-in {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1280px) {
    .legacy-content .edit-block-in.owl-carousel,
    .legacy-content .edit-block-in {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.legacy-content .content-block-in {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

/* Главная (#materials): только картинки, без карточек и текстовых блоков */
.home-materials-legacy .content-block-in .content-block-body {
    align-items: stretch;
    border: 0;
    background: transparent;
    padding: 0;
    text-align: left;
    box-shadow: none;
}

.home-materials-legacy .content-block-in .block-pic,
.home-materials-legacy .content-block-in .jblock-img {
    min-height: 0;
}

.home-materials-legacy .content-block-in .content-block-body .block-pic img,
.home-materials-legacy .content-block-in .jblock-img img {
    width: auto;
    max-width: 80%;
    height: auto;
    max-height: 7rem;
    margin: 0 auto;
    border-radius: 0.75rem;
    border: 0;
    object-fit: contain;
    box-shadow: none;
    aspect-ratio: auto;
}

@media (min-width: 640px) {
    .home-materials-legacy .content-block-in .content-block-body .block-pic img,
    .home-materials-legacy .content-block-in .jblock-img img {
        max-height: 8rem;
    }
}

.home-materials-legacy .content-block-in .block-body-button {
    display: none !important;
}

/* Подписи к картинкам: .edit-content-block > .content-block-in */
.home-materials-legacy .edit-content-block .content-block-in .block-text,
.home-materials-legacy .edit-content-block .content-block-in .block-body-title {
    display: block !important;
    margin-top: 0.75rem;
    max-width: none;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.375;
    color: #1e293b;
}

.home-materials-legacy .edit-content-block .content-block-in .block-body-title {
    font-family: var(--font-display, 'Manrope', system-ui, sans-serif);
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

/*
 * Главная #materials: текст в div/strong (без p) — «Преимущества…» и т.п.
 * Тройной .site-main__inner: сворачиваем типографику, возвращаем сетку и медиа.
 */
#materials.home-materials-legacy .site-main__inner .site-main__inner .site-main__inner,
#materials.home-materials-legacy .site-main__inner .site-main__inner .site-main__inner * {
    font-size: 0 !important;
    line-height: 0 !important;
    color: transparent !important;
    -webkit-text-fill-color: transparent !important;
}

#materials.home-materials-legacy .site-main__inner .site-main__inner .site-main__inner :is(img, picture, video, svg, canvas, iframe, object) {
    font-size: revert !important;
    line-height: revert !important;
    color: revert !important;
    -webkit-text-fill-color: revert !important;
}

#materials.home-materials-legacy .site-main__inner .site-main__inner .site-main__inner :is(.content-block-in, .content-block-in *, .edit-block-in, .edit-block-in *, .owl-carousel, .owl-carousel *) {
    font-size: 1rem !important;
    line-height: normal !important;
    color: rgb(15 23 42) !important;
    -webkit-text-fill-color: rgb(15 23 42) !important;
}

/* #materials > … > .site-main__inner > .text-block */
#materials.home-materials-legacy > div > .site-main__inner > .site-main__inner > .site-main__inner > .text-block,
#materials.home-materials-legacy .site-main__inner .site-main__inner .site-main__inner .text-block {
    display: none !important;
}

@media (min-width: 640px) {
    .home-materials-legacy .edit-block-in,
    .home-materials-legacy .content-block-in {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1rem;
    }
}

@media (min-width: 1024px) {
    .home-materials-legacy .edit-block-in,
    .home-materials-legacy .content-block-in {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.home-materials-legacy .edit-block-body,
.home-materials-legacy .content-block-body {
    min-height: 7.5rem;
    border: 1px solid rgb(226 232 240 / 0.8);
    border-radius: 0.75rem;
    background: #fff;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-materials-legacy .edit-block-body img,
.home-materials-legacy .content-block-body img,
.home-materials-legacy .jblock-img img,
.home-materials-legacy .block-pic img {
    width: auto;
    max-width: 80%;
    height: auto;
    max-height: 4rem;
    object-fit: contain;
}

@media (min-width: 640px) {
    .legacy-content .content-block-in {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .legacy-content .content-block-in {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.legacy-content .edit-block-body,
.legacy-content .content-block-body {
    display: flex;
    min-height: 0;
    flex-direction: column;
    align-items: center;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    background: #fff;
    padding: 1.25rem;
    text-align: center;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.legacy-content .block-body-pic img {
    margin: 0;
    height: 9rem;
    width: 9rem;
    max-height: 10rem;
    max-width: 10rem;
    border-radius: 0.75rem;
    object-fit: cover;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    border: 1px solid #f1f5f9;
}

.legacy-content .jblock-img img,
.legacy-content .content-block-body .block-pic img {
    display: block;
    margin: 0 auto;
    height: 5rem;
    width: 5rem;
    max-height: 5rem;
    max-width: 5rem;
    object-fit: contain;
}

.legacy-content .block-text {
    margin-top: 1rem;
    max-width: 14rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.375;
    color: #1e293b;
}

.legacy-content .block-body-title {
    margin-top: 0.75rem;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

.legacy-content .block-body-button a {
    margin-top: 1rem;
    display: inline-block;
    border-radius: 9999px;
    background: linear-gradient(to right, #f59e0b, #ea580c);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.3);
}

.legacy-content td img {
    margin: 0.25rem 0;
    max-height: 6rem;
    max-width: 120px;
    border-radius: 0.375rem;
    border: 1px solid #f1f5f9;
    object-fit: contain;
}

.legacy-content .text-body p img {
    margin: 0.5rem 0.25rem;
    display: inline-block;
    max-height: 6rem;
    max-width: 100px;
    vertical-align: middle;
    border-radius: 0.5rem;
    border: 0;
    box-shadow: none;
}

.legacy-content .text-block > h1 {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Страница roliki-kolca-natyazhiteli: дубль H1 из импорта и первый абзац с «Ролики…» (уже в шапке страницы) */
.legacy-content--inner[data-page-slug="roliki-kolca-natyazhiteli"] > h1:first-of-type,
.legacy-content--inner[data-page-slug="roliki-kolca-natyazhiteli"] > p:first-of-type {
    display: none !important;
}

/*
 * komplektuyushchiye-prays-list — те же селекторы, что в app.css (режим без Vite).
 * Скрыто: 1-й и 2-й h1; p как 3–9-й дочерние узлы у .legacy-content--inner[data-page-slug]
 */
.legacy-content--inner[data-page-slug="komplektuyushchiye-prays-list"] > h1:nth-child(1),
.legacy-content--inner[data-page-slug="komplektuyushchiye-prays-list"] > h1:nth-child(2),
.legacy-content--inner[data-page-slug="komplektuyushchiye-prays-list"] > p:nth-child(3),
.legacy-content--inner[data-page-slug="komplektuyushchiye-prays-list"] > p:nth-child(4),
.legacy-content--inner[data-page-slug="komplektuyushchiye-prays-list"] > p:nth-child(5),
.legacy-content--inner[data-page-slug="komplektuyushchiye-prays-list"] > p:nth-child(6),
.legacy-content--inner[data-page-slug="komplektuyushchiye-prays-list"] > p:nth-child(7),
.legacy-content--inner[data-page-slug="komplektuyushchiye-prays-list"] > p:nth-child(8),
.legacy-content--inner[data-page-slug="komplektuyushchiye-prays-list"] > p:nth-child(9) {
    display: none !important;
}

/* Страница remont-tentov (классы legacy-repair-do-after / legacy-inline-gallery — SiteContentRewriter) */
.legacy-content--inner[data-page-slug='remont-tentov'] {
    max-width: 56rem;
    margin-left: auto;
    margin-right: auto;
}

.legacy-content--inner[data-page-slug='remont-tentov'] .legacy-repair-do-after {
    margin-bottom: 0.5rem;
    text-align: center !important;
}

.legacy-content--inner[data-page-slug='remont-tentov'] .legacy-repair-do-after span {
    font-size: inherit !important;
}

.legacy-content--inner[data-page-slug='remont-tentov'] .legacy-repair-do-after strong {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: 0.2em !important;
    color: #0f172a;
}

@media (min-width: 640px) {
    .legacy-content--inner[data-page-slug='remont-tentov'] .legacy-repair-do-after strong {
        font-size: 1.25rem;
    }
}

.legacy-content--inner[data-page-slug='remont-tentov'] .legacy-inline-gallery {
    display: flex !important;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    align-items: flex-start;
    margin: 1.5rem 0;
    text-align: center !important;
}

.legacy-content--inner[data-page-slug='remont-tentov'] .legacy-inline-gallery img {
    width: auto !important;
    max-width: min(100%, 18rem) !important;
    height: auto !important;
    border-radius: 0.75rem;
    border: 1px solid rgb(241 245 249);
    box-shadow: 0 8px 30px -8px rgba(15, 23, 42, 0.12);
}

.legacy-content--inner[data-page-slug='remont-tentov'] > p:not(:has(img)):not(.legacy-repair-do-after) {
    max-width: 48rem;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    text-wrap: balance;
    font-size: 1rem;
    line-height: 1.625;
    color: rgb(51 65 85);
}

@media (min-width: 640px) {
    .legacy-content--inner[data-page-slug='remont-tentov'] > p:not(:has(img)):not(.legacy-repair-do-after) {
        font-size: 1.125rem;
    }
}

/* Абзац с картинкой не попадал под :not(:has(img)) — уезжал влево относительно остального */
.legacy-content--inner[data-page-slug='remont-tentov'] > p:nth-child(4) {
    box-sizing: border-box;
    max-width: 48rem;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
    text-wrap: balance;
    font-size: 1rem;
    line-height: 1.625;
    color: rgb(51 65 85);
}

.legacy-content--inner[data-page-slug='remont-tentov'] > p:nth-child(8) {
    box-sizing: border-box;
    max-width: 48rem;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
    text-wrap: balance;
    font-size: 1rem;
    line-height: 1.625;
    color: rgb(51 65 85);
}

@media (min-width: 640px) {
    .legacy-content--inner[data-page-slug='remont-tentov'] > p:nth-child(4) {
        font-size: 1.125rem;
    }

    .legacy-content--inner[data-page-slug='remont-tentov'] > p:nth-child(8) {
        font-size: 1.125rem;
    }
}

.legacy-content--inner[data-page-slug='remont-tentov'] > p:nth-child(4) img {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.legacy-content--inner[data-page-slug='remont-tentov'] > p:nth-child(8) img {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.legacy-content--inner[data-page-slug='remont-tentov'] > ul {
    list-style: none;
    max-width: 56rem;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 2rem;
    padding: 0.75rem 1.5rem;
    border-radius: 1rem;
    border: 1px solid rgb(226 232 240 / 0.9);
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

/* Шапка страницы и контент — одна колонка по центру */
article:has(.legacy-content--inner[data-page-slug='remont-tentov']) .site-page-body > header {
    max-width: 56rem;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

@media (min-width: 640px) {
    .legacy-content--inner[data-page-slug='remont-tentov'] > ul {
        padding: 1rem 2rem;
    }
}

.legacy-content--inner[data-page-slug='remont-tentov'] > ul > li {
    border-bottom: 1px solid rgb(241 245 249);
    padding: 0.625rem 0;
    text-align: left;
    color: rgb(51 65 85);
}

.legacy-content--inner[data-page-slug='remont-tentov'] > ul > li:last-child {
    border-bottom: 0;
}

/*
 * Импорт лендингов Megagroup (класс .legacy-megagroup-import в SiteContentRewriter).
 * Галерея: Splide инициализируется в JS (см. resources/js/karkasy-splide.js и page.blade).
 */
.legacy-content--inner[data-page-slug='karkasy-dlya-kommercheskogo-transporta'] > h1:first-of-type {
    display: none !important;
}

.legacy-content--inner .legacy-megagroup-import {
    box-sizing: border-box;
    max-width: 56rem;
    margin-left: auto;
    margin-right: auto;
}

/* Страница каркасов: галерея и импорт на всю ширину блока статьи */
.legacy-content--inner.karkasy-page-layout .legacy-megagroup-import {
    max-width: none;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}

.legacy-megagroup-import .lpc-block {
    margin-bottom: 2rem;
}

.legacy-megagroup-import .lp-block-bg,
.legacy-megagroup-import .lp-block-overlay,
.legacy-megagroup-import .lp-block-bg__video,
.legacy-megagroup-import #lpc-styles-container:empty {
    display: none !important;
}

/* Галерея Splide (desktop: 3 фото, точки снизу внутри блока — иначе обрезает overflow у article) */
.legacy-megagroup-import .lpc-gallery-1__thumbnail {
    position: relative;
    padding-bottom: 2.75rem;
}

.legacy-megagroup-import .megagroup-gallery-splide.splide {
    margin-left: auto;
    margin-right: auto;
}

.legacy-megagroup-import .megagroup-gallery-splide .splide__track {
    overflow: hidden;
}

.legacy-megagroup-import .megagroup-gallery-splide .splide__slide {
    min-width: 0;
}

.legacy-megagroup-import .splide__arrows {
    display: none !important;
}

.legacy-megagroup-import .megagroup-gallery-splide .splide__pagination {
    bottom: 0.35rem;
    left: 0;
    right: 0;
    padding: 0;
    gap: 0.5rem;
}

.legacy-megagroup-import .megagroup-gallery-splide .splide__pagination__page {
    width: 10px;
    height: 10px;
    margin: 0;
    background: rgb(203 213 225);
    opacity: 1;
    transition:
        transform 0.15s ease,
        background 0.15s ease;
}

.legacy-megagroup-import .megagroup-gallery-splide .splide__pagination__page.is-active {
    background: #4f6dff;
    transform: scale(1.15);
}

.legacy-megagroup-import .lpc-gallery-1__photo-inner,
.legacy-megagroup-import .lpc-gallery-1__carousel-mask-item {
    display: block;
}

.legacy-megagroup-import .lpc-gallery-1__item-pic,
.legacy-megagroup-import .lpc-gallery-1__item-thumb-pic {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 0.75rem;
    border: 1px solid rgb(241 245 249);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

/* Пустой декоративный разделитель между блоками конструктора */
.legacy-megagroup-import .lpc-elements-line-2 {
    display: none;
}

/* Текст + иллюстрация */
.legacy-megagroup-import .lpc-elements-text-3__row {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

@media (min-width: 768px) {
    .legacy-megagroup-import .lpc-elements-text-3__row {
        flex-direction: row;
        align-items: flex-start;
    }

    .legacy-megagroup-import .lpc-elements-text-3__photos {
        flex: 0 0 38%;
        max-width: 38%;
    }

    .legacy-megagroup-import .lpc-elements-text-3__text-wrap {
        flex: 1 1 0;
        min-width: 0;
    }

    /* Страница каркасов: фото над текстом, не сбоку (перебивает раскладку выше) */
    .legacy-content--inner.karkasy-page-layout .lpc-elements-text-3__row {
        flex-direction: column !important;
        align-items: stretch;
    }

    .legacy-content--inner.karkasy-page-layout .lpc-elements-text-3__photos {
        flex: none !important;
        max-width: 100% !important;
        width: 100%;
        order: -1;
    }

    .legacy-content--inner.karkasy-page-layout .lpc-elements-text-3__text-wrap {
        flex: none;
        width: 100%;
        min-width: 0;
    }
}

.legacy-megagroup-import .lpc-elements-text-3__photo-wrap img {
    width: 100%;
    height: auto;
    border-radius: 0.75rem;
    border: 1px solid rgb(241 245 249);
    box-shadow: 0 4px 14px -4px rgba(15, 23, 42, 0.08);
}

.legacy-megagroup-import .lpc-elements-text-3__text {
    color: rgb(51 65 85);
}

.legacy-megagroup-import .lpc-elements-text-3__text h4 {
    margin: 0 0 0.75rem;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.65;
    color: rgb(51 65 85);
}

.legacy-megagroup-import .lpc-elements-text-3__text h4 span[style] {
    color: inherit !important;
}

.legacy-megagroup-import .lpc-elements-text-3__text ul {
    margin: 0.5rem 0 1rem;
    padding-left: 1.25rem;
    list-style: disc;
}

.legacy-megagroup-import .lpc-elements-text-3__text ul li {
    margin-bottom: 0.35rem;
}

.legacy-megagroup-import .lpc-elements-text-3__text ul li h4 {
    margin-bottom: 0;
    font-size: 0.98rem;
}

/* Кнопка из конструктора (без JS формы) */
.legacy-megagroup-import .lpc-elements-button-1__wrap {
    text-align: center;
}

.legacy-megagroup-import .lpc-elements-button-1__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0.25rem auto;
    padding: 0.65rem 1.75rem;
    border-radius: 9999px;
    background: linear-gradient(to right, #f59e0b, #ea580c);
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff !important;
    text-decoration: none;
    box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.35);
    scroll-margin-top: 6rem;
}

article:has(.legacy-content--inner[data-page-slug='karkasy-dlya-kommercheskogo-transporta']) .site-page-body > header {
    max-width: 56rem;
    margin-left: auto;
    margin-right: auto;
}

/* После галереи: форма по центру (до ~48rem), текст на всю ширину под формой */
.legacy-content--inner.karkasy-page-layout .karkasy-page-below-gallery {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: stretch;
    margin-top: 2rem;
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}

.legacy-content--inner.karkasy-page-layout .karkasy-page-below-gallery__form {
    box-sizing: border-box;
    width: 100%;
    max-width: min(48rem, 100%);
    align-self: center;
    margin-left: auto;
    margin-right: auto;
}

/* Текст и блоки импорта — на всю ширину контейнера страницы */
.legacy-content--inner.karkasy-page-layout .karkasy-page-below-gallery__body {
    width: 100%;
    max-width: none;
    min-width: 0;
}

/* Фото над текстом внутри полноширинного блока */
.karkasy-page-below-gallery__body .lpc-elements-text-3__row {
    flex-direction: column !important;
    align-items: stretch;
}

.karkasy-page-below-gallery__body .lpc-elements-text-3__photos {
    flex: none !important;
    max-width: 100% !important;
    width: 100%;
    order: -1;
}

.karkasy-page-below-gallery__body .lpc-elements-text-3__text-wrap {
    width: 100%;
    min-width: 0;
}

/*
 * Страница «Изготовление авто тентов» (SiteContentRewriter::polishIzgotovlenieAvtoTentovBody).
 */
article:has(.legacy-content--inner[data-page-slug='izgotovlenie-avto-tentov']) .site-page-body > header {
    max-width: 48rem;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.legacy-content--inner[data-page-slug='izgotovlenie-avto-tentov'] {
    max-width: 48rem;
    margin-left: auto;
    margin-right: auto;
}

.legacy-content--inner[data-page-slug='izgotovlenie-avto-tentov'] .legacy-izgotovlenie-hero {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem 1.25rem;
    margin: 0 0 1.75rem;
}

.legacy-content--inner[data-page-slug='izgotovlenie-avto-tentov'] .legacy-izgotovlenie-hero img {
    width: auto;
    max-width: min(100%, 11rem);
    height: auto;
    border-radius: 0.75rem;
    border: 1px solid rgb(241 245 249);
    box-shadow: 0 4px 18px -6px rgba(15, 23, 42, 0.12);
}

.legacy-content--inner[data-page-slug='izgotovlenie-avto-tentov'] .legacy-izgotovlenie-subtitle {
    margin: 0 0 1.25rem;
    text-align: center;
    font-family: var(--font-display);
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: #0f172a;
}

@media (min-width: 640px) {
    .legacy-content--inner[data-page-slug='izgotovlenie-avto-tentov'] .legacy-izgotovlenie-subtitle {
        font-size: 1.875rem;
    }
}

.legacy-content--inner[data-page-slug='izgotovlenie-avto-tentov'] h2:not(.legacy-izgotovlenie-subtitle) {
    margin-top: 2.25rem;
    margin-bottom: 0.75rem;
    text-align: center !important;
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #0f172a;
}

.legacy-content--inner[data-page-slug='izgotovlenie-avto-tentov'] h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    text-align: center !important;
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e293b;
}

.legacy-content--inner[data-page-slug='izgotovlenie-avto-tentov'] p:not(:has(img)):not(:has(a)) {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 1rem;
    line-height: 1.7;
    color: rgb(51 65 85);
    text-align: left;
    text-wrap: normal;
}

/* В импорте встречается inline text-indent у абзацев — убираем «красную строку». */
.legacy-content--inner[data-page-slug='izgotovlenie-avto-tentov'] p {
    text-indent: 0 !important;
    padding-left: 0 !important;
}

.legacy-content--inner[data-page-slug='izgotovlenie-avto-tentov'] p:has(> strong:only-child) {
    max-width: 42rem;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.legacy-content--inner[data-page-slug='izgotovlenie-avto-tentov'] p:has(> a.legacy-article-img-link),
.legacy-content--inner[data-page-slug='izgotovlenie-avto-tentov'] p:has(> img),
.legacy-content--inner[data-page-slug='izgotovlenie-avto-tentov'] p:has(> img + a),
.legacy-content--inner[data-page-slug='izgotovlenie-avto-tentov'] p:has(> a + img) {
    margin: 1.25rem 0;
    text-align: center;
}

.legacy-content--inner[data-page-slug='izgotovlenie-avto-tentov'] p:has(> img + img) {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 1rem;
    max-width: none;
}

.legacy-content--inner[data-page-slug='izgotovlenie-avto-tentov'] .legacy-article-img-link img {
    display: inline-block;
    width: auto;
    max-width: min(100%, 22rem);
    height: auto;
    border-radius: 0.75rem;
    border: 1px solid rgb(241 245 249);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
    transition: transform 0.15s ease;
}

.legacy-content--inner[data-page-slug='izgotovlenie-avto-tentov'] .legacy-article-img-link:hover img {
    transform: scale(1.02);
}

.legacy-content--inner[data-page-slug='izgotovlenie-avto-tentov'] p > img {
    display: inline-block;
    max-width: min(100%, 22rem);
    height: auto;
    border-radius: 0.75rem;
    border: 1px solid rgb(241 245 249);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
    vertical-align: middle;
}

/* Локально: в 8-м абзаце блока на странице "Изготовление авто тентов" картинки слишком мягкие — слегка уменьшаем. */
.legacy-content--inner[data-page-slug='izgotovlenie-avto-tentov'] > div:nth-child(7) > p:nth-child(8) img {
    max-width: min(100%, 18rem) !important;
}

.legacy-content--inner[data-page-slug='izgotovlenie-avto-tentov'] > div:nth-child(15) > p:first-child,
.legacy-content--inner[data-page-slug='izgotovlenie-avto-tentov'] > div:nth-child(15) > h2,
.legacy-content--inner[data-page-slug='izgotovlenie-avto-tentov'] > div:nth-child(15) > h2 * {
    text-align: center !important;
}

.legacy-content--inner[data-page-slug='izgotovlenie-avto-tentov'] ul {
    margin: 1rem auto 1.75rem;
    max-width: 40rem;
    padding-left: 0 !important;
    text-align: left;
    color: rgb(51 65 85);
    line-height: 1.6;
}

.legacy-content--inner[data-page-slug='izgotovlenie-avto-tentov'] a:not(.legacy-article-img-link) {
    color: #2f43b8;
    font-weight: 600;
}

.legacy-content--inner[data-page-slug='izgotovlenie-avto-tentov'] a:not(.legacy-article-img-link):hover {
    color: #3d56e6;
}

/* rasschitat-stoimost: по запросу скрываем H1 в шапке article */
article:has(.legacy-content--inner[data-page-slug='rasschitat-stoimost']) .site-page-body > header > h1 {
    display: none !important;
}

/*
 * Страница "Услуги": старый табличный импорт -> карточки, центрирование и читабельная типографика.
 */
article:has(.legacy-content--inner[data-page-slug='uslugi']) .site-page-body > header {
    max-width: 64rem;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.legacy-content--inner[data-page-slug='uslugi'] {
    max-width: 64rem;
    margin-left: auto;
    margin-right: auto;
}

.legacy-content--inner[data-page-slug='uslugi'] > h1:first-of-type {
    display: none !important;
}

.legacy-content--inner[data-page-slug='uslugi'] .legacy-uslugi-lead {
    margin: 0 0 1rem;
    text-align: center;
    font-family: var(--font-display);
    font-size: 1.55rem;
    font-weight: 800;
    line-height: 1.2;
}

.legacy-content--inner[data-page-slug='uslugi'] .legacy-uslugi-lead a {
    color: #1e293b;
    text-decoration: none;
}

.legacy-content--inner[data-page-slug='uslugi'] > p:has(> img) {
    text-align: center !important;
    margin: 0 0 1.25rem;
}

.legacy-content--inner[data-page-slug='uslugi'] > p:has(> img) img {
    width: min(100%, 22rem) !important;
    height: auto !important;
    border-radius: 0.75rem;
    border: 1px solid rgb(241 245 249);
    box-shadow: 0 4px 18px -6px rgba(15, 23, 42, 0.12);
}

.legacy-content--inner[data-page-slug='uslugi'] > h4 {
    max-width: 58rem;
    margin: 0 auto 1.25rem;
    text-align: center !important;
    line-height: 1.65;
    color: rgb(51 65 85);
}

.legacy-content--inner[data-page-slug='uslugi'] .legacy-table-scroll {
    margin: 1rem 0 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.legacy-content--inner[data-page-slug='uslugi'] .legacy-table-scroll table,
.legacy-content--inner[data-page-slug='uslugi'] .legacy-table-scroll tbody {
    display: block;
    width: 100% !important;
    min-width: 0;
}

.legacy-content--inner[data-page-slug='uslugi'] .legacy-table-scroll tr {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 900px) {
    .legacy-content--inner[data-page-slug='uslugi'] .legacy-table-scroll tr {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.25rem;
    }
}

.legacy-content--inner[data-page-slug='uslugi'] .legacy-table-scroll td {
    display: block !important;
    padding: 1.1rem 1rem !important;
    border: 1px solid rgb(226 232 240 / 0.9) !important;
    border-radius: 1rem;
    background: #fff !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.legacy-content--inner[data-page-slug='uslugi'] .legacy-table-scroll td h1 {
    margin: 0.15rem 0 0.65rem;
    text-align: center;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.3;
    color: #0f172a;
}

.legacy-content--inner[data-page-slug='uslugi'] .legacy-table-scroll td h1 a {
    color: #1e293b;
    text-decoration: none;
}

.legacy-content--inner[data-page-slug='uslugi'] .legacy-table-scroll td p {
    margin: 0.4rem 0;
    text-align: center;
    line-height: 1.58;
    color: rgb(51 65 85);
}

.legacy-content--inner[data-page-slug='uslugi'] .legacy-table-scroll td p img,
.legacy-content--inner[data-page-slug='uslugi'] .legacy-table-scroll td h1 img {
    width: min(100%, 22rem) !important;
    max-width: min(100%, 22rem) !important;
    height: auto !important;
    margin-left: auto;
    margin-right: auto;
    border-radius: 0.75rem;
    border: 1px solid rgb(241 245 249);
    box-shadow: 0 4px 16px -8px rgba(15, 23, 42, 0.12);
}

/* Новый аккуратный layout страницы услуг (данные из старой страницы, без табличного импорта). */
.legacy-content--inner[data-page-slug='uslugi'] .legacy-uslugi-page {
    max-width: 68rem;
    margin: 0 auto;
}

.legacy-content--inner[data-page-slug='uslugi'] .legacy-uslugi-title {
    margin: 0 0 0.75rem;
    text-align: center;
    font-family: var(--font-display);
    font-size: clamp(1.35rem, 5vw, 2rem);
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.03em;
}

.legacy-content--inner[data-page-slug='uslugi'] .legacy-uslugi-intro {
    max-width: 52rem;
    margin: 0 auto 1.5rem;
    text-align: center;
    color: rgb(71 85 105);
    line-height: 1.7;
}

.legacy-content--inner[data-page-slug='uslugi'] .legacy-uslugi-highlight {
    margin: 0 auto 1.5rem;
    max-width: 52rem;
    border: 1px solid rgb(226 232 240 / 0.9);
    border-radius: 1rem;
    padding: 1rem;
    background: linear-gradient(to bottom, #fff, #f8fafc);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    text-align: center;
}

.legacy-content--inner[data-page-slug='uslugi'] .legacy-uslugi-highlight__link {
    display: inline-block;
    margin-bottom: 0.8rem;
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e293b;
    text-decoration: none;
}

.legacy-content--inner[data-page-slug='uslugi'] .legacy-uslugi-highlight img {
    width: min(100%, 22rem);
    height: auto;
    border-radius: 0.8rem;
    border: 1px solid rgb(241 245 249);
    box-shadow: 0 4px 16px -8px rgba(15, 23, 42, 0.12);
}

.legacy-content--inner[data-page-slug='uslugi'] .legacy-uslugi-highlight p {
    margin: 0.9rem auto 0;
    max-width: 48rem;
    line-height: 1.7;
    color: rgb(51 65 85);
}

.legacy-content--inner[data-page-slug='uslugi'] .legacy-uslugi-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 860px) {
    .legacy-content--inner[data-page-slug='uslugi'] .legacy-uslugi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.1rem;
    }
}

.legacy-content--inner[data-page-slug='uslugi'] .legacy-uslugi-card {
    border: 1px solid rgb(226 232 240 / 0.9);
    border-radius: 1rem;
    padding: 0.95rem;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    text-align: center;
}

.legacy-content--inner[data-page-slug='uslugi'] .legacy-uslugi-card h3 {
    margin: 0 0 0.65rem;
    font-family: var(--font-display);
    font-size: 1.2rem;
    line-height: 1.25;
    color: #0f172a;
}

.legacy-content--inner[data-page-slug='uslugi'] .legacy-uslugi-card h3 a {
    color: inherit;
    text-decoration: none;
}

.legacy-content--inner[data-page-slug='uslugi'] .legacy-uslugi-card img {
    width: min(100%, 22rem);
    max-width: min(100%, 22rem);
    height: auto;
    border-radius: 0.8rem;
    border: 1px solid rgb(241 245 249);
    box-shadow: 0 4px 16px -8px rgba(15, 23, 42, 0.12);
}

.legacy-content--inner[data-page-slug='uslugi'] .legacy-uslugi-card p {
    margin: 0.8rem auto 0;
    max-width: 30rem;
    color: rgb(51 65 85);
    line-height: 1.6;
}

/*
 * tkan-pvkh-900g-m2-kh-3m-1: широкая 11-колоночная таблица.
 * Глобальные настройки для 7 колонок здесь слишком сжимают ячейки.
 */
.legacy-content--inner[data-page-slug='tkan-pvkh-900g-m2-kh-3m-1'] .legacy-table-scroll {
    overflow-x: auto;
    overflow-y: visible;
    border-radius: 0.9rem;
    border: 1px solid rgb(226 232 240 / 0.85);
    background: #fff;
}

.legacy-content--inner[data-page-slug='tkan-pvkh-900g-m2-kh-3m-1'] .legacy-table-scroll table {
    min-width: 1120px !important;
    width: max-content !important;
    max-width: none !important;
    table-layout: auto !important;
}

.legacy-content--inner[data-page-slug='tkan-pvkh-900g-m2-kh-3m-1'] .legacy-table-scroll thead th {
    max-width: none !important;
    min-width: 5.5rem;
    white-space: normal !important;
    word-break: normal;
    overflow-wrap: anywhere;
    text-align: center !important;
    vertical-align: middle !important;
}

.legacy-content--inner[data-page-slug='tkan-pvkh-900g-m2-kh-3m-1'] .legacy-table-scroll thead th:first-child {
    min-width: 7.5rem;
    max-width: none !important;
    padding-left: 0.6rem !important;
    padding-right: 0.6rem !important;
}

.legacy-content--inner[data-page-slug='tkan-pvkh-900g-m2-kh-3m-1'] .legacy-table-scroll thead th:nth-child(2),
.legacy-content--inner[data-page-slug='tkan-pvkh-900g-m2-kh-3m-1'] .legacy-table-scroll tbody td:nth-child(2) {
    min-width: 4.2rem;
    max-width: none !important;
    white-space: nowrap !important;
    word-break: normal !important;
    text-align: center !important;
    padding-left: 0.6rem !important;
    padding-right: 0.6rem !important;
}

.legacy-content--inner[data-page-slug='tkan-pvkh-900g-m2-kh-3m-1'] .legacy-table-scroll thead th:nth-child(3),
.legacy-content--inner[data-page-slug='tkan-pvkh-900g-m2-kh-3m-1'] .legacy-table-scroll tbody td:nth-child(3) {
    min-width: 14rem;
    text-align: left !important;
}

.legacy-content--inner[data-page-slug='tkan-pvkh-900g-m2-kh-3m-1'] .legacy-table-scroll tbody td:first-child {
    width: auto !important;
    min-width: 7.5rem !important;
    max-width: none !important;
    padding-left: 0.6rem !important;
    padding-right: 0.6rem !important;
}

.legacy-content--inner[data-page-slug='tkan-pvkh-900g-m2-kh-3m-1'] .legacy-table-scroll tbody td:first-child img {
    width: 4.5rem !important;
    height: 4.5rem !important;
    max-width: 4.5rem !important;
    max-height: 4.5rem !important;
    object-fit: cover !important;
    border-radius: 0.6rem;
}

.legacy-content--inner[data-page-slug='tkan-pvkh-900g-m2-kh-3m-1'] .legacy-table-scroll tbody td {
    white-space: normal;
    vertical-align: middle !important;
}

/*
 * tkan-pvkh-550g-m2-kh-2-5m: локальные правки импорта
 * - убираем мусорную 2-ю строку tbody,
 * - выравниваем стиль текста в колонке "Наименование",
 * - добавляем заметную тень белым миниатюрам.
 */
.legacy-content--inner[data-page-slug='tkan-pvkh-550g-m2-kh-2-5m'] .legacy-table-scroll tbody tr:nth-child(2) {
    display: none !important;
}

.legacy-content--inner[data-page-slug='tkan-pvkh-550g-m2-kh-2-5m'] .legacy-table-scroll tbody td:nth-child(2),
.legacy-content--inner[data-page-slug='tkan-pvkh-550g-m2-kh-2-5m'] .legacy-table-scroll tbody td:nth-child(2) * {
    color: rgb(51 65 85) !important;
    font-size: 0.875rem !important;
    font-weight: 400 !important;
    line-height: 1.45 !important;
}

.legacy-content--inner[data-page-slug='tkan-pvkh-550g-m2-kh-2-5m'] .legacy-table-scroll tbody td:first-child img {
    box-shadow: 0 8px 20px -12px rgba(15, 23, 42, 0.45), 0 0 0 1px rgb(226 232 240) !important;
}

/* "Тент на Газель": подписи ДО/ПОСЛЕ должны ровно стоять над фото */
.legacy-content--inner[data-page-slug='tent-na-gazel'] .legacy-do-after-labels {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 1fr 2fr;
    align-items: center;
    gap: 0.75rem;
    max-width: 60rem;
    margin: 1rem auto 0.45rem;
    padding: 0;
    text-align: center !important;
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    color: #1f2937;
}

.legacy-content--inner[data-page-slug='tent-na-gazel'] .legacy-do-after-labels > span:last-child {
    justify-self: center;
}

.legacy-content--inner[data-page-slug='tent-na-gazel'] .legacy-do-after-gallery {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.8rem;
    max-width: 60rem;
    margin: 0 auto 1.25rem;
    text-align: center !important;
}

@media (min-width: 860px) {
    .legacy-content--inner[data-page-slug='tent-na-gazel'] .legacy-do-after-gallery {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.9rem;
    }
}

.legacy-content--inner[data-page-slug='tent-na-gazel'] .legacy-do-after-gallery img {
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 0.75rem;
    border: 1px solid rgb(241 245 249);
    box-shadow: 0 3px 14px -8px rgba(15, 23, 42, 0.18);
}


/* site-product-sheet: кнопка CTA должна оставаться с белым текстом */
.legacy-content--inner .site-product-sheet .min-w-0.flex-1 > a,
.legacy-content--inner .site-product-sheet .min-w-0.flex-1 > a:hover,
.legacy-content--inner .site-product-sheet .min-w-0.flex-1 > a:focus-visible {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    opacity: 1 !important;
}


/* tent-na-gazel: первый блок фото чуть меньше, чтобы исходники выглядели резче */
.legacy-content--inner[data-page-slug='tent-na-gazel'] > p:nth-child(1) > img,
.legacy-content--inner[data-page-slug='tent-na-gazel'] > p:nth-child(1) > a > img {
    width: min(100%, 16rem) !important;
    max-width: min(100%, 16rem) !important;
}

.legacy-content--inner[data-page-slug='tent-na-gazel'] > p:nth-child(1) {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.9rem;
}

.legacy-content--inner[data-page-slug='tent-na-gazel'] > p:nth-child(1) > a {
    display: flex;
    width: min(100%, 16rem);
    justify-content: center;
}

.legacy-content--inner[data-page-slug='tent-na-gazel'] > p:nth-child(1) > a > img {
    width: 100% !important;
    max-width: 100% !important;
}


.legacy-content--inner[data-page-slug='pologa-ukryvnyye-tenty'] > ol {
    max-width: 52rem;
    margin: 0.75rem auto 1.25rem;
    padding-left: 0 !important;
    line-height: 1.62;
    color: rgb(51 65 85);
}


/* skoby-bortovyye-kruglyye: при режиме «Показать все» скрываем авто-тулбар поиска, чтобы не ломал раскладку */
.legacy-content--inner[data-page-slug='skoby-bortovyye-kruglyye'] .legacy-table-toolbar {
    display: none !important;
}
