/* Сантехразбор: системные шрифты, без внешних библиотек. Mobile-first.
   Цвета — только через переменные; тёмная тема переопределяет их ниже.
   Контраст: белый текст на --cta (#c2410c) 5.2:1, на --cta-hover выше; --primary на --bg >= 5:1. */
:root {
    --bg: #ffffff;
    --text: #1b2530;
    --muted: #55616d;
    --border: #d9e1e8;
    --surface: #f2f7f9;
    --card: #ffffff;
    --shadow: 0 1px 2px rgba(16, 36, 52, 0.06), 0 4px 14px rgba(16, 36, 52, 0.05);
    --primary: #0e7490;
    --primary-dark: #0a5a70;
    --link: #0b6a85;
    --cta: #c2410c;
    --cta-hover: #9a3412;
    --cta-text: #ffffff;
    --star: #b45309;
    --pro: #166534;
    --pro-bg: #ecfdf3;
    --pro-border: #b7e4c7;
    --con: #b91c1c;
    --con-bg: #fef2f2;
    --con-border: #f3c4c4;
    --quote-bg: #e8f5f8;
    --quote-border: #0e7490;
    --zebra: #f6f9fb;
    --th-bg: #0e7490;
    --th-text: #ffffff;
    --chip-bg: #eef3f6;
    --badge-best: #0a5a70;
    --badge-budget: #166534;
    --badge-premium: #6d28d9;
    --badge-other: #475569;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f1720;
        --text: #e6ebf0;
        --muted: #9fadba;
        --border: #2a3846;
        --surface: #141f2a;
        --card: #182431;
        --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
        --primary: #4cc3df;
        --primary-dark: #7dd3e8;
        --link: #5ccbe6;
        --cta: #c2410c;
        --cta-hover: #9a3412;
        --cta-text: #ffffff;
        --star: #fbbf24;
        --pro: #6ee7a0;
        --pro-bg: #10281b;
        --pro-border: #1f5136;
        --con: #fca5a5;
        --con-bg: #2b1717;
        --con-border: #5a2a2a;
        --quote-bg: #12303a;
        --quote-border: #4cc3df;
        --zebra: #131e29;
        --th-bg: #0a5a70;
        --th-text: #ffffff;
        --chip-bg: #1f2d3b;
        --badge-best: #0a6a85;
        --badge-budget: #166534;
        --badge-premium: #6d28d9;
        --badge-other: #475569;
    }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 17px;
    line-height: 1.65;
    overflow-wrap: break-word;
}
@media (min-width: 640px) { body { font-size: 18px; } }
a { color: var(--link); }
img { max-width: 100%; height: auto; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.star { color: var(--star); }
.visually-hidden {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- каркас ---------- */
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 20px; padding-bottom: 48px; }
.narrow,
.prose > *:not(.wide),
article > h1,
.hero > * { max-width: 720px; }
.narrow,
.prose > *:not(.wide),
article > h1 { margin-left: auto; margin-right: auto; }
.wide { max-width: 960px; margin-left: auto; margin-right: auto; }

/* ---------- шапка ---------- */
.site-header { border-bottom: 1px solid var(--border); background: var(--surface); }
.header-inner { display: flex; flex-direction: column; gap: 2px; padding-top: 10px; padding-bottom: 2px; }
.site-name { font-weight: 800; font-size: 1.3rem; color: var(--primary); text-decoration: none; letter-spacing: -0.01em; }
.main-nav {
    display: flex; gap: 4px; overflow-x: auto; white-space: nowrap;
    -webkit-overflow-scrolling: touch; scrollbar-width: none; margin: 0 -16px; padding: 0 12px;
}
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a {
    flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px;
    color: var(--text); text-decoration: none; font-size: 0.95rem; font-weight: 500;
    border-bottom: 3px solid transparent;
}
.main-nav a:hover { color: var(--primary); }
.main-nav a[aria-current="page"] { color: var(--primary); border-bottom-color: var(--primary); }
@media (min-width: 760px) {
    .header-inner { flex-direction: row; align-items: center; justify-content: space-between; padding-top: 0; padding-bottom: 0; }
    .site-name { padding: 12px 0; }
    .main-nav { margin: 0; padding: 0; overflow: visible; }
}

/* ---------- подвал ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 0.875rem; }
.site-footer .wrap { padding-top: 20px; padding-bottom: 28px; }
.site-footer nav a { margin-right: 16px; }
.site-footer p { margin: 8px 0 0; }

/* ---------- типографика ---------- */
h1 { font-size: 1.65rem; line-height: 1.25; margin: 0.4em 0 0.5em; letter-spacing: -0.01em; }
h2 { font-size: 1.4rem; line-height: 1.3; margin: 2em 0 0.6em; }
h3 { font-size: 1.15rem; line-height: 1.35; margin: 1.6em 0 0.5em; }
@media (min-width: 640px) { h1 { font-size: 2.05rem; } }

.prose p, .prose li { margin-top: 0; margin-bottom: 1em; }
.prose ul, .prose ol { padding-left: 1.4em; margin-top: 0; margin-bottom: 1em; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2em auto; }
.prose h2[id], .prose h3[id], .product { scroll-margin-top: 12px; }

.breadcrumbs { font-size: 0.85rem; color: var(--muted); }
.breadcrumbs a { color: var(--muted); }
.dates { color: var(--muted); font-size: 0.9rem; margin: 0 0 0.6em; }
.disclosure {
    margin: 0 auto 1.4em; font-size: 0.82rem; color: var(--muted);
    padding-left: 10px; border-left: 3px solid var(--border);
}

blockquote {
    margin: 1.5em auto;
    padding: 14px 18px;
    background: var(--quote-bg);
    border-left: 4px solid var(--quote-border);
    border-radius: 8px;
}
blockquote p { margin: 0; }
blockquote p + p { margin-top: 0.7em; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1.5em auto; border: 1px solid var(--border); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; line-height: 1.45; }
th, td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.table-wrap th { background: var(--th-bg); color: var(--th-text); white-space: nowrap; }
.table-wrap tbody tr:nth-child(even) { background: var(--zebra); }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }

/* мини-таблица статьи 02 (Модель / Корпус / Цена): на узких экранах без горизонтальной прокрутки */
@media (max-width: 639px) {
    .minitable th, .minitable td { padding: 8px 8px; }
    .minitable td { overflow-wrap: anywhere; }
    .minitable td.nowrap { overflow-wrap: normal; }
}

/* ---------- кнопки ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; text-align: center;
    min-height: 48px; padding: 10px 22px;
    background: var(--cta); color: var(--cta-text);
    font-weight: 700; font-size: 1rem; text-decoration: none;
    border-radius: 10px; line-height: 1.25;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}
.btn:hover, .btn:focus-visible { background: var(--cta-hover); color: var(--cta-text); }
.btn:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.btn-sm { min-height: 44px; padding: 8px 14px; font-size: 0.95rem; white-space: nowrap; }
.btn-block { display: flex; width: 100%; min-height: 54px; font-size: 1.08rem; }
.ad-mark { font-size: 0.7rem; color: var(--muted); margin-left: 6px; }
.btn-block + .ad-mark, .pick-cta .ad-mark, .product-cta .ad-mark { display: block; margin: 4px 0 0; text-align: center; }

/* ---------- бейджи, рейтинг ---------- */
.badge {
    display: inline-block; padding: 2px 10px; border-radius: 999px;
    font-size: 0.75rem; font-weight: 700; line-height: 1.6; color: #ffffff;
    background: var(--badge-other); letter-spacing: 0.01em;
}
.badge-best { background: var(--badge-best); }
.badge-budget { background: var(--badge-budget); }
.badge-premium { background: var(--badge-premium); }
.rating { white-space: nowrap; }

.block-title {
    font-size: 1.25rem; font-weight: 800; margin: 0 0 0.6em; line-height: 1.3;
}

/* ---------- Наш выбор ---------- */
.picks { margin-top: 1.8em; margin-bottom: 1.8em; }
.picks-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.pick {
    display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
    padding: 16px; background: var(--card); border: 1px solid var(--border);
    border-top: 4px solid var(--primary); border-radius: 12px; box-shadow: var(--shadow);
}
.pick .badge { margin-bottom: 4px; }
.pick-name { margin: 0 !important; font-size: 1.1rem; line-height: 1.3; }
.pick-name a { color: var(--text); text-decoration: none; }
.pick-name a:hover { color: var(--link); text-decoration: underline; }
.pick-meta { margin: 0 !important; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.pick-price { font-size: 1.45rem; font-weight: 800; white-space: nowrap; }
.pick-rating, .pick-feature { margin: 0 !important; font-size: 0.92rem; }
.pick-feature { color: var(--muted); flex: 1; }
.pick-cta { width: 100%; margin-top: 10px; }
.pick-cta .btn { width: 100%; }
@media (max-width: 639px) {
    .picks-grid { gap: 8px; }
    .pick { padding: 10px 12px; gap: 2px; border-top-width: 3px; }
    .pick .badge { margin-bottom: 0; }
    .pick-name { font-size: 1rem; }
    .pick-feature { display: none; }
    .pick-meta { gap: 0 10px; }
    .pick-price { font-size: 1.25rem; }
    .pick-rating { font-size: 0.85rem; }
    .pick-cta { margin-top: 6px; }
    .pick-cta .btn { min-height: 44px; display: flex; align-items: center; justify-content: center; }
}

.photo { margin: 1.4em 0; }
.photo img { display: block; width: 100%; height: auto; border-radius: 8px; }
.photo figcaption { margin-top: 6px; font-size: 0.82rem; line-height: 1.4; color: var(--muted); }

/* ---------- оглавление ---------- */
.toc {
    margin: 1.5em auto; padding: 14px 18px; background: var(--surface);
    border: 1px solid var(--border); border-radius: 10px;
}
.toc .block-title { font-size: 1.05rem; margin-bottom: 0.4em; }
.toc ol { margin: 0; padding-left: 1.3em; font-size: 0.95rem; }
.prose .toc li { margin-bottom: 0.25em; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* ---------- сравнение ---------- */
.compare { margin-top: 1.4em; margin-bottom: 0.8em; }
.compare-table { font-size: 0.9rem; }
.compare-table th[scope="col"] { background: var(--th-bg); color: var(--th-text); white-space: nowrap; }
.compare-table tbody th { background: transparent; font-weight: 700; }
.compare-table tbody th a { color: var(--text); text-decoration: none; }
.compare-table tbody th a:hover { color: var(--link); text-decoration: underline; }
.compare-table .c-price { font-weight: 800; }
.compare-table .c-cta { white-space: nowrap; }
.compare-table .badge { display: block; width: fit-content; margin-top: 3px; }

/* mobile: таблица превращается в стопку карточек */
@media (max-width: 639px) {
    .compare-table, .compare-table tbody { display: block; }
    .compare-table thead {
        position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
    }
    .compare-table tr {
        display: block; margin-bottom: 12px; padding: 12px 14px;
        background: var(--card); border: 1px solid var(--border); border-radius: 12px;
        box-shadow: var(--shadow);
    }
    .compare-table tbody tr:nth-child(even) { background: var(--card); }
    .compare-table th, .compare-table td { display: block; padding: 0; border: 0; }
    .compare-table tbody th.c-model { font-size: 1.05rem; margin-bottom: 6px; }
    .compare-table td {
        display: flex; justify-content: space-between; gap: 12px; text-align: right;
        padding: 5px 0; border-top: 1px dashed var(--border);
    }
    .compare-table td::before {
        content: attr(data-label); flex: none; text-align: left; color: var(--muted); font-size: 0.85rem;
    }
    .compare-table td.c-cta { display: block; border-top: 0; padding-top: 10px; }
    .compare-table td.c-cta .btn { width: 100%; min-height: 48px; }
    .compare-table td.c-cta .ad-mark { display: block; text-align: center; margin: 4px 0 0; }
    .compare-table .badge { display: inline-block; margin-left: 6px; }
}

/* ---------- карточка товара ---------- */
.product {
    margin-top: 1.6em; margin-bottom: 1.6em; padding: 18px 16px;
    background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow);
}
.product p { margin: 0 0 0.9em; }
.product-main { display: flex; flex-direction: column; gap: 14px; }
.product-img { border-radius: 10px; align-self: center; }
@media (min-width: 640px) {
    .product { padding: 22px 24px; }
    .product-main { flex-direction: row; align-items: flex-start; }
    .product-img { align-self: flex-start; }
}
.product-body { flex: 1; min-width: 0; }
.product-title { margin: 6px 0 0.15em; font-size: 1.3rem; line-height: 1.3; }
.product-sub { margin: 0 0 0.6em; color: var(--muted); font-size: 0.95rem; }
.product-price { margin: 0 0 0.3em; }
.price { font-size: 1.6rem; font-weight: 800; white-space: nowrap; margin-right: 6px; }
.product-price .muted { font-size: 0.82rem; }
.product-meta { margin: 0 0 0.7em; font-size: 0.95rem; }
.dot { color: var(--muted); margin: 0 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0 0 1em; padding: 0; }
.chips li {
    margin: 0; padding: 2px 10px; background: var(--chip-bg); border-radius: 999px;
    font-size: 0.82rem; line-height: 1.6;
}
.proscons { display: grid; gap: 12px; margin: 0 0 1em; }
@media (min-width: 640px) { .proscons { grid-template-columns: 1fr 1fr; } }
.pros, .cons { padding: 12px 14px; border-radius: 10px; border: 1px solid; font-size: 0.95rem; line-height: 1.5; }
.pros { background: var(--pro-bg); border-color: var(--pro-border); }
.cons { background: var(--con-bg); border-color: var(--con-border); }
.pc-title { margin: 0 0 0.4em !important; font-weight: 800; }
.pros .pc-title { color: var(--pro); }
.cons .pc-title { color: var(--con); }
.pc-note { margin: 0 0 0.5em !important; }
.pros ul, .cons ul { list-style: none; margin: 0; padding: 0; }
.prose .pros li, .prose .cons li { position: relative; padding-left: 1.5em; margin: 0 0 0.4em; }
.pros li::before, .cons li::before { position: absolute; left: 0; top: 0; font-weight: 800; }
.pros li::before { content: "✓"; color: var(--pro); }
.cons li::before { content: "✗"; color: var(--con); }
.product-cta { margin-top: 1.1em; }

/* ---------- блоки внизу статьи ---------- */
.how-we-pick {
    margin-top: 2.5em; margin-bottom: 0; padding: 16px 20px; background: var(--surface);
    border: 1px solid var(--border); border-radius: 12px; margin-left: auto; margin-right: auto;
}
.how-we-pick h2 { margin: 0 0 0.5em; font-size: 1.2rem; }
.how-we-pick ol { margin: 0 0 0.6em; padding-left: 1.3em; }
.how-we-pick li { margin-bottom: 0.4em; font-size: 0.95rem; }
.how-we-pick p { margin: 0; font-size: 0.95rem; }
.related { margin-top: 2.5em; }
.related h2 { margin-top: 0; font-size: 1.3rem; }

/* ---------- главная и карточки статей ---------- */
.hero { padding: 12px 0 8px; }
.hero h1 { font-size: 1.75rem; line-height: 1.25; margin-top: 0; }
@media (min-width: 640px) { .hero h1 { font-size: 2.3rem; } }
.tagline { font-size: 1.1rem; color: var(--muted); margin-top: 0; }
.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.card {
    display: block; padding: 16px 18px;
    border: 1px solid var(--border); border-radius: 12px;
    background: var(--card); box-shadow: var(--shadow);
    color: var(--text); text-decoration: none;
}
.card:hover { border-color: var(--primary); }
.card h3 { margin: 0 0 0.4em; color: var(--link); font-size: 1.08rem; }
.card p { margin: 0 0 0.6em; font-size: 0.92rem; line-height: 1.5; }
.card .meta { font-size: 0.8rem; color: var(--muted); }
.how-we-work { margin-top: 2em; }
.steps { padding-left: 1.3em; display: grid; gap: 10px; max-width: 720px; }
.steps li { padding-left: 4px; }
.compare-table .v { display: block; }
@media (max-width: 639px) { .compare-table .v { text-align: right; } }
.compare-table .badge { border-radius: 8px; }

.hub-links { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.6rem 1.5rem; font-size: 1.05rem; }
.hub-links .muted { color: var(--muted); font-size: 0.9rem; }

/* ---------- товар без наличия (status: unavailable в front matter) ---------- */
.unavailable-note {
    display: flex; align-items: center; justify-content: center; box-sizing: border-box;
    min-height: 44px; padding: 8px 14px; border-radius: 10px; font-weight: 600; font-size: 0.95rem;
    color: var(--muted); background: var(--border); text-align: center; white-space: nowrap;
}
.product-cta .unavailable-note { min-height: 54px; font-size: 1.08rem; }
.product.is-unavailable .product-main, .compare-table tr.is-unavailable td, .compare-table tr.is-unavailable th { opacity: 0.65; }
.compare-table tr.is-unavailable .c-cta { opacity: 1; }
