/* =====================================================================
   Сучасне охайне оформлення (задача #852, 16.10.2026)
   Підключається ОСТАННІМ у tpl/rm_rus/_index15.html і _index16.html.
   Відкат: прибрати <link ... modern.css> з цих двох шаблонів.
   ===================================================================== */

:root {
    --hm-red: #e30613;
    --hm-red-dark: #b8050f;
    --hm-text: #1f1f22;
    --hm-muted: #6b6b70;
    --hm-line: #e4e4e7;
    --hm-bg-soft: #f6f6f7;
    --hm-radius: 14px;
    --hm-shadow: 0 2px 10px rgba(16, 16, 20, .06);
    --hm-shadow-hover: 0 12px 28px rgba(16, 16, 20, .12);
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: var(--hm-text);
}

/* ---------- Верхня чорна смуга ---------- */
.header_top {
    background: #141416;
}
.header_user li a {
    font-weight: 500;
    letter-spacing: 1.6px;
    transition: color .2s ease;
}
.header_user li a:hover {
    color: #ff4d55;
}
.header_user li + li:before {
    border-left-width: 2px;
    border-color: var(--hm-red);
}
.header_search form {
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px;
    background: rgba(255, 255, 255, .06);
    transition: border-color .2s ease, background .2s ease;
}
.header_search form:focus-within {
    border-color: rgba(255, 255, 255, .55);
    background: rgba(255, 255, 255, .1);
}
.header_search #search-field {
    padding-left: 16px;
}
.header_search #search-field::placeholder {
    color: rgba(255, 255, 255, .6);
}

/* ---------- Головне меню ---------- */
.sf-menu > li > a {
    position: relative;
    font-weight: 700;
    letter-spacing: 1.6px;
    transition: color .2s ease;
}
.sf-menu > li > a:after {
    content: "";
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 8px;
    height: 2px;
    background: var(--hm-red);
    border-radius: 2px;
    transform: scaleX(0);
    transition: transform .25s ease;
}
.sf-menu > li.active > a,
.sf-menu > li:hover > a {
    color: var(--hm-red);
}
.sf-menu > li.active > a:after,
.sf-menu > li:hover > a:after {
    transform: scaleX(1);
}

/* ---------- Слайдер на головній ---------- */
.main-slider-wrapper .owl-item .item img {
    border-radius: var(--hm-radius);
}

/* ---------- Заголовки ---------- */
.maintitle {
    color: var(--hm-text);
    font-size: 26px;
    line-height: 1.3;
    font-weight: 800;
    text-transform: none;
    letter-spacing: -.2px;
    margin: 36px 0 10px;
}
.maintitle:after {
    content: "";
    display: block;
    width: 56px;
    height: 3px;
    margin: 14px auto 0;
    background: var(--hm-red);
    border-radius: 3px;
}

h4.himek {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 48px 0 6px;
    padding: 0 0 14px;
    border-bottom: 1px solid var(--hm-line);
    font-size: 20px;
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: .2px;
    color: var(--hm-text);
}
h4.himek:before {
    float: none;
    flex: 0 0 auto;
    width: 5px;
    height: 24px;
    margin: 0;
    border-radius: 3px;
    background: var(--hm-red);
}

/* ---------- Плитки категорій на головній ---------- */
ul.mainlist {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 24px;
    margin: 24px 0 10px;
    padding: 0;
}
.mainlist li,
.mainlist li.posnull {
    margin: 0;
    background: #fff;
    border: 1px solid var(--hm-line);
    border-radius: var(--hm-radius);
    box-shadow: var(--hm-shadow);
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.mainlist li:hover {
    transform: translateY(-4px);
    border-color: var(--hm-red);
    border-radius: var(--hm-radius);
    box-shadow: var(--hm-shadow-hover);
}
.mainlist li a,
.mainlist li.posnull a {
    display: flex;
    flex-direction: column;
    width: 100% !important;
    height: 100% !important;
    padding-top: 66.66%;
    border: 0;
    box-shadow: none !important;
    background-size: 100% auto !important;
    background-position: center top !important;
    background-repeat: no-repeat !important;
    background-color: #fff !important;
    text-decoration: none;
}
.mainlist li span,
.mainlist li.posnull span {
    position: static;
    flex: 1 0 auto;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 64px;
    padding: 12px 16px 14px;
    background: #fff;
    border-top: 1px solid var(--hm-line);
    -webkit-text-fill-color: currentColor;
    color: var(--hm-text) !important;
    font-size: 13px;
    line-height: 1.35;
    font-weight: 700;
    letter-spacing: .4px;
    text-align: left;
    text-transform: uppercase;
    transition: color .2s ease;
}
.mainlist li:hover span {
    color: var(--hm-red) !important;
}

/* ---------- Блок «Ми гарантуємо…» ---------- */
.custom_showcase__11 .text1 h2 {
    max-width: 900px;
    margin: 50px auto 10px;
    padding: 26px 30px;
    background: var(--hm-bg-soft);
    border-left: 4px solid var(--hm-red);
    border-radius: var(--hm-radius);
    color: var(--hm-text);
    font-size: 20px;
    line-height: 1.45;
    font-weight: 600;
    text-transform: none;
}

/* ---------- Постачальники ---------- */
.partners-carousel-section h2,
.custom_showcase__11 .text1 .partners-carousel-section h2 {
    max-width: none;
    margin: 0 0 24px;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 0;
    font-size: 24px;
    font-weight: 800;
    color: var(--hm-text);
    text-transform: none;
}
.partners-carousel-section .partner-item {
    border-color: var(--hm-line);
    border-radius: var(--hm-radius);
}
.partners-carousel-section .partner-item:hover {
    border-color: var(--hm-red);
    box-shadow: var(--hm-shadow-hover);
}
.partners-carousel-section .partner-item .title {
    letter-spacing: .3px;
}
.partners-carousel-section .swiper-pagination-bullet-active {
    background: var(--hm-red);
}

/* ---------- Бічне меню каталогу ---------- */
.column .widget h3.widget_header {
    padding: 11px 16px;
    background: #1f1f22;
    border-left: 0;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700 !important;
    letter-spacing: 1px;
    text-align: left;
    box-shadow: inset 4px 0 0 var(--hm-red);
}
.column .widget ul.nobd > li {
    border-left-width: 3px;
    border-radius: 2px;
}
.column .widget ul.list li a {
    transition: color .2s ease;
}
.column .widget ul.list li a:hover {
    color: var(--hm-red);
}

/* ---------- Хлібні крихти ---------- */
.breadcrumb {
    padding: 0;
    font-size: 13px;
    color: var(--hm-muted);
}
.breadcrumb a {
    color: var(--hm-muted);
}
.breadcrumb a:hover {
    color: var(--hm-red);
}
.breadcrumb span {
    color: var(--hm-text);
    font-weight: 600;
}

/* ---------- Кнопки ---------- */
.button_consult {
    border-radius: 10px;
    border-color: #cfcfd4;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.button_consult:hover {
    border-color: var(--hm-red);
}
.red-btn {
    border-radius: 10px;
}

/* ---------- Футер ---------- */
footer {
    padding-top: 48px;
}
footer .footer_block h2,
footer .footer_block h3 {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: none;
    color: #fff;
    text-align: left;
}
footer .footer_block h2 {
    padding: 0 0 14px;
    margin-top: 10px;
}
footer .footer_block h3 {
    margin: 18px 0 6px;
}
footer .footer_block ul li {
    padding-bottom: 6px;
}
footer .footer_block ul li:before {
    color: #fff;
    opacity: .6;
}
footer .footer_block ul li a {
    color: rgba(255, 255, 255, .88);
    font-size: 13px;
    letter-spacing: .6px;
    transition: color .2s ease;
}
footer .footer_block ul li.active a,
footer .footer_block ul li a:hover {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 3px;
}
footer .footer_block__5 {
    text-align: left;
    line-height: 1.7;
}
footer .footer_block__5 a {
    color: #fff;
}
footer .footer_block__5 a:hover {
    text-decoration: underline;
}
footer .copyright {
    margin-top: 30px;
    padding: 24px 0 28px;
    border-top: 1px solid rgba(255, 255, 255, .25);
    color: rgba(255, 255, 255, .85);
    font-size: 13px;
    letter-spacing: .4px;
    text-transform: none;
}
footer .copyright .contentinfo {
    font-size: 13px;
    line-height: 1.8;
}
@media (min-width: 768px) {
    footer > .container > .row {
        display: flex;
        flex-wrap: nowrap;
    }
    footer > .container > .row > .footer_block {
        float: none;
        flex: 1 1 0;
        width: auto;
        min-width: 0;
    }
    footer > .container > .row > .footer_block__5 {
        flex: 1.6 1 0;
    }
}

/* ---------- Мобільні ---------- */
@media (max-width: 767px) {
    .maintitle {
        font-size: 20px;
        margin-top: 24px;
    }
    h4.himek {
        font-size: 17px;
        margin-top: 34px;
    }
    ul.mainlist {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        margin-top: 16px;
    }
    .mainlist li span,
    .mainlist li.posnull span {
        min-height: 52px;
        padding: 10px 10px 12px;
        font-size: 11px !important;
        line-height: 1.3;
        letter-spacing: .2px;
        text-align: left;
    }
    .custom_showcase__11 .text1 h2 {
        margin: 30px 0 0;
        padding: 18px 18px;
        font-size: 16px;
    }
}

/* =====================================================================
   Єдина типографіка (задача #854, 16.10.2026)
   Один шрифт — Manrope. Шкала розмірів:
     H1 28 · H2 22 · H3 18 · H4 16 · текст 15 · дрібний 13 · підпис 12
   Вага: текст 400 · пункти меню 500–600 · назви карток 600 · кнопки 700 · заголовки 700/800.
   Великі літери — тільки навігація, кнопки, заголовки таблиць.
   ===================================================================== */
:root {
    --hm-font: Manrope, "Segoe UI", Arial, sans-serif;
    --fs-h1: 28px;
    --fs-h2: 22px;
    --fs-h3: 18px;
    --fs-h4: 16px;
    --fs-body: 15px;
    --fs-sm: 13px;
    --fs-xs: 12px;
}
body,
input,
textarea,
select,
button,
.btn,
.descriptor,
.category-title {
    font-family: var(--hm-font);
}
.descriptor {
    font-family: var(--hm-font) !important;
}

/* ---------- Текст сторінок і описів товарів ---------- */
/* Шрифти й розміри, вставлені в описи з Word/інших сайтів, приводимо до загальних */
#main_content [style*="font-family"],
#main_content font {
    font-family: var(--hm-font) !important;
}
#main_content :is(p, span, font, strong, b, em, i, u, a, li, td, th, div)[style*="font-size"],
#main_content font[size] {
    font-size: inherit !important;
    line-height: inherit !important;
}
#main_content .pdscrt,
#main_content p,
#main_content ul:not([class]) > li,
#main_content ol:not([class]) > li,
#main_content ul.whywe > li {
    font-size: var(--fs-body);
    line-height: 1.65;
    font-weight: 400;
}
#main_content strong,
#main_content b {
    font-weight: 700;
}

/* Заголовки */
#main_content h1,
#main_content .product_name h1 {
    font-size: var(--fs-h1) !important;
    line-height: 1.25 !important;
    font-weight: 800 !important;
    letter-spacing: -.2px;
    text-transform: none;
    color: var(--hm-text) !important;
}
#main_content h2,
#main_content .pdscrt h1 {
    margin: 32px 0 14px;
    font-size: var(--fs-h2) !important;
    line-height: 1.3 !important;
    font-weight: 700 !important;
    letter-spacing: -.1px;
    text-transform: none;
    color: var(--hm-text);
}
#main_content h3 {
    margin: 24px 0 10px;
    font-size: var(--fs-h3) !important;
    line-height: 1.35 !important;
    font-weight: 700 !important;
    text-transform: none;
    color: var(--hm-text);
}
#main_content h4,
#main_content h5,
#main_content h6 {
    font-size: var(--fs-h4) !important;
    line-height: 1.4 !important;
    font-weight: 700 !important;
    color: var(--hm-text);
}
#main_content .pdscrt h1,
#main_content .pdscrt h2,
#main_content .pdscrt h3 {
    text-align: left;
}
#main_content :is(h1, h2, h3, h4) :is(strong, b, span, font) {
    font-size: inherit !important;
    font-weight: inherit !important;
}

/* Таблиці характеристик */
#main_content .pdscrt table th,
#main_content .pdscrt table thead td,
#main_content .prod-cons th,
#main_content .prod-cons thead td {
    font-size: var(--fs-sm) !important;
    line-height: 1.4;
    font-weight: 700 !important;
    letter-spacing: .04em;
    text-transform: uppercase;
}
#main_content .pdscrt table td,
#main_content .prod-cons td,
#main_content .pdscrt table td p {
    font-size: var(--fs-body);
    line-height: 1.5;
    font-weight: 400;
}

/* ---------- Картка товару ---------- */
#main_content .product_code {
    font-size: var(--fs-xs);
    font-weight: 500;
    color: var(--hm-muted);
}
#main_content .product_code b { font-weight: 500; }
/* #3323: порожній артикул - не показувати «Код товару:» */
#main_content .product_code:has(b:empty) { display: none; }
.prod-tabs .prod-tab {
    font-size: 14px;
    font-weight: 700;
}

/* ---------- Назви в картках (товари, «Інші моделі», категорії, статті) ---------- */
.product_name a,
.product .product_name a,
.other-products-grid .product_name a {
    font-size: var(--fs-body);
    line-height: 1.35;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: var(--hm-text);
}
.product_name a:hover {
    color: var(--hm-red);
}
.article_header .product_name a {
    font-size: var(--fs-h3);
    font-weight: 700;
}
.proditem .title1 span,
.category-title {
    font-size: var(--fs-body) !important;
    line-height: 1.35;
    font-weight: 600 !important;
    text-transform: none;
}
.proditem .title2 span {
    font-size: var(--fs-xs);
    font-weight: 500;
    color: var(--hm-muted);
}
.mainlist li span,
.mainlist li.posnull span {
    font-size: var(--fs-body);
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}
.blog-article_date,
.blog-article_date span {
    font-size: var(--fs-sm);
    color: var(--hm-muted);
}

/* ---------- Кнопки — один стиль напису ---------- */
.button_consult2,
.button_consult,
.red-btn,
a.blog-article_read-more,
#main_content .other-products-grid .buybar .button_consult2 {
    font-family: var(--hm-font);
    font-size: var(--fs-sm) !important;
    font-weight: 700 !important;
    letter-spacing: .5px;
    text-transform: uppercase;
}

/* ---------- Навігація ---------- */
.column .widget .item a {
    font-size: var(--fs-sm);
    line-height: 1.4;
    font-weight: 600;
}
.column .widget h3.widget_header {
    font-size: 14px;
}
/* Бічне меню каталогу (задача #854): розділи — великими літерами, підрозділи — звичайними,
   кожен пункт — блок із відступом, активний пункт і відкритий розділ підсвічені */
.column .widget ul.nobd > li,
.column .widget ul.list > li {
    margin: 0 0 4px;
    padding: 0;
}
.column .widget ul.nobd > li > a:not(.plusone),
.column .widget ul.list > li > a:not(.plusone) {
    display: block;
    padding: 8px 10px 8px 12px;
    border-radius: 0 8px 8px 0;
    font-size: var(--fs-sm) !important;
    line-height: 1.4;
    font-weight: 700;
    letter-spacing: .3px;
    text-transform: uppercase;
    transition: background-color .2s ease, color .2s ease;
}
.column .widget ul.list > li > a:not(.plusone) {
    color: var(--hm-text);
}
.column .widget ul.nobd > li > a:not(.plusone):hover,
.column .widget ul.list > li > a:not(.plusone):hover {
    background: var(--hm-bg-soft);
    color: var(--hm-red);
}
.column .widget ul.list > li.current > a:not(.plusone),
.column .widget ul.list > li:has(li.current) > a:not(.plusone) {
    background: #fdeeef;
    color: var(--hm-red);
}
.column .widget ul.submenu {
    margin: 4px 0 10px 12px;
    padding: 0;
    border-left: 1px solid var(--hm-line);
}
.column .widget ul.submenu ul.submenu {
    margin: 2px 0 6px 14px;
}
.column .widget ul.submenu li {
    margin: 0;
    padding: 0;
}
.column .widget ul.submenu li a:not(.plusone) {
    display: block;
    margin-left: -1px;
    padding: 6px 10px 6px 14px;
    border-left: 2px solid transparent;
    border-radius: 0 6px 6px 0;
    background: none;
    color: #3a3a3e;
    font-size: 14px !important;
    line-height: 1.4;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.column .widget ul.submenu li a:not(.plusone):hover {
    background: var(--hm-bg-soft);
    color: var(--hm-red);
    border-left-color: #f0a3a8;
}
.column .widget ul.submenu:has(li.current) {
    display: block !important;
}
.column .widget ul.submenu li:has(li.current) > a:not(.plusone) {
    color: var(--hm-red);
    font-weight: 600;
}
.column .widget ul.submenu li.current > a {
    background: #fdeeef;
    color: var(--hm-red);
    font-weight: 700;
    border-left-color: var(--hm-red);
}
.breadcrumb,
.breadcrumb a,
.breadcrumb span {
    font-size: var(--fs-sm);
}
footer .footer_block h2,
footer .footer_block h3 {
    font-size: var(--fs-h4);
}

/* ---------- Заголовки розділів на головній ---------- */
.maintitle {
    font-size: var(--fs-h1);
}
h4.himek,
.partners-carousel-section h2,
.custom_showcase__11 .text1 .partners-carousel-section h2 {
    font-size: var(--fs-h2);
    font-weight: 700;
}
.custom_showcase__11 .text1 h2 {
    font-size: var(--fs-h3);
}

@media (max-width: 767px) {
    :root {
        --fs-h1: 23px;
        --fs-h2: 19px;
        --fs-h3: 17px;
        --fs-body: 15px;
    }
    .maintitle {
        font-size: var(--fs-h1);
    }
    h4.himek {
        font-size: var(--fs-h2);
    }
    .mainlist li span,
    .mainlist li.posnull span {
        font-size: var(--fs-sm) !important;
    }
    #main_content .pdscrt table td,
    #main_content .prod-cons td {
        font-size: 14px;
    }
}

/* =====================================================================
   Стабільне завантаження без «смикання» (задача #854, CLS)
   ===================================================================== */
/* Логотип: місце під картинку резервується ще до її завантаження (logo.png 890x294) */
#logo a > img {
    aspect-ratio: 890 / 294;
    height: auto;
}
/* Підменю каталогу закриті одразу (раніше відкривались усі, а потім їх ховав скрипт);
   гілка з поточним пунктом відкрита правилом ul.submenu:has(li.current) вище */
.column .widget ul.submenu {
    display: none;
}
/* Слайдер на головній: до запуску owl-carousel показуємо перший слайд потрібної висоти,
   а не порожнечу (раніше блок з'являвся через 2–3 с і зсував усю сторінку) */
.main-slider-wrapper {
    min-height: 245px;
}
.main-slider-wrapper .owl-carousel:not(.owl-loaded) {
    display: block;
    height: 245px;
    overflow: hidden;
}
.main-slider-wrapper .owl-carousel:not(.owl-loaded) > .item {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 245px;
}
.main-slider-wrapper .owl-carousel:not(.owl-loaded) > .item + .item {
    display: none;
}
.main-slider-wrapper .owl-carousel:not(.owl-loaded) img {
    width: auto;
    height: 245px;
    max-height: 70vw;
    object-fit: cover;
}
/* Картка товару: блок фото фіксованої висоти — текст під ним не стрибає, поки вантажаться фото і слайдер */
.product_image-top .product_img_big {
    height: 360px;
    overflow: hidden;
}
.product_image-top .product_img_big__list img {
    width: auto;
    max-height: 360px;
}
.product_image-top .product_img_big > .product_img_big__list > li + li {
    display: none;
}
/* Вкладки «Опис / Витратні матеріали / Відео» показуємо одразу (ті самі умови, що в скрипті catalog_product.html) */
body:has(.breadcrumb a:is([href="/Obladnanya_clinic_lab/"], [href="/Obladnanya_s_blood/"])) #prodTabs,
.product_details:has(#prodTabCons .prod-cons, #prodTabVideo .prod-videos) #prodTabs {
    display: flex !important;
}
body:has(.breadcrumb a:is([href="/Obladnanya_clinic_lab/"], [href="/Obladnanya_s_blood/"])) .product_details > .pdscrt,
.product_details:has(#prodTabCons .prod-cons, #prodTabVideo .prod-videos) > .pdscrt {
    margin: 0 0 15px;
    padding: 18px 15px 5px;
    border: 1px solid #e5e5e5;
    border-top: 0;
    border-radius: 0 0 8px 8px;
}
body:has(.breadcrumb a:is([href="/Obladnanya_clinic_lab/"], [href="/Obladnanya_s_blood/"])) .product_details > .pdscrt :is(.video-section, .consumables-section),
.product_details:has(#prodTabCons .prod-cons, #prodTabVideo .prod-videos) > .pdscrt :is(.video-section, .consumables-section) {
    display: none;
}
/* Служба крові: вкладка «Витратні матеріали» лише якщо заповнено (як у скрипті catalog_product.html) */
body:has(.breadcrumb a[href="/Obladnanya_s_blood/"]) .product_details:not(:has(#prodTabCons .prod-cons, .pdscrt .consumables-section)) #prodTabs .prod-tab[data-tab="cons"] {
    display: none;
}
@media (max-width: 767px) {
    .main-slider-wrapper {
        min-height: 304px;
    }
    .main-slider-wrapper .owl-carousel:not(.owl-loaded),
    .main-slider-wrapper .owl-carousel:not(.owl-loaded) > .item {
        height: 270px;
    }
    .main-slider-wrapper .owl-carousel:not(.owl-loaded) img {
        height: 270px;
        max-height: 95vw;
    }
    .product_image-top .product_img_big {
        height: 300px;
    }
    .product_image-top .product_img_big__list img {
        max-height: 300px;
    }
}
@media (max-width: 480px) {
    body:has(.breadcrumb a:is([href="/Obladnanya_clinic_lab/"], [href="/Obladnanya_s_blood/"])) .product_details > .pdscrt,
    .product_details:has(#prodTabCons .prod-cons, #prodTabVideo .prod-videos) > .pdscrt {
        padding: 15px 8px 5px;
    }
}

/* #3323: таблиці в описі товару на телефоні - текст переноситься, а не обрізається (широкі таблиці й далі гортаються) */
@media (max-width: 768px) {
    #main_content .pdscrt table th,
    #main_content .pdscrt table td,
    #main_content .pdscrt table td p {
        white-space: normal !important;
        overflow-wrap: break-word;
    }
}
