/* Ценовые таблицы раздела /narkologiya/ (перенос с narkocenter116.ru).
   Обёртка .table-wrap даёт горизонтальный скролл на узких экранах,
   колонка цены — nowrap и по содержимому, описанию — остальная ширина.
   Специфичность селекторов выше .vc-visual-editor table (table-layout:fixed). */

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

.vc-visual-editor table.narko-prices,
table.narko-prices {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.narko-prices td:last-child,
.narko-prices th:last-child {
    white-space: nowrap;
    width: 1%;
}

.narko-prices td:first-child {
    width: auto;
}

/* Пункты списка с жирным термином: strong не должен сжиматься в колонку
   (.vc-visual-editor li — flex, термин превращался в узкую колонку) */
.vc-visual-editor ul li:has(> strong:first-child) {
    display: block;
    position: relative;
    padding-left: 24px;
}
.vc-visual-editor ul li:has(> strong:first-child)::before {
    position: absolute;
    left: 0;
    top: 0.55em;
    margin: 0;
}

/* ===== Цветная плитка услуг (перенос narkocenter116.ru) ===== */
.narko-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 20px 0 8px;
}
.narko-tiles > .narko-tile,
.narko-tiles > .narko-card {
    flex: 1 1 calc(33.333% - 11px);
    min-width: 280px;
}
@media (max-width: 1024px) {
    .narko-tiles > .narko-tile,
    .narko-tiles > .narko-card { flex: 1 1 calc(50% - 8px); }
}
@media (max-width: 640px) {
    .narko-tiles > .narko-tile,
    .narko-tiles > .narko-card { flex: 1 1 100%; }
}

/* Карточка-категория с цветным заголовком */
.narko-tile {
    border-radius: 16px;
    padding: 20px;
    background: #f3f1fd;
    box-shadow: 0 4px 16px rgba(38, 24, 86, .08);
}
.narko-tile--mint { background: #e8f7f4; }
.narko-tile--peach { background: #fef3e6; }
.narko-tile__title {
    font-weight: 700;
    font-size: 17px;
    line-height: 1.3;
    margin: 0 0 12px;
    color: #6d60d7;
}
.narko-tile--mint .narko-tile__title { color: #0e8a6d; }
.narko-tile--peach .narko-tile__title { color: #c47a1f; }
.narko-tile__list { list-style: none; margin: 0; padding: 0; }
.narko-tile__list li { display: block; margin: 0; padding: 0; }
.narko-tile__list li::before { display: none; }
.narko-tile__list li + li { border-top: 1px dashed rgba(109, 96, 215, .25); }
.narko-tile__list a {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 9px 0;
    text-decoration: none;
    color: #1e1e1e;
    font-size: 15px;
    line-height: 1.4;
}
.narko-tile__list a:hover { color: #6d60d7; }
.narko-tile__price { white-space: nowrap; font-weight: 600; color: #6d60d7; }
.narko-tile--mint .narko-tile__price { color: #0e8a6d; }
.narko-tile--peach .narko-tile__price { color: #c47a1f; }

/* Карточка-услуга (одиночная, с описанием) */
.narko-card {
    border-radius: 16px;
    padding: 18px 20px;
    background: #f3f1fd;
    box-shadow: 0 4px 16px rgba(38, 24, 86, .08);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.narko-tiles > .narko-card:nth-child(3n+2) { background: #e8f7f4; }
.narko-tiles > .narko-card:nth-child(3n) { background: #fef3e6; }
.narko-card__title {
    font-weight: 700;
    font-size: 16px;
    line-height: 1.3;
    color: #6d60d7;
    text-decoration: none;
}
.narko-card__title:hover { text-decoration: underline; }
.narko-tiles > .narko-card:nth-child(3n+2) .narko-card__title { color: #0e8a6d; }
.narko-tiles > .narko-card:nth-child(3n) .narko-card__title { color: #c47a1f; }
.narko-card__price { white-space: nowrap; font-weight: 700; font-size: 15px; color: #6d60d7; }
.narko-card__text { font-size: 14px; line-height: 1.55; color: #333; }

/* ===== Стилизация ценовых таблиц (.narko-prices): цветная шапка, зебра, скругление ===== */
.table-wrap {
    border-radius: 12px;
    background: #fff;
}
.narko-prices thead th {
    background: #6d60d7 !important;
    color: #fff;
    font-weight: 600;
}
.narko-prices tbody tr:nth-child(odd) { background: #f7f5fe; }
.narko-prices tbody tr:nth-child(even) { background: #fff; }
.narko-prices tr { border-bottom: 1px solid rgba(109, 96, 215, .18) !important; }
.narko-prices {
    border: 1px solid rgba(109, 96, 215, .22);
}

/* ===== Дизайн-паттерн «v-statsionare» (.pz-) — hero, рассрочка, карточки пакетов =====
   Палитра приведена к фирменной: #6d60d7 + пастели #eafaf1/#f4f7ff/#eef4ff. */
.pz-hero {
    background: linear-gradient(135deg, #eafaf1 0%, #f4f7ff 100%);
    padding-top: 36px;
    padding-bottom: 36px;
}
.pz-hero__lead {
    max-width: 720px;
    font-size: 18px;
    line-height: 1.6;
    margin: 0;
}
.pz-hero__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 22px;
}
.pz-hero__note {
    margin-top: 16px;
    color: #4a5568;
    margin-bottom: 0;
}

.pz-installment {
    background: linear-gradient(135deg, #6d60d7 0%, #5683f3 100%);
    color: #fff;
}
.pz-installment__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}
.pz-installment__title {
    color: #fff;
    margin: 0 0 10px;
}
.pz-installment__text {
    color: #eef0ff;
    margin: 0;
    max-width: 720px;
}
.pz-installment .vc-btn {
    background: #fff;
    color: #6d60d7;
    flex-shrink: 0;
}

.pz-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.pz-card {
    background: #fff;
    border: 1px solid #e8eaf3;
    border-radius: 18px;
    padding: 26px;
    box-shadow: 0 6px 24px rgba(76, 64, 143, .08);
    display: flex;
    flex-direction: column;
}
.pz-card h3 { margin: 0 0 8px; font-size: 20px; line-height: 1.3; }
.pz-price { font-size: 24px; font-weight: 700; color: #6d60d7; margin-bottom: 4px; }
.pz-pack { color: #718096; margin-bottom: 16px; }
.pz-card ul { list-style: none; padding: 0; margin: 0 0 18px; flex: 1; }
.pz-card li { position: relative; padding-left: 26px; margin-bottom: 10px; line-height: 1.5; color: #3a4356; }
.pz-card li::before { content: '\2713'; position: absolute; left: 0; top: 0; color: #38a169; font-weight: 700; }
.pz-card .vc-btn { width: 100%; justify-content: center; }
.pz-num { font-size: 38px; font-weight: 800; color: #c9cdf3; line-height: 1; margin-bottom: 12px; }
.pz-card p { color: #3a4356; line-height: 1.55; margin: 0; }
@media (max-width: 640px) {
    .pz-grid { gap: 16px; }
    .pz-card { padding: 20px; }
}

.pz-cta-section {
    background: linear-gradient(135deg, #eef4ff 0%, #eafaf1 100%);
    text-align: center;
}
.pz-cta-section p { max-width: 640px; margin: 0 auto; }
.pz-cta-section .pz-hero__actions { justify-content: center; }

.gallery-palat { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.gallery-palat figure { margin: 0; background: #fff; border-radius: 16px; padding: 14px; box-shadow: 0 8px 28px rgba(76,64,143,.12); border: 1px solid #eef0f6; }
.gallery-palat img { width: 100%; height: 240px; object-fit: cover; border-radius: 10px; display: block; }
.gallery-palat figcaption { padding: 12px 4px 2px; color: #4a5568; font-size: 15px; }
@media (max-width: 768px) {
  .gallery-palat { grid-template-columns: 1fr; gap: 16px; }
  .gallery-palat img { height: 200px; }
}
@media (max-width: 480px) {
  .gallery-palat img { height: 170px; }
  .gallery-palat figure { padding: 10px; }
}

/* Единый стиль карточек: перенесённые .narko-card приведены к виду .pz-card */
.narko-card {
    background: #fff;
    border: 1px solid #e8eaf3;
    border-radius: 18px;
    box-shadow: 0 6px 24px rgba(76, 64, 143, .08);
}
.narko-tiles > .narko-card:nth-child(3n+2),
.narko-tiles > .narko-card:nth-child(3n) { background: #fff; }

/* ===== Пакет доработок 16.09.2026 ===== */

/* --- Блок 3: баннер «Рассрочка» (по референсу panacea.clinic, фирменные цвета) --- */
.pz-installment { background: none; color: #1e1e1e; }
.pz-installment__inner {
    display: block;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #3d3385 0%, #6d60d7 100%);
    border-radius: 20px;
    padding: 40px 44px;
    color: #fff;
}
.pz-installment__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 100px;
    padding: 7px 14px;
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: .02em;
    color: #eef0ff;
    margin-bottom: 18px;
}
.pz-installment__badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #7ef0c1;
    flex-shrink: 0;
    animation: pz-pulse 1.8s ease-out infinite;
}
@keyframes pz-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(126, 240, 193, .55); }
    70%  { box-shadow: 0 0 0 9px rgba(126, 240, 193, 0); }
    100% { box-shadow: 0 0 0 0 rgba(126, 240, 193, 0); }
}
.pz-installment__body { max-width: 62%; }
.pz-installment__title {
    color: #fff;
    margin: 0 0 12px;
    font-size: 26px;
    line-height: 1.25;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .01em;
}
.pz-installment__text {
    color: #dfe2ff;
    margin: 0 0 20px;
    max-width: 640px;
    font-size: 15.5px;
    line-height: 1.6;
}
.pz-installment__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 24px;
    padding: 0;
    list-style: none;
}
.pz-installment__chips li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 100px;
    padding: 8px 14px;
    font-size: 13.5px;
    font-weight: 500;
    color: #fff;
    margin: 0;
}
.pz-installment__chips li::before {
    content: '\2713';
    color: #7ef0c1;
    font-weight: 700;
}
.pz-installment__chips li::after { display: none; }
.pz-installment .vc-btn {
    background: #fff;
    color: #3d3385;
    flex-shrink: 0;
}
.pz-installment .vc-btn:hover { background: #f0eeff; }
.pz-installment__media {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 34%;
    min-width: 280px;
}
.pz-installment__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 38%);
    mask-image: linear-gradient(90deg, transparent 0%, #000 38%);
}
@media (max-width: 900px) {
    .pz-installment__body { max-width: 100%; }
    .pz-installment__media { display: none; }
    .pz-installment__inner { padding: 30px 24px; }
}
@media (max-width: 640px) {
    .pz-installment__inner { padding: 24px 18px; border-radius: 16px; }
    .pz-installment__title { font-size: 19px; }
    .pz-installment__text { font-size: 14.5px; }
    .pz-installment .vc-btn { width: 100%; justify-content: center; }
}

/* --- Блок 5: врачи / отзывы / фото клиники на страницах услуг --- */
.pz-doctors, .pz-reviews, .pz-gallery { margin-top: 40px; }
.pz-doctors__grid {
    display: grid;
    /* auto-fit: при 1–3 карточках пустые треки схлопываются — «дыр» нет;
       при 4 карточках — ровно 4 колонки */
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}
.pz-doctor {
    background: #fff;
    border: 1px solid #e8eaf3;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 6px 24px rgba(76, 64, 143, .08);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
}
.pz-doctor:hover { text-decoration: none; }
.pz-doctor img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 14px;
    border: 3px solid #f3f1fd;
}
.pz-doctor__name { font-weight: 700; font-size: 15.5px; line-height: 1.3; margin-bottom: 6px; color: #1e1e1e; }
.pz-doctor__spec { font-size: 13.5px; color: #718096; line-height: 1.45; margin-bottom: 6px; }
.pz-doctor__exp { font-size: 13px; color: #6d60d7; font-weight: 600; }
.pz-doctors__all, .pz-reviews__all { margin-top: 18px; }
.pz-reviews__list { display: grid; grid-template-columns: 1fr; gap: 16px; }
.pz-review {
    background: #fff;
    border: 1px solid #e8eaf3;
    border-radius: 16px;
    padding: 22px 24px;
    box-shadow: 0 4px 16px rgba(76, 64, 143, .06);
}
.pz-review__text { font-size: 15px; line-height: 1.65; color: #3a4356; margin: 0 0 12px; }
.pz-review__meta { font-size: 13.5px; color: #718096; font-weight: 600; }
.pz-gallery__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.pz-gallery__grid a { display: block; border-radius: 16px; overflow: hidden; background: #f3f1fd; padding: 8px; box-shadow: 0 4px 16px rgba(76,64,143,.08); }
.pz-gallery__grid img { width: 100%; height: 180px; object-fit: cover; border-radius: 10px; display: block; transition: transform .3s ease; }
.pz-gallery__grid a:hover img { transform: scale(1.04); }
@media (max-width: 1024px) {
    /* 641–1024: ровно 2 колонки; неполный последний ряд (1 или 3 карточки)
       — карточка по центру вместо пустой ячейки */
    .pz-doctors__grid { grid-template-columns: repeat(2, 1fr); }
    .pz-doctor:last-child:nth-child(odd) {
        grid-column: 1 / -1;
        justify-self: center;
        width: 100%;
        max-width: 420px;
    }
    .pz-gallery__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    /* ≤640: одна колонка; карточка горизонтально — круглое фото слева, текст справа */
    .pz-doctors__grid { grid-template-columns: 1fr; gap: 12px; }
    .pz-doctor:last-child:nth-child(odd) { max-width: none; }
    .pz-doctor {
        display: grid;
        grid-template-columns: auto 1fr;
        column-gap: 14px;
        align-items: center;
        text-align: left;
        padding: 14px 16px;
    }
    .pz-doctor img { grid-row: 1 / span 3; width: 72px; height: 72px; margin: 0; }
    .pz-gallery__grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .pz-gallery__grid img { height: 130px; }
}

/* --- Блок 6.1: фото в контенте (.pz-content — перенесённые страницы) --- */
.pz-content img {
    max-width: 100%;
    height: auto;
    background: #f3f1fd;
    padding: 12px;
    border-radius: 16px;
    box-shadow: 0 6px 24px rgba(76, 64, 143, .10);
    box-sizing: border-box;
}
.pz-content .gallery-palat img,
.pz-content .pz-gallery__grid img,
.pz-content .pz-doctor img { padding: 0; background: none; box-shadow: none; border-radius: 10px; }

/* --- Блок 6.2: видео в контенте --- */
.pz-video {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #f3f1fd;
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 6px 24px rgba(76, 64, 143, .10);
    margin: 20px 0;
}
.pz-video iframe,
.pz-video video {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 10px;
    display: block;
    object-fit: cover;
}
@supports not (aspect-ratio: 16 / 9) {
    .pz-video { padding-top: 56.25%; height: 0; }
    .pz-video iframe, .pz-video video { position: absolute; left: 12px; right: 12px; top: 12px; bottom: 12px; height: auto; }
}

/* --- Блок 6.3: список литературы / источники --- */
.pz-sources {
    font-size: .85em;
    color: #718096;
    background: #fafafe;
    border: 1px solid #eef0f6;
    border-radius: 14px;
    padding: 18px 22px;
    margin-top: 28px;
}
.pz-sources h2, .pz-sources h3 { font-size: 1.05em; margin: 0 0 10px; color: #4a5568; }
.pz-sources ol { margin: 0; padding-left: 20px; }
.pz-sources li { margin-bottom: 6px; line-height: 1.55; }
.pz-sources a { color: #6d60d7; overflow-wrap: anywhere; word-break: break-word; }

/* --- Мобильный фикс 2: «буквенные колонки» и уезжающий за край контент в списках ---
   Шаблон (app.min.css) делает .vc-visual-editor li flex-рядом «маркер + контент».
   В пункте с несколькими inline-узлами (текст + ссылки + картинки) каждый узел
   становится flex-элементом: либо сжимается до min-content (текст рвётся по буквам —
   «Список литературы» на /narkologiya/vyvod-iz-zapoya/na-domu/), либо уезжает
   за правый край экрана (статьи, напр. /stati/lechenie-narkomanii-doma/).
   Возвращаем контентным спискам обычный блочный рендер с висячим маркером.
   Компоненты с собственными li (карточки, чипы, плитки) исключены. */
.vc-visual-editor ol li:not(.pz-card li):not(.pz-installment li):not(.narko-tile__list li):not(.pz-doctors li):not(.pz-reviews li):not(.pz-gallery li):not(.gallery-palat li),
.vc-visual-editor ul li:not(.pz-card li):not(.pz-installment li):not(.narko-tile__list li):not(.pz-doctors li):not(.pz-reviews li):not(.pz-gallery li):not(.gallery-palat li) {
    display: block;
    position: relative;
    padding-left: 26px;
}
.vc-visual-editor ol li:not(.pz-card li):not(.pz-installment li):not(.narko-tile__list li):not(.pz-doctors li):not(.pz-reviews li):not(.pz-gallery li):not(.gallery-palat li)::before,
.vc-visual-editor ul li:not(.pz-card li):not(.pz-installment li):not(.narko-tile__list li):not(.pz-doctors li):not(.pz-reviews li):not(.pz-gallery li):not(.gallery-palat li)::before {
    position: absolute;
    left: 0;
    top: 0;
}
.vc-visual-editor ul li:not(.pz-card li):not(.pz-installment li):not(.narko-tile__list li):not(.pz-doctors li):not(.pz-reviews li):not(.pz-gallery li):not(.gallery-palat li)::before { top: .55em; }
/* Фикс-ширины картинок из контента не должны ломать мобильную вёрстку */
.vc-visual-editor img { max-width: 100%; height: auto; }
/* Длинные URL в контенте переносятся, а не режутся посимвольно и не ломают ширину */
.vc-visual-editor a { overflow-wrap: anywhere; word-break: break-word; }

/* Специфичность: шаблонный .vc-visual-editor ul li::before (content:"") перебивает
   наши ::before с галочками ('✓') в карточках и чипах — поднимаем специфичность. */
.pz-card.pz-card li::before { content: '\2713'; position: absolute; left: 0; top: 0; color: #38a169; font-weight: 700; }
.pz-installment__chips.pz-installment__chips li::before { content: '\2713'; color: #7ef0c1; font-weight: 700; }

/* --- Блок 7: сворачивание длинных SEO-текстов --- */
.pz-seo-more { position: relative; }
.pz-seo-more.is-collapsed {
    max-height: 480px;
    overflow: hidden;
}
.pz-seo-more.is-collapsed::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 110px;
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, #fff 78%);
    pointer-events: none;
}
.pz-seo-more__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0 4px;
    padding: 11px 24px;
    background: #fff;
    border: 1.5px solid #6d60d7;
    border-radius: 100px;
    color: #6d60d7;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}
.pz-seo-more__btn:hover { background: #6d60d7; color: #fff; }
.pz-seo-more.is-open .pz-seo-more__btn { margin-top: 14px; }

/* Видео-фасады (.js-yt-ll/.js-rt-ll) внутри .pz-video растягиваются на весь блок */
.pz-video .js-yt-ll, .pz-video .js-rt-ll { width: 100% !important; height: 100% !important; max-width: 100%; }


/* --- Мобильный фикс 5: прейскурант 5 колонок (№/Код/Услуга/Примечание/Цена) → карточки ---
   Правило руководства: таблицы шире 390px и >4 колонок не скроллятся, а складываются
   в карточки. Селекторы с префиксом .price-table-wrap — чтобы перебить инлайн-стили
   страницы /prices/ (они объявлены позже custom.css). Десктоп не затронут. */
@media (max-width: 640px) {
    .price-table-wrap table.price-table,
    .price-table-wrap table.price-table tbody { display: block; width: 100%; min-width: 0; }
    .price-table-wrap table.price-table thead { display: none; }
    .price-table-wrap table.price-table tbody tr {
        display: block;
        background: #fff;
        border: 1px solid #eef2f7;
        border-radius: 14px;
        padding: 12px 14px;
        margin-bottom: 10px;
        box-shadow: 0 4px 14px rgba(18, 38, 63, .05);
    }
    .price-table-wrap table.price-table tbody td {
        display: block;
        width: auto;
        min-width: 0;
        padding: 2px 0;
        border-bottom: 0;
        font-size: 14px;
        white-space: normal;
        text-align: left;
    }
    .price-table-wrap table.price-table td.price-table__service { font-weight: 600; margin-bottom: 4px; }
    .price-table-wrap table.price-table td.price-table__price { color: #6d60d7; font-size: 16px; font-weight: 700; }
    .price-table-wrap table.price-table td.price-table__num,
    .price-table-wrap table.price-table td.price-table__code { display: inline-block; font-size: 12px; color: #7b8797; padding-right: 10px; }
    .price-table-wrap table.price-table td.price-table__note { color: #5f6b7a; font-size: 13px; }
}
