/* =====================================================================
   theme-pages.css — нове оформлення внутрішніх сторінок
   (каталог, товари, послуги, калькулятор, контакти).
   Підключається ПІСЛЯ catalog.css / services.css / calculator.css /
   contacts.css і theme.css, тому перекриває старі стилі.
   ===================================================================== */

/* ---------- Загальне ---------- */
.catalog-section {
    max-width: var(--container);
    padding: 44px 24px 80px;
}

a.subcat-card,
.product-card a,
.catalog-section a { color: inherit; }

/* Хлібна корка */
.breadcrumbs {
    font-size: 13px;
    font-weight: 500;
    color: var(--graphite);
    margin-bottom: 30px;
    line-height: 1.7;
}
.breadcrumbs a {
    color: var(--graphite);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color .2s, border-color .2s;
}
.breadcrumbs a:hover { color: var(--ink); border-color: var(--ink); }
.breadcrumbs strong { color: var(--ink); font-weight: 700; }

/* Заголовок сторінки */
.page-title,
.catalog-header h1,
.catalog-header h2 {
    font-size: clamp(26px, 3.4vw, 40px) !important;
    font-weight: 800;
    line-height: 1.1;
    text-transform: uppercase;
    color: var(--ink) !important;
    letter-spacing: -.005em;
    padding-bottom: 16px;
    margin-bottom: 26px !important;
    border-bottom: var(--line);
}
.page-lead,
.catalog-header p {
    color: var(--graphite);
    font-size: 16px;
    line-height: 1.6;
    max-width: 760px;
    margin: -8px 0 30px;
}
.catalog-header { text-align: left; margin-bottom: 36px; }

/* ---------- Сітка карток (catalog.html, розділи послуг) ---------- */
.products-grid {
    gap: 0;
    border-top: 1px solid var(--ash);
    border-left: 1px solid var(--ash);
}
.product-card {
    border-radius: 0;
    box-shadow: none;
    border-right: 1px solid var(--ash);
    border-bottom: 1px solid var(--ash);
    padding: 26px;
    text-align: left;
    transition: background .3s var(--ease);
}
.product-card:hover { transform: none; box-shadow: none; background: var(--fog); }
.product-image img {
    border-radius: 0;
    transition: transform .6s var(--ease);
}
.product-card:hover .product-image img { transform: scale(1.04); }
.product-image { overflow: hidden; }
.product-card h2 {
    color: var(--ink);
    font-size: 17px;
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1.25;
}
.product-desc { color: var(--graphite); }
.service-card-icon { color: var(--ink); }

.btn-secondary,
.catalog-section .btn-secondary {
    background: transparent;
    color: var(--ink);
    border: var(--line);
    border-radius: 0;
    padding: 13px 20px;
    font: 600 13px var(--font);
    letter-spacing: .06em;
    text-transform: uppercase;
    transition: background .25s, color .25s;
}
.btn-secondary:hover { background: var(--ink); color: var(--paper); }

/* ---------- Каталог: колонка фільтрів ---------- */
.catalog-layout { gap: 36px; }
.catalog-sidebar {
    flex: 0 0 270px;
    background: var(--fog);
    border: var(--line);
    border-radius: 0;
    padding: 24px 20px;
    position: sticky;
    top: 20px;
}
/* Ліва колонка: панель фільтрів + окремий блок «Корисні статті» під нею.
   Два звичайні блоки, без «липкості» і без внутрішньої прокрутки — рухаються разом зі сторінкою. */
.catalog-side {
    flex: 0 0 270px;
    display: flex; flex-direction: column; gap: 22px;
    align-self: flex-start;
}
.catalog-side > .catalog-sidebar { flex: none; width: 100%; position: static; box-sizing: border-box; }
.filter-header { color: var(--ink); }
.filter-header span {
    font-weight: 800 !important;
    font-size: 16px !important;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.filter-header svg { stroke: var(--ink); }
.filter-group select {
    background-color: var(--paper);
    border: 1px solid var(--ash);
    border-radius: 0;
    color: var(--ink);
    font-family: var(--font);
    font-size: 12px;
    letter-spacing: .04em;
    transition: border-color .2s;
}
.filter-group select:hover,
.filter-group select:focus { outline: none; border-color: var(--ink); }
.filter-group select:disabled { background-color: var(--fog); color: var(--steel); border-style: dashed; cursor: not-allowed; opacity: .75; }
.filter-group select:disabled:hover { border-color: var(--ash); }

/* ---------- Власні випадні списки фільтрів (products/custom-select.js) ---------- */
.cs { position: relative; }
.cs-native { display: none !important; }
.cs-btn {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    width: 100%; min-height: 42px;
    padding: 8px 12px 8px 15px;
    background: var(--paper);
    border: 1px solid var(--ash);
    border-radius: 0;
    color: var(--ink);
    font-family: var(--font);
    text-align: left;
    cursor: pointer;
    transition: border-color .2s, background .2s;
}
.cs-btn:hover { border-color: var(--ink); }
.cs-btn:focus-visible { outline: 3px solid var(--steel); outline-offset: 1px; border-color: var(--ink); }
.cs.is-open .cs-btn { border-color: var(--ink); }
.cs-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.cs-cap { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-val { font-size: 14px; font-weight: 800; white-space: normal; overflow-wrap: anywhere; }   /* довге значення (напр. «Поковки квадратного та прямокутного перерізу») переноситься на другий рядок, розмір шрифту стандартний */
.cs-val:empty { display: none; }
.cs.has-value .cs-cap { font-size: 10px; color: var(--graphite); margin-bottom: 2px; }
.cs-chev { flex: none; fill: var(--graphite); transition: transform .25s var(--ease), fill .2s; }
.cs-btn:hover .cs-chev, .cs.is-open .cs-chev { fill: var(--ink); }
.cs.is-open .cs-chev { transform: rotate(180deg); }
.cs.is-disabled .cs-btn { background: var(--fog); border-style: dashed; cursor: not-allowed; opacity: .75; }
.cs.is-disabled .cs-cap { color: var(--steel); }
.cs.is-disabled .cs-btn:hover { border-color: var(--ash); }
.cs.is-disabled .cs-chev { fill: var(--steel); }

.cs-list {
    position: fixed;
    z-index: 10000;
    margin: 0; padding: 6px 0;
    list-style: none;
    background: var(--paper);
    border: 2px solid var(--ink);
    box-shadow: 6px 6px 0 rgba(18,18,18,.15);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--ink) var(--fog);
    font-family: var(--font);
    opacity: 0;
    transform: translateY(-6px) scale(.98);
    transform-origin: top center;
    pointer-events: none;
    transition: opacity .16s var(--ease), transform .16s var(--ease);
}
.cs-list.up { transform: translateY(6px) scale(.98); transform-origin: bottom center; }
.cs-list.open { opacity: 1; transform: none; pointer-events: auto; }
.cs-opt {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 10px 15px;
    font-size: 14px; font-weight: 600;
    color: var(--ink);
    cursor: pointer;
    transition: background .12s, color .12s;
}
.cs-opt[data-value=""] { color: var(--graphite); font-weight: 500; border-bottom: 1px solid var(--ash); margin-bottom: 4px; }
.cs-opt.is-active { background: var(--ink); color: var(--paper); }
.cs-opt[aria-selected="true"] { font-weight: 800; }
.cs-opt[aria-selected="true"]::after { content: "✓"; font-size: 13px; }
.cs-list::-webkit-scrollbar { width: 8px; }
.cs-list::-webkit-scrollbar-track { background: var(--fog); }
.cs-list::-webkit-scrollbar-thumb { background: var(--ink); }
@media (prefers-reduced-motion: reduce) { .cs-list, .cs-chev { transition: none; } }

/* Плавне згортання непотрібних фільтрів після «Застосувати» (і повернення при скиданні) */
.filter-group {
    max-height: 150px;      /* запас під значення, що переносяться на 3–4 рядки (напр. «Поковки квадратного та прямокутного перерізу») */
    overflow: hidden;
    transition: max-height .4s var(--ease), opacity .3s var(--ease), margin-bottom .4s var(--ease),
                transform .4s var(--ease), visibility 0s;
}
.filter-group.is-hidden {
    max-height: 0;
    margin-bottom: 0;
    opacity: 0;
    transform: translateX(-14px);
    visibility: hidden;
    pointer-events: none;
    transition: max-height .4s var(--ease), opacity .25s var(--ease), margin-bottom .4s var(--ease),
                transform .4s var(--ease), visibility 0s linear .4s;
}
@media (prefers-reduced-motion: reduce) {
    .filter-group, .filter-group.is-hidden { transition: none; }
}

.filter-actions {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 12px;
}
/* «Скасувати»: підкреслення, що «домальовується» зліва направо; приглушена, коли нічого скасовувати */
.btn-cancel {
    align-self: center;
    padding: 3px 0 5px;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    color: var(--graphite);
    text-decoration: none;
    cursor: pointer;
    background-image: linear-gradient(var(--ink), var(--ink)), linear-gradient(var(--steel), var(--steel));
    background-repeat: no-repeat;
    background-position: 0 100%, 0 100%;
    background-size: 0 2px, 100% 1px;
    transition: color .2s ease, opacity .2s ease, transform .12s ease, background-size .25s cubic-bezier(.23, 1, .32, 1);
}
.btn-cancel:not(.is-idle):active { transform: scale(.96); }
.btn-cancel:focus-visible { outline: 3px solid var(--steel); outline-offset: 3px; }
.btn-cancel.is-idle { opacity: .45; cursor: default; background-size: 0 2px, 0 1px; }
@media (hover: hover) and (pointer: fine) {
    .btn-cancel:not(.is-idle):hover { color: var(--ink); background-size: 100% 2px, 100% 1px; }
}

/* «Виберіть фільтри» → «Застосувати»: плавна зміна стану, підпис виїжджає знизу, один «поштовх» при активації */
.btn-apply {
    width: 100%;
    padding: 11px 14px;
    border: 2px solid var(--steel);
    border-radius: 0;
    background-color: var(--steel);
    color: var(--paper);
    font-family: var(--font);
    font-size: 12px;
    letter-spacing: .06em;
    text-transform: uppercase;
    cursor: default;
    touch-action: manipulation;
    transition: background-color .25s ease, border-color .25s ease, color .25s ease, transform .12s ease;
}
.btn-apply.is-ready { background-color: var(--ink); border-color: var(--ink); cursor: pointer; }
.btn-apply .btn-label { display: inline-block; }
.btn-apply .btn-label.swap { animation: btn-label-in .18s cubic-bezier(.23, 1, .32, 1); }
.btn-apply.pop { animation: btn-pop .22s cubic-bezier(.23, 1, .32, 1); }
.btn-apply.is-ready .btn-label::after {
    content: "→";
    display: inline-block;
    margin-left: 10px;
    transition: transform .25s cubic-bezier(.23, 1, .32, 1);
}
.btn-apply.is-ready:active { transform: scale(.97); }
.btn-apply:focus-visible { outline: 3px solid var(--steel); outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) {
    .btn-apply.is-ready:hover, .btn-apply.is-ready.force-hover { background-color: var(--paper); color: var(--ink); }
    .btn-apply.is-ready:hover .btn-label::after, .btn-apply.is-ready.force-hover .btn-label::after { transform: translateX(4px); }
}
@keyframes btn-label-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes btn-pop { 0% { transform: scale(1); } 45% { transform: scale(1.03); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
    .btn-apply .btn-label.swap, .btn-apply.pop { animation: none; }
    .btn-apply, .btn-apply.is-ready:active, .btn-cancel:not(.is-idle):active { transform: none; }
    .btn-apply.is-ready .btn-label::after { transition: none; }
}
/* ---------- Плитки підкатегорій ---------- */
.subcategories-grid { gap: 0; border-top: 1px solid var(--ash); border-left: 1px solid var(--ash); margin-bottom: 44px; }
.subcat-card {
    border: none;
    border-right: 1px solid var(--ash);
    border-bottom: 1px solid var(--ash);
    border-radius: 0;
    padding: 20px 8px 18px;
    background: var(--paper);
    text-decoration: none;
    transition: background .25s var(--ease), color .25s var(--ease);
}
.subcat-card:hover, .subcat-card.active {
    border-color: var(--ash);
    box-shadow: none;
    background: var(--ink);
}
.subcat-card:hover .subcat-name, .subcat-card.active .subcat-name { color: var(--paper); }
.subcat-icon { transition: transform .3s var(--ease); }
/* Плитка «Всі товари» з картинкою металу: фото на всю ширину плитки, без відступів */
.subcat-card:has(.subcat-img) { padding: 0 0 14px; overflow: hidden; }
.subcat-img { margin: 0 0 12px; font-size: 0; overflow: hidden; }
.subcat-img img { display: block; width: 100%; height: 84px; object-fit: cover; transition: transform .6s var(--ease); }
.subcat-card:hover .subcat-img { transform: none; }
.subcat-card:hover .subcat-img img { transform: scale(1.06); }
.subcat-card:hover .subcat-icon { transform: translateY(-3px); }
.subcat-name {
    color: var(--ink);
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.3;
    overflow-wrap: break-word;
    hyphens: auto;
}
/* Плитки з чіткими мініатюрами 3:2 (tools/build-tile-thumbs.js): більші, підпис без переносів «фасон-ний» */
.subcategories-grid.is-photo { grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); }
.subcategories-grid.is-photo .subcat-img img { height: auto; aspect-ratio: 3 / 2; }
.subcategories-grid.is-photo .subcat-card:has(.subcat-img) { padding-bottom: 16px; }
.subcategories-grid.is-photo .subcat-name { padding: 0 12px; font-size: 14px; hyphens: manual; text-wrap: balance; }
@media (max-width: 900px) { .subcategories-grid.is-photo { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .subcategories-grid.is-photo { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Картки товарів ---------- */
#crm-products-container { display: grid; gap: 16px; }

.crm-product-row {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px 36px;
    padding: 22px 24px 22px 28px;
    background: var(--paper);
    border: 1px solid var(--ash);
    border-radius: 0;
    transition: transform .2s cubic-bezier(.23, 1, .32, 1), box-shadow .2s cubic-bezier(.23, 1, .32, 1), border-color .2s ease;
}
/* чорна смуга зліва: з'являється при наведенні */
.crm-product-row::before {
    content: "";
    position: absolute;
    left: -1px; top: -1px; bottom: -1px;
    width: 4px;
    background: var(--ink);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform .22s cubic-bezier(.23, 1, .32, 1);
}
@media (hover: hover) and (pointer: fine) {
    .crm-product-row:hover, .crm-product-row.force-hover {
        transform: translateY(-2px);
        border-color: var(--ink);
        box-shadow: 6px 6px 0 rgba(18, 18, 18, .10);
    }
    .crm-product-row:hover::before, .crm-product-row.force-hover::before { transform: scaleY(1); }
}
.crm-product-row:focus-within { border-color: var(--ink); }

.crm-product-info { min-width: 0; }
.crm-badge {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 4px 10px 4px 8px;
    border: 1px solid var(--ash);
    background: var(--paper);
    color: var(--graphite);
    font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    line-height: 1.2;
    margin-bottom: 10px;
}
.crm-badge::before { content: ""; width: 7px; height: 7px; background: var(--ink); border-radius: 50%; }
.crm-product-title { color: var(--ink); font-size: 18px; font-weight: 800; line-height: 1.3; margin-bottom: 14px; }
.crm-product-specs {
    display: flex; flex-wrap: wrap; gap: 14px 32px;
    padding-top: 14px;
    border-top: 1px solid var(--ash);
    color: var(--graphite);
}
.spec-item {
    font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
    line-height: 1.3;
    min-width: 0; overflow-wrap: anywhere;
}.spec-item span { display: block; margin-top: 4px; color: var(--ink); font-size: 15px; font-weight: 800; letter-spacing: 0; text-transform: none; }

.crm-product-action { display: flex; align-items: center; gap: 18px; }
/* Лічильник кількості: один цілісний контрол тієї ж висоти й товщини рамки, що й кнопка «ЗАМОВИТИ» */
.qty-stepper {
    display: flex; align-items: stretch;
    height: 44px;
    background: var(--paper);
    border: 2px solid var(--ink);
}
.qty-btn {
    position: relative;
    flex: 0 0 42px;
    width: 42px; padding: 0;
    background: var(--paper); color: var(--ink);
    border: none; border-radius: 0;
    cursor: pointer;
    touch-action: manipulation;
    transition: background .15s ease, color .15s ease, transform .12s ease;
}
/* «−» і «+» малюємо двома штрихами — вони завжди точно по центру, незалежно від шрифту */
.qty-btn::before, .qty-btn::after {
    content: "";
    position: absolute; left: 50%; top: 50%;
    width: 12px; height: 2px;
    background: currentColor;
    transform: translate(-50%, -50%);
}
.qty-plus::after { width: 2px; height: 12px; }
.qty-minus::after { display: none; }
.qty-btn:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
.qty-btn:active:not(:disabled) { transform: scale(.94); }
.qty-btn:focus-visible { outline: 3px solid var(--steel); outline-offset: -3px; }
.qty-btn:disabled { color: var(--ash); cursor: not-allowed; }

.qty-field {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 0 14px;                        /* однакові відступи від «−» до цифри та від одиниці до «+» */
    border-left: 1px solid var(--ink); border-right: 1px solid var(--ink);
    cursor: text;
}
.qty-input, .qty-box .qty-input {
    box-sizing: content-box;
    width: calc(1ch + 2px);                 /* далі підлаштовується під кількість цифр (catalog-crm.js) */
    min-width: calc(1ch + 2px); max-width: 7ch;
    height: 100%; margin: 0; padding: 0;
    border: none; border-radius: 0; background: transparent;
    text-align: center;
    font: 800 16px var(--font);
    font-variant-numeric: tabular-nums;
    color: var(--ink);
    -moz-appearance: textfield; appearance: textfield;
    transition: width .12s ease-out;
}
.qty-input::-webkit-outer-spin-button, .qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-input:focus { outline: none; }
.qty-field:focus-within { background: var(--fog); }.qty-unit { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--graphite); white-space: nowrap; }
.btn-buy {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    height: 44px; padding: 0 26px;
    background: var(--ink); color: var(--paper);
    border: 2px solid var(--ink); border-radius: 0;
    font: 700 13px var(--font);
    letter-spacing: .08em; text-transform: uppercase;
    cursor: pointer;
    touch-action: manipulation;
    transition: background .2s, color .2s, transform .12s;
}
.btn-buy i { font-size: 14px; transition: transform .25s cubic-bezier(.23, 1, .32, 1); }
.btn-buy:hover { background: var(--paper); color: var(--ink); }
.btn-buy:hover i { transform: translateX(3px); }
.btn-buy:active { transform: scale(.97); }
.btn-buy:focus-visible { outline: 3px solid var(--steel); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
    .crm-product-row, .crm-product-row::before, .btn-buy i { transition: none; }
    .crm-product-row:hover, .crm-product-row.force-hover { transform: none; }
}
@media (max-width: 760px) {
    .crm-product-row { grid-template-columns: 1fr; padding: 20px 18px 20px 22px; gap: 18px; }
    .crm-product-action { justify-content: space-between; }
    .btn-buy { flex: 1; padding: 0 16px; }
    .crm-product-title { font-size: 17px; }
}
/* ---------- Сторінки послуг (services.css) ---------- */
.service-page h1 {
    font-size: clamp(28px, 3.6vw, 44px);
    font-weight: 800;
    text-transform: uppercase;
    color: var(--ink);
    line-height: 1.1;
    padding-bottom: 16px;
    border-bottom: var(--line);
}
.service-lead { color: var(--graphite); }
.service-block {
    border-radius: 0;
    box-shadow: none;
    border: 1px solid var(--ash);
    border-top: var(--line);
}
.service-block h2 { color: var(--ink); text-transform: uppercase; font-weight: 800; font-size: 18px; letter-spacing: .03em; }
.service-list li { color: var(--ink); }
.service-list li::before { color: var(--ink); }
.metal-tag {
    border-radius: 0;
    border: var(--line);
    background: var(--paper);
    color: var(--ink);
    font-weight: 600;
}
a.metal-tag:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.service-steps li { border-radius: 0; background: var(--fog); color: var(--ink); }
.service-steps li::before { border-radius: 0; background: var(--ink); }
.service-cta { border-radius: 0; background: var(--ink); text-align: left; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px 30px; padding: 34px 30px; }
.service-cta h2 { text-transform: uppercase; font-weight: 800; }
.service-cta p { color: var(--steel); margin-bottom: 0; grid-column: 1; }
.service-cta .btn-service-order { grid-column: 2; grid-row: 1 / span 2; }
.btn-service-order {
    background: var(--paper);
    color: var(--ink);
    border: 2px solid var(--paper);
    border-radius: 0;
    font-family: var(--font);
    font-size: 14px;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.btn-service-order:hover { background: transparent; color: var(--paper); }

/* ---------- Калькулятор ---------- */
.calculator-section { background: var(--fog); padding: 60px 24px 80px; text-align: left; }
.calculator-section > h1,
.calculator-section > h2 {
    max-width: 900px;
    margin: 0 auto 30px;
    font-size: clamp(26px, 3.4vw, 40px);
    font-weight: 800;
    text-transform: uppercase;
    color: var(--ink);
    padding-bottom: 16px;
    border-bottom: var(--line);
}
.calculator-container {
    border-radius: 0;
    border: var(--line);
    box-shadow: 10px 10px 0 rgba(18,18,18,.12);
}
.input-group label {
    color: var(--graphite);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.input-group input,
.input-group select {
    border: 2px solid var(--ash);
    border-radius: 0;
    color: var(--ink);
    background: var(--paper);
    transition: border-color .2s;
}
.input-group input:focus,
.input-group select:focus { outline: none; border-color: var(--ink); }

/* Числові поля без стрілок «вгору/вниз» */
.input-group input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.input-group input[type=number]::-webkit-outer-spin-button,
.input-group input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
#calculate-btn {
    background: var(--ink);
    border: var(--line);
    border-radius: 0;
    font: 700 15px var(--font);
    letter-spacing: .08em;
    text-transform: uppercase;
}
#calculate-btn:hover { background: var(--paper); color: var(--ink); }
.result-box { background: var(--fog); border-left: 5px solid var(--ink); border-radius: 0; }
#weight-result { color: var(--ink); font-weight: 800; }
.result-piece { margin-top: 6px !important; font-size: 14px !important; color: var(--graphite); }
.result-piece strong { color: var(--ink); }
.calc-image-box { border-radius: 0; border: 1px dashed var(--steel); background: var(--fog); }
.calc-image-box p { font-size: 14px; line-height: 1.5; max-width: 220px; }

/* Коли креслення вибрано — воно стає цільною карткою без пунктиру й «рамки в рамці» */
.calc-image-box.has-drawing {
    padding: 8px;
    min-height: 0;
    align-self: flex-start;
    overflow: hidden;
    background: var(--paper);
    border: 2px solid var(--ink);
    position: sticky;      /* на довгій формі креслення лишається перед очима */
    top: 20px;
}
/* Усі креслення — квадрат 1:1 на прозорому фоні, тож рамка завжди однакового розміру */
.calc-image-box.has-drawing img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    max-width: none;
    border-radius: 0;
    animation: drawing-in .35s var(--ease);
}
@keyframes drawing-in { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .calc-image-box.has-drawing img { animation: none; } }
@media (max-width: 768px) {
    .calc-image-box.has-drawing { position: static; width: 100%; max-width: 380px; margin: 0 auto; }
}

/* ---------- Контакти ---------- */
.contacts-page { background: var(--fog); padding: 60px 24px 80px; }
.contacts-container { max-width: var(--container); }
.contact-details, .contact-form {
    border-radius: 0;
    border: var(--line);
    box-shadow: none;
}
.contact-details h1, .contact-details h2, .contact-form h2 {
    font-size: 24px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--ink);
    padding-bottom: 14px;
    margin-bottom: 18px;
    border-bottom: var(--line);
}
.contact-details > p { color: var(--graphite); line-height: 1.6; margin-bottom: 20px; }
.info-list { list-style: none; display: grid; gap: 14px; }
.info-list li { display: flex; gap: 14px; align-items: flex-start; line-height: 1.6; padding-left: 0; }
/* Іконки контактів — чорні квадрати з білою іконкою, як елементи сайту */
.info-ico {
    flex: 0 0 34px;
    height: 34px;
    display: flex; align-items: center; justify-content: center;
    background: var(--ink); color: var(--paper);
    font-size: 14px;
    margin-top: 1px;
}
.info-text { padding-top: 4px; min-width: 0; overflow-wrap: anywhere; }
.info-list strong { color: var(--ink); }
.info-list a { color: var(--ink); font-weight: 700; }
.btn-messenger {
    border-radius: 0;
    border: var(--line);
    background: var(--paper) !important;
    color: var(--ink);
    font-family: var(--font);
    font-size: 14px;
    letter-spacing: .04em;
    text-transform: uppercase;
    transition: background .2s, color .2s;
}
.btn-messenger:hover { background: var(--ink) !important; color: var(--paper); }
.btn-messenger i { margin-right: 8px; font-size: 18px; vertical-align: -2px; }
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--graphite);
}
.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--ash);
    border-radius: 0;
    font: 15px var(--font);
    color: var(--ink);
    transition: border-color .2s;
}
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--ink); }
.form-group textarea { resize: none; display: block; }
@media (max-width: 600px) { .form-group input, .form-group textarea { font-size: 16px; } }   /* менше 16px — iPhone збільшує екран під час введення */
.contact-form .btn-primary {
    width: 100%;
    background: var(--ink);
    border: var(--line);
    border-radius: 0;
    padding: 15px;
    font: 700 14px var(--font);
    letter-spacing: .08em;
    text-transform: uppercase;
}
.contact-form .btn-primary:hover { background: var(--paper); color: var(--ink); }
.form-consent { margin: 12px 0 0; font-size: 13px; line-height: 1.5; color: var(--graphite); text-align: center; }
.form-consent a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
/* ---------- Політика конфіденційності (privacy.html; типографіка — як у статтях, .article-body) ---------- */
.privacy-date { margin: 12px 0 0; font-size: 13px; font-weight: 600; color: var(--graphite); }
.privacy-body { max-width: 820px; margin-top: 36px; }
.catalog-section .privacy-body a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
/* ---------- «Сторінку не знайдено» (404.html) ---------- */
.notfound-page { min-height: 46vh; }
.notfound-code { margin: 0 0 6px; font-size: clamp(72px, 14vw, 150px); font-weight: 800; line-height: 1; color: var(--ink); }
.notfound-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.catalog-section .notfound-links a { padding: 13px 20px; border: var(--line); font-weight: 700; color: var(--ink); text-decoration: none; transition: background .2s, color .2s; }
.catalog-section .notfound-links a:hover { background: var(--ink); color: var(--paper); }
.map-container { max-width: var(--container); border-radius: 0; border: var(--line); box-shadow: none; }
.map-container iframe { display: block; width: 100%; border: 0; }

/* ---------- Карта складів ---------- */
.map-block { max-width: var(--container); margin: 0 auto; }
.map-title {
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 800;
    text-transform: uppercase;
    color: var(--ink);
    padding-bottom: 14px;
    margin-bottom: 22px;
    border-bottom: var(--line);
}
.map-layout {
    display: grid;
    grid-template-columns: 330px 1fr;
    border: var(--line);
    background: var(--paper);
}
.map-cards { list-style: none; display: flex; flex-direction: column; border-right: var(--line); }
.map-cards li { border-bottom: 1px solid var(--ash); }
.map-cards li:last-child { border-bottom: none; margin-top: auto; }
.map-card {
    display: flex;
    gap: 14px;
    align-items: center;
    width: 100%;
    padding: 18px 20px;
    background: var(--paper);
    border: none;
    text-align: left;
    cursor: pointer;
    font-family: var(--font);
    color: var(--ink);
    transition: background .25s var(--ease), color .25s var(--ease);
}
.map-card-num {
    flex: 0 0 34px;
    height: 34px;
    display: flex; align-items: center; justify-content: center;
    background: var(--ink); color: var(--paper);
    font-weight: 800; font-size: 14px;
    border: 2px solid var(--ink);
    transition: background .25s, color .25s;
}
.map-card-body { display: flex; flex-direction: column; gap: 2px; line-height: 1.35; }
.map-card-body b { font-size: 17px; font-weight: 800; text-transform: uppercase; }
.map-card-body span { font-size: 14px; }
.map-card-body small { font-size: 12px; color: var(--graphite); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; transition: color .25s; }
.map-card:hover, .map-card.is-active { background: var(--ink); color: var(--paper); }
.map-card:hover .map-card-num, .map-card.is-active .map-card-num { background: var(--paper); color: var(--ink); }
.map-card:hover small, .map-card.is-active small { color: var(--steel); }
.map-card:focus-visible, .map-all:focus-visible { outline: 3px solid var(--steel); outline-offset: -3px; }
.map-all {
    width: 100%;
    padding: 16px 20px;
    background: var(--fog);
    border: none;
    cursor: pointer;
    font: 700 12px var(--font);
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ink);
    transition: background .2s, color .2s;
}
.map-all:hover { background: var(--ink); color: var(--paper); }
.map-canvas { min-height: 520px; height: 100%; background: var(--fog); z-index: 0; }
.map-note { margin-top: 12px; font-size: 13px; color: var(--graphite); }

/* Мітки-«шпильки» */
.map-pin { background: none; border: none; }
.map-pin span {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px;
    background: var(--ink); color: var(--paper);
    border: 2px solid var(--paper);
    box-shadow: 0 3px 8px rgba(0,0,0,.35);
    font: 800 15px var(--font);
    transition: transform .25s var(--ease), background .2s, color .2s;
}
.map-pin span::after {
    content: "";
    position: absolute; left: 50%; bottom: -9px;
    margin-left: -7px;
    border: 7px solid transparent; border-top-color: var(--ink); border-bottom: 0;
}
.map-pin:hover span, .map-pin.is-active span { transform: translateY(-4px) scale(1.12); background: var(--paper); color: var(--ink); border-color: var(--ink); }
.map-pin.is-active span::after, .map-pin:hover span::after { border-top-color: var(--ink); }

/* Вікно мітки та елементи керування Leaflet — у стилі сайту */
.leaflet-container { font-family: var(--font); background: var(--fog); }
/* Сіра мінімалістична карта в тон сайту */
.leaflet-tile-pane { filter: grayscale(1) contrast(.92) brightness(1.07); }
.leaflet-popup-content-wrapper { border-radius: 0; border: 2px solid var(--ink); box-shadow: 6px 6px 0 rgba(18,18,18,.15); color: var(--ink); }
.leaflet-popup-tip { border-radius: 0; background: var(--ink); box-shadow: none; }
.leaflet-popup-content { margin: 14px 18px; line-height: 1.5; }
.map-popup { display: flex; flex-direction: column; gap: 2px; }
.map-popup strong { font-size: 17px; text-transform: uppercase; font-weight: 800; }
.map-popup span { font-size: 14px; color: var(--graphite); }
.map-popup a {
    margin-top: 10px;
    display: inline-block;
    padding: 9px 12px;
    background: var(--ink); color: var(--paper) !important;
    font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; text-decoration: none; text-align: center;
    border: 2px solid var(--ink);
    transition: background .2s, color .2s;
}
.map-popup a:hover { background: var(--paper); color: var(--ink) !important; }
.leaflet-bar { border-radius: 0 !important; border: 2px solid var(--ink) !important; box-shadow: none !important; }
.leaflet-bar a { border-radius: 0 !important; color: var(--ink); background: var(--paper); border-bottom: 1px solid var(--ash); }
.leaflet-bar a:hover { background: var(--ink); color: var(--paper); }
.leaflet-control-attribution { font-family: var(--font); font-size: 10px; background: rgba(255,255,255,.85) !important; }
.leaflet-control-attribution a { color: var(--graphite); }
.leaflet-container a.leaflet-popup-close-button { color: var(--ink); }

@media (max-width: 900px) {
    .map-layout { grid-template-columns: 1fr; }
    .map-cards { border-right: none; border-bottom: var(--line); display: grid; grid-template-columns: repeat(2, 1fr); }
    .map-cards li { border-bottom: 1px solid var(--ash); }
    .map-cards li:nth-child(odd) { border-right: 1px solid var(--ash); }
    .map-cards li:last-child { grid-column: 1 / -1; border-right: none; }
    .map-canvas { min-height: 380px; }
}
@media (max-width: 520px) {
    .map-cards { grid-template-columns: 1fr; }
    .map-cards li:nth-child(odd) { border-right: none; }
}

/* ---------- Адаптив ---------- */
@media (max-width: 900px) {
    .catalog-layout { flex-direction: column; }
    .catalog-sidebar { flex: none; width: 100%; position: static; }
    .catalog-side { flex: none; width: 100%; position: static; max-height: none; overflow: visible; align-self: auto; }
    /* на вузьких екранах блок «Корисні статті» у панелі скорочуємо до своєї статті (список товарів не відсуваємо) */
    .useful-articles.is-side .useful-sub, .useful-articles.is-side .useful-more { display: none; }
    .service-cta { grid-template-columns: 1fr; }
    .service-cta .btn-service-order { grid-column: 1; grid-row: auto; justify-self: start; }
}

@media (max-width: 600px) {
    .catalog-section { padding: 30px 16px 60px; }
    .subcategories-grid { grid-template-columns: repeat(2, 1fr); }
    .crm-product-row { flex-direction: column; align-items: stretch; }
    .crm-product-action { justify-content: space-between; }
    .calculator-section, .contacts-page { padding: 40px 16px 60px; }
    .calculator-container, .contact-details, .contact-form { padding: 20px; }
}

/* ---------- Статті ---------- */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    border-top: 1px solid var(--ash);
    border-left: 1px solid var(--ash);
    margin-top: 10px;
}
.article-card {
    position: relative;
    display: flex; flex-direction: column; gap: 12px;
    padding: 28px 26px 26px 30px;
    background: var(--paper);
    border-right: 1px solid var(--ash); border-bottom: 1px solid var(--ash);
    color: var(--ink);
    text-decoration: none;
    transition: background .25s var(--ease);
}
.article-card::before {
    content: "";
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--ink);
    transform: scaleY(0); transform-origin: top;
    transition: transform .22s cubic-bezier(.23, 1, .32, 1);
}
.article-card h2 { margin: 0; font-size: 20px; font-weight: 800; line-height: 1.25; }
.article-card p { margin: 0; flex-grow: 1; color: var(--graphite); font-size: 15px; line-height: 1.6; }
.article-more {
    align-self: flex-start;
    padding-bottom: 3px;
    border-bottom: 2px solid var(--ink);
    font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.article-card:focus-visible { outline: 3px solid var(--steel); outline-offset: -3px; }
@media (hover: hover) and (pointer: fine) {
    .article-card:hover { background: var(--fog); }
    .article-card:hover::before { transform: scaleY(1); }
}

.article-meta {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
    font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: var(--graphite);
}
.article-cat { padding: 4px 10px; border: 1px solid var(--ink); color: var(--ink); }
.article-read { display: inline-flex; gap: 4px; }

/* блок «Корисні статті» на інших сторінках */
.useful-articles { margin-top: 48px; padding-top: 22px; border-top: var(--line); }
.useful-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px; margin-bottom: 18px; }
.useful-head h2 { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.useful-head a {
    padding-bottom: 2px; border-bottom: 2px solid var(--ink);
    font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: var(--ink); text-decoration: none;
}
.useful-head a:focus-visible { outline: 3px solid var(--steel); outline-offset: 3px; }
.useful-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    border-top: 1px solid var(--ash); border-left: 1px solid var(--ash);
}
.useful-grid .article-card { padding: 22px 22px 20px 26px; gap: 14px; justify-content: space-between; }
.useful-grid .article-card h3 { margin: 0; font-size: 18px; font-weight: 800; line-height: 1.3; }

.calculator-section .useful-articles { max-width: 900px; margin-left: auto; margin-right: auto; }

/* сторінки послуг: ряд карток (своя стаття + суміжні) серед секцій .svc-sec */
.useful-articles.is-wide { margin: 44px 0 36px; }
.useful-articles.is-wide .useful-grid { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .useful-articles.is-wide .useful-grid { grid-template-columns: 1fr; } }

/* варіант у лівій колонці каталогу: окремий блок під панеллю фільтрів (не всередині неї) */
.useful-articles.is-side { margin: 0; padding: 20px 20px 8px; background: var(--paper); border: var(--line); }
.useful-articles.is-side .useful-grid { grid-template-columns: 1fr; }
.useful-articles.is-side .article-card { padding: 16px 16px 14px 20px; }
.useful-articles.is-side .article-card h3 { font-size: 16px; }
/* «Може вас зацікавити»: компактні посилання на суміжні статті */
.useful-sub { margin: 20px 0 8px; font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--graphite); }
.useful-more { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ash); }
.useful-more a {
    display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
    padding: 10px 12px 10px 2px; border-bottom: 1px solid var(--ash);
    font-size: 14px; font-weight: 700; line-height: 1.35; color: var(--ink); text-decoration: none;
    transition: background .2s var(--ease);
}
/* текст стоїть на місці; при наведенні лише стрілка трохи «від'їжджає» вправо */
.useful-more a::after { content: "→"; flex: none; transition: transform .22s var(--ease); }
.useful-more a:focus-visible { outline: 3px solid var(--steel); outline-offset: -3px; }
.useful-more a:focus-visible::after { transform: translateX(4px); }
@media (hover: hover) and (pointer: fine) {
    .useful-more a:hover { background: var(--fog); }
    .useful-more a:hover::after { transform: translateX(4px); }
}
@media (prefers-reduced-motion: reduce) { .useful-more a, .useful-more a::after { transition: none; } }

/* сторінка «Статті»: рубрики-кнопки (стилі чипів — .series-chip) */
.article-card[hidden] { display: none; }
.articles-cats { margin: 18px 0 14px 2px; }

/* сторінка статті */
.article-head { max-width: 860px; margin-bottom: 36px; }
.article-head h1 {
    margin: 18px 0 16px;
    font-size: clamp(28px, 4vw, 46px); font-weight: 800; line-height: 1.1;
    text-transform: uppercase; color: var(--ink);
}
.article-lead { margin: 0; max-width: 760px; font-size: 18px; line-height: 1.6; color: var(--graphite); }
.article-layout {
    display: grid;
    grid-template-columns: 270px minmax(0, 760px);
    gap: 56px;
    align-items: start;
    padding-top: 34px;
    border-top: var(--line);
}
.article-layout.no-toc { grid-template-columns: minmax(0, 760px); }
.article-toc { position: sticky; top: 20px; padding: 20px 22px; background: var(--paper); border: 2px solid var(--ink); }
.article-toc-title { margin: 0 0 12px; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); }
.article-toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.article-toc a {
    display: block;
    padding: 7px 0 7px 14px;
    border-left: 3px solid transparent;
    color: var(--graphite);
    font-size: 14px; font-weight: 600; line-height: 1.35;
    text-decoration: none;
    transition: color .2s, border-color .2s;
}
.article-toc .lvl-3 a { padding-left: 28px; font-weight: 500; }
.article-toc a:hover { color: var(--ink); }
.article-toc a.is-current { color: var(--ink); border-left-color: var(--ink); }
.article-toc a:focus-visible { outline: 3px solid var(--steel); outline-offset: -2px; }

.article-body h2 {
    margin: 44px 0 16px; padding-left: 16px;
    border-left: 4px solid var(--ink);
    font-size: 24px; font-weight: 800; line-height: 1.25; text-transform: uppercase; color: var(--ink);
    scroll-margin-top: 24px;
}
.article-body > h2:first-child { margin-top: 0; }
.article-body h3 { margin: 28px 0 10px; font-size: 18px; font-weight: 800; color: var(--ink); scroll-margin-top: 24px; }
.article-body p { margin: 0 0 16px; font-size: 17px; line-height: 1.75; color: #222; }
.article-body ul, .article-body ol { list-style: none; margin: 0 0 22px; padding: 0; counter-reset: li; }
.article-body li { position: relative; margin-bottom: 10px; padding-left: 30px; font-size: 17px; line-height: 1.65; color: #222; }
.article-body ul li::before { content: ""; position: absolute; left: 4px; top: .65em; width: 9px; height: 9px; background: var(--ink); }
.article-body ol li { counter-increment: li; }
.article-body ol li::before {
    content: counter(li);
    position: absolute; left: 0; top: .12em;
    width: 22px; height: 22px;
    background: var(--ink); color: var(--paper);
    font: 700 12px/22px var(--font); text-align: center;
}
.article-body blockquote { margin: 22px 0; padding: 16px 20px; background: var(--fog); border-left: 4px solid var(--ink); }
.article-body blockquote p { margin: 0; }
.table-wrap { margin: 8px 0 26px; overflow-x: auto; border: 1px solid var(--ash); }
.article-body table { width: 100%; border-collapse: collapse; font-size: 15px; }
.article-body th {
    padding: 12px 16px; text-align: left;
    background: var(--ink); color: var(--paper);
    font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
}
.article-body td { padding: 12px 16px; border-top: 1px solid var(--ash); line-height: 1.5; color: #222; }
.article-body tbody tr:nth-child(even) td { background: var(--fog); }
.article-related { margin-top: 44px; padding-top: 26px; border-top: 1px solid var(--ash); }
.article-body .article-related h2 { margin: 0 0 14px; padding: 0; border: none; font-size: 13px; letter-spacing: .14em; }
.article-body .service-cta { margin-top: 40px; }
.article-body .service-cta h2 { margin: 0 0 10px; padding: 0; border: none; color: var(--paper); }
.article-body .service-cta p { margin: 0; font-size: 16px; line-height: 1.6; color: var(--ash); }   /* світлий текст на чорній смузі (раніше успадковував темний колір абзаців статті) */
.article-nav { display: grid; grid-template-columns: 1fr 1fr; margin-top: 26px; border: 1px solid var(--ash); }
.article-nav-link {
    display: flex; flex-direction: column; gap: 6px;
    padding: 20px 22px;
    color: var(--ink); text-decoration: none;
    transition: background .2s, color .2s;
}
.article-nav-link small { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--graphite); transition: color .2s; }
.article-nav-link span { font-weight: 800; line-height: 1.35; }
.article-nav-link.next { text-align: right; border-left: 1px solid var(--ash); }
.article-nav-link:only-child { grid-column: 1 / -1; }
.article-nav-link:focus-visible { outline: 3px solid var(--steel); outline-offset: -3px; }
@media (hover: hover) and (pointer: fine) {
    .article-nav-link:hover { background: var(--ink); color: var(--paper); }
    .article-nav-link:hover small { color: var(--steel); }
}
@media (prefers-reduced-motion: no-preference) { html.smooth-anchors { scroll-behavior: smooth; } }
@media (prefers-reduced-motion: reduce) { .article-card::before { transition: none; } }
@media (max-width: 1000px) {
    .article-layout, .article-layout.no-toc { grid-template-columns: minmax(0, 1fr); gap: 28px; }
    .article-toc { position: static; }
}
@media (max-width: 600px) {
    .articles-grid { grid-template-columns: 1fr; }
    .article-body h2 { font-size: 21px; }
    .article-body p, .article-body li { font-size: 16px; }
    .article-nav { grid-template-columns: 1fr; }
    .article-nav-link.next { text-align: left; border-left: none; border-top: 1px solid var(--ash); }
}
/* ---------- Про компанію ---------- */
.about-intro { padding-bottom: 40px; }
.about-intro .page-lead { max-width: 760px; font-size: 18px; line-height: 1.65; }
/* Текст «Хто ми» під вступом: типографіка як у SEO-тексті, але без верхньої лінії й ширша колонка */
.about-story { padding-top: 0; padding-bottom: 56px; }
.about-story .seo-text { margin-top: 0; padding-top: 0; border-top: 0; }
.about-story .seo-text-body { max-width: 820px; }
.about-story .seo-text p, .about-story .seo-text li { font-size: 16px; }
.about-links { display: flex; flex-wrap: wrap; gap: 14px 32px; margin-top: 22px; }
.about-wh-grid {
    list-style: none; margin: 0; padding: 0;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    border-top: var(--line); border-left: var(--line);
}
.about-wh {
    position: relative; display: flex; flex-direction: column; gap: 6px;
    padding: 28px 24px 26px;
    border-right: var(--line); border-bottom: var(--line);
    background: var(--paper);
    transition: background .2s var(--ease), color .2s var(--ease);
}
.about-wh-num { font-size: 13px; font-weight: 800; letter-spacing: .12em; color: var(--graphite); }
.about-wh b { font-size: 24px; font-weight: 800; text-transform: uppercase; }
.about-wh span:not(.about-wh-num) { font-size: 15px; color: var(--ink); }
.about-wh small { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--graphite); }
.about-map-link { display: inline-block; margin-top: 24px; }
@media (hover: hover) and (pointer: fine) {
    .about-wh:hover { background: var(--ink); color: var(--paper); }
    .about-wh:hover .about-wh-num, .about-wh:hover small { color: var(--steel); }
    .about-wh:hover span:not(.about-wh-num) { color: var(--paper); }
}
@media (prefers-reduced-motion: reduce) { .about-wh { transition: none; } }

/* ---------- Каталог: плитки-посилання (catalog.html) ---------- */
a.product-card {
    position: relative;
    display: flex; flex-direction: column;
    color: var(--ink); text-decoration: none;
    transition: background .2s var(--ease), color .2s var(--ease);
}
a.product-card .product-desc { flex-grow: 1; margin: 0 0 22px; line-height: 1.55; font-size: 14.5px; transition: color .2s var(--ease); }
a.product-card .product-more {
    align-self: flex-start;
    padding-bottom: 3px; border-bottom: 2px solid var(--ink);
    font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    transition: border-color .2s var(--ease);
}
a.product-card .product-image-icon { display: flex; align-items: center; justify-content: center; height: 160px; }
a.product-card .product-image-icon i { font-size: 72px; color: var(--steel); transition: color .2s var(--ease); }
a.product-card:focus-visible { outline: 3px solid var(--steel); outline-offset: -3px; }
@media (hover: hover) and (pointer: fine) {
    a.product-card:hover { background: var(--ink); color: var(--paper); }
    a.product-card:hover h2, a.product-card:hover .product-desc { color: var(--paper); }
    a.product-card:hover .product-desc { color: var(--ash); }
    a.product-card:hover .product-more { border-color: var(--paper); }
    a.product-card:hover .product-image-icon i { color: var(--paper); }
}
@media (prefers-reduced-motion: reduce) {
    a.product-card, a.product-card * { transition: none; }
    a.product-card:hover .product-image img { transform: none; }
}
/* фото без фону: показуємо повністю, без обрізання по краях */
img.cutout { object-fit: contain; }

/* плитка «Назад до розділу» */
.subcat-card--back { position: relative; }
.subcat-card--back::after { content: ""; position: absolute; inset: 0; border: 2px solid var(--ink); pointer-events: none; }
.subcat-card--back .subcat-img { position: relative; }
.subcat-back-label {
    position: absolute; left: 0; top: 0; z-index: 1;
    padding: 6px 10px;
    background: var(--ink); color: var(--paper);
    font: 800 10px/1 var(--font); letter-spacing: .14em; text-transform: uppercase;
    transition: background .2s var(--ease), color .2s var(--ease);
}
.subcat-back-arrow { display: inline-block; transition: transform .2s var(--ease); }
.subcat-card--back:focus-visible { outline: 3px solid var(--steel); outline-offset: -3px; }
@media (hover: hover) and (pointer: fine) {
    .subcat-card--back:hover .subcat-back-arrow { transform: translateX(-4px); }
    .subcat-card--back:hover .subcat-back-label { background: var(--paper); color: var(--ink); }
    .subcat-card--back:hover::after { border-color: var(--paper); }
}
@media (prefers-reduced-motion: reduce) { .subcat-back-arrow, .subcat-back-label { transition: none; } .subcat-card--back:hover .subcat-back-arrow { transform: none; } }

.subcat-card--back .subcat-name { padding: 0 10px; }

/* ---------- Міні-фільтр «серія» над списком товарів (сегментні кнопки) ---------- */
.series-chips { display: flex; flex-wrap: wrap; margin: 0 0 24px 2px; }
.series-chips[hidden] { display: none; }
.series-chip {
    display: inline-flex; align-items: baseline; gap: 8px;
    margin: 0 0 -2px -2px;
    padding: 11px 18px;
    background: var(--paper); color: var(--ink);
    border: var(--line); border-radius: 0;
    font: 700 12px var(--font); letter-spacing: .08em; text-transform: uppercase;
    cursor: pointer;
    transition: background .2s var(--ease), color .2s var(--ease);
}
.series-chip small { font: 600 11px var(--font); letter-spacing: 0; color: var(--graphite); transition: color .2s var(--ease); }
.series-chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); position: relative; z-index: 1; }
.series-chip[aria-pressed="true"] small { color: var(--steel); }
.series-chip:focus-visible { outline: 3px solid var(--steel); outline-offset: 2px; position: relative; z-index: 2; }
@media (hover: hover) and (pointer: fine) {
    .series-chip:not([aria-pressed="true"]):hover { background: var(--fog); }
}
@media (prefers-reduced-motion: reduce) { .series-chip, .series-chip small { transition: none; } }
/* ---------- Перемикач сторінок під списком товарів ---------- */
.crm-pager { display: flex; flex-direction: column; align-items: center; gap: 14px; margin: 34px 0 10px; }
.crm-pager[hidden] { display: none; }
.crm-pager-nums { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.crm-page {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 44px; height: 44px; padding: 0 10px;
    background: var(--paper); color: var(--ink);
    border: 1px solid var(--ash); border-radius: 0;
    font: 700 14px var(--font); cursor: pointer;
    transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.crm-page.is-current { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.crm-page-arrow { min-width: 44px; padding: 0; }
.crm-page-arrow svg { width: 20px; height: 9px; transition: transform .2s var(--ease); }
.crm-page:disabled { color: var(--steel); border-color: var(--ash); cursor: not-allowed; }
.crm-page:focus-visible { outline: 3px solid var(--steel); outline-offset: 2px; }
.crm-page-gap { min-width: 22px; text-align: center; color: var(--graphite); font-weight: 700; letter-spacing: .1em; }
.crm-pager-info { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--graphite); }
@media (hover: hover) and (pointer: fine) {
    .crm-page:not(.is-current):not(:disabled):hover { border-color: var(--ink); background: var(--fog); }
    .crm-page-arrow:not(:disabled):hover svg { transform: translateX(3px); }
    .crm-page-arrow:not(:disabled):first-child:hover svg { transform: translateX(-3px); }
}
@media (prefers-reduced-motion: reduce) { .crm-page, .crm-page-arrow svg { transition: none; } .crm-page-arrow:hover svg { transform: none !important; } }
@media (max-width: 480px) { .crm-pager-nums { gap: 6px; } .crm-page { min-width: 38px; height: 40px; padding: 0 6px; } .crm-page-arrow { min-width: 38px; } }

/* алюміній, бронза, мідь: білий задній фон під фото без фону */
.product-image:has(> img.cutout) { background: #fff; }

/* Фото-банер по центру під заголовком сторінки (Лиття металів) */
.page-photo { margin: 8px auto 36px; max-width: 760px; text-align: center; }
.page-photo img { display: block; width: 100%; height: auto; margin: 0 auto; border: 1px solid var(--ash); background: #fff; }

/* ---------- Послуги: картки-плитки (чорні при наведенні, як у каталозі) ---------- */
.product-card:has(.service-card-link) { position: relative; transition: background .2s var(--ease), color .2s var(--ease); }
.product-card:has(.service-card-link) h2, .product-card:has(.service-card-link) .product-desc { transition: color .2s var(--ease); }
.product-card:has(.service-card-link) .service-card-link::after { content: ""; position: absolute; inset: 0; }   /* уся картка клікабельна */
.product-card:has(.service-card-link):focus-within { outline: 3px solid var(--steel); outline-offset: -3px; }
@media (hover: hover) and (pointer: fine) {
    .product-card:has(.service-card-link):hover { background: var(--ink); }
    .product-card:has(.service-card-link):hover h2 { color: var(--paper); }
    .product-card:has(.service-card-link):hover .product-desc { color: var(--ash); }
    .product-card:has(.service-card-link):hover .btn-secondary { background: var(--paper); color: var(--ink); border-color: var(--paper); }
}
@media (prefers-reduced-motion: reduce) { .product-card:has(.service-card-link), .product-card:has(.service-card-link) * { transition: none; } }
/* Відступ між плитками-картками й описом на сторінках-розділах послуг */
.products-grid + .service-page { margin-top: 36px; }

/* Попередження про ціни над списком товарів (products/catalog-crm.js) */
.price-note {
    display: flex; align-items: flex-start; gap: 10px;
    margin: 0 0 16px; padding: 12px 16px;
    background: var(--fog); border-left: 4px solid var(--ink);
    font-size: 13px; font-weight: 600; line-height: 1.5; color: var(--ink);
}
.price-note i { flex: 0 0 auto; margin-top: 2px; font-size: 14px; }

/* SEO-текст внизу сторінок категорій (tools/build-seo-texts.js) */
.seo-text {
    display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; align-items: start;
    margin-top: 56px; padding-top: 40px; border-top: 2px solid var(--ink);
}
.seo-text-body { max-width: 900px; }
.seo-text:has(.seo-text-img) { grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); }
.seo-text:has(.seo-text-img) .seo-text-body { max-width: none; }
.seo-text h2 { margin: 0 0 20px; font-size: clamp(24px, 3vw, 34px); font-weight: 800; line-height: 1.15; letter-spacing: -.01em; color: var(--ink); }
.seo-text h3 { margin: 26px 0 10px; font-size: 14px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); }
.seo-text p, .seo-text li { font-size: 15px; line-height: 1.75; color: #2b2b2b; }
.seo-text p { margin: 0 0 14px; }
.seo-text ul { margin: 0 0 14px; padding-left: 20px; }
.seo-text li { margin-bottom: 6px; }
.seo-text-img { position: relative; margin: 0; padding: 0 14px 14px 0; }
.seo-text-img::after { content: ""; position: absolute; top: 14px; right: 0; bottom: 0; left: 14px; border-right: 6px solid var(--ink); border-bottom: 6px solid var(--ink); pointer-events: none; }
.seo-text-img img { position: relative; z-index: 1; display: block; width: 100%; height: auto; background: var(--paper); border: 1px solid var(--ash); }
@media (max-width: 900px) {
    .seo-text { grid-template-columns: 1fr; gap: 28px; margin-top: 40px; padding-top: 28px; }
    .seo-text-img { max-width: 480px; }
}

/* ===== Сторінки послуг (tools/build-service-pages.js): плитки, кроки, FAQ ===== */
.service-page.svc { max-width: none; }
.svc-hero-act { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 6px; }
.svc-btn, .svc-btn-ghost {
    display: inline-flex; align-items: center; gap: 8px; padding: 14px 26px;
    font: 700 13px var(--font); letter-spacing: .08em; text-transform: uppercase; text-decoration: none; cursor: pointer;
    border: 2px solid var(--ink); border-radius: 0; transition: background .2s, color .2s;
}
.svc-btn { background: var(--ink); color: var(--paper); }
.svc-btn:hover, .svc-btn:focus-visible { background: var(--paper); color: var(--ink); }
/* «Зателефонувати»: чорна заливка виїжджає зліва, слухавка «дзвонить» (у спокої — зрідка, при наведенні — постійно) */
.svc-btn-ghost, .catalog-section a.svc-btn-ghost { position: relative; overflow: hidden; isolation: isolate; background: var(--paper); color: var(--ink); transition: color .3s var(--ease), transform .16s var(--ease); }
.svc-btn-ghost::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--ink); transform: translateX(-101%); transition: transform .35s var(--ease); }
.svc-btn-ghost:hover, .svc-btn-ghost:focus-visible, .catalog-section a.svc-btn-ghost:hover, .catalog-section a.svc-btn-ghost:focus-visible { color: var(--paper); }
.svc-btn-ghost:hover::before, .svc-btn-ghost:focus-visible::before { transform: none; }
.svc-btn-ghost:active { transform: scale(.97); }
.svc-ring { transform-origin: 50% 50%; animation: svcRing 4.2s ease-in-out 1.5s infinite; }
.svc-btn-ghost:hover .svc-ring, .svc-btn-ghost:focus-visible .svc-ring { animation: svcRingHover .8s ease-in-out infinite; }
@keyframes svcRing { 0%, 58%, 100% { transform: rotate(0); } 62% { transform: rotate(-18deg); } 68% { transform: rotate(16deg); } 74% { transform: rotate(-13deg); } 80% { transform: rotate(9deg); } 86% { transform: rotate(-4deg); } 92% { transform: rotate(0); } }
@keyframes svcRingHover { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-18deg); } 40% { transform: rotate(16deg); } 60% { transform: rotate(-11deg); } 80% { transform: rotate(7deg); } }
@media (prefers-reduced-motion: reduce) {
    .svc-btn-ghost, .svc-btn-ghost::before, .svc-ring { transition: none; animation: none !important; }
}
/* «Докладніше про послугу ↓»: легке посилання під вступом, веде до SEO-тексту внизу сторінки */
.svc-more, .catalog-section a.svc-more {
    display: inline-flex; align-items: center; gap: 8px; margin-top: 2px; padding: 4px 0;
    font: 700 13px var(--font); letter-spacing: .08em; text-transform: uppercase; text-decoration: none; color: var(--ink);
    background: linear-gradient(var(--ink), var(--ink)) 0 calc(100% - 1px) / 0 2px no-repeat;
    transition: background-size .3s var(--ease);
}
.service-lead:has(+ .svc-more), .catalog-header p:has(+ .svc-more) { margin-bottom: 4px; }   /* посилання «тримається» за вступом, а не за кнопками/картками */
.svc-more + .svc-hero-act { margin-top: 20px; }
.svc-more i { transition: transform .25s var(--ease); }
.svc-more:hover, .svc-more:focus-visible { background-size: 100% 2px; }
.svc-more:hover i, .svc-more:focus-visible i { transform: translateY(3px); }
.svc-more:focus-visible { outline: 3px solid var(--steel); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) { html:has(.svc-more) { scroll-behavior: smooth; } }
@media (prefers-reduced-motion: reduce) { .svc-more, .svc-more i { transition: none; } }
.seo-text { scroll-margin-top: 16px; }
.svc-sec { margin-top: 44px; }
.svc-sec > h2 { margin: 0 0 18px; padding-bottom: 12px; border-bottom: 2px solid var(--ink); font-size: 18px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; color: var(--ink); }
.svc .service-cta { margin-top: 44px; }

.svc-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); border-left: 1px solid var(--ash); border-top: 1px solid var(--ash); }
.svc-card { display: flex; flex-direction: column; gap: 10px; padding: 22px 20px; background: var(--paper); border-right: 1px solid var(--ash); border-bottom: 1px solid var(--ash); transition: background .2s var(--ease), color .2s var(--ease); }
.svc-card i { font-size: 22px; color: var(--ink); transition: color .2s var(--ease); }
.svc-card strong { font-size: 15px; font-weight: 800; color: var(--ink); transition: color .2s var(--ease); }
.svc-card span { font-size: 14px; line-height: 1.5; font-weight: 600; color: var(--ink); transition: color .2s var(--ease); }
.svc-adv .svc-card span { font-weight: 500; color: var(--graphite); }
@media (hover: hover) {
    .svc-card:hover { background: var(--ink); }
    .svc-card:hover i, .svc-card:hover strong { color: var(--paper); }
    .svc-card:hover span, .svc-adv .svc-card:hover span { color: var(--ash); }
}

.svc-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.svc-steps li { position: relative; display: flex; flex-direction: column; gap: 6px; padding-top: 54px; }
.svc-steps li b { position: absolute; top: 0; left: 0; z-index: 1; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; background: var(--ink); color: var(--paper); font: 800 15px var(--font); }
.svc-steps strong { font-size: 15px; font-weight: 800; color: var(--ink); }
.svc-steps span { font-size: 14px; line-height: 1.55; color: var(--graphite); }

.svc-two { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 44px; }
.svc-two .svc-sec { margin-top: 0; }
.svc-check, .svc-dots { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.svc-check li, .svc-dots li { position: relative; padding-left: 30px; font-size: 14.5px; line-height: 1.5; color: var(--ink); }
.svc-check li::before { content: "\f00c"; position: absolute; left: 0; top: 1px; font: 900 13px "Font Awesome 6 Free"; color: var(--ink); }
.svc-dots li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 8px; height: 8px; background: var(--ink); }
.svc-note { margin: 16px 0 0; font-size: 13px; line-height: 1.5; color: var(--graphite); }

.svc-faq { border-top: 1px solid var(--ash); }
.svc-faq details { border-bottom: 1px solid var(--ash); }
.svc-faq summary { position: relative; padding: 18px 44px 18px 0; list-style: none; cursor: pointer; font-size: 15px; font-weight: 700; color: var(--ink); }
.svc-faq summary::-webkit-details-marker { display: none; }
.svc-faq summary::after { content: "+"; position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font: 400 26px/1 var(--font); }
.svc-faq details[open] summary::after { content: "\2212"; }
.svc-faq summary:focus-visible { outline: 3px solid var(--steel); outline-offset: 2px; }
.svc-faq p { margin: 0 0 18px; max-width: 780px; font-size: 14.5px; line-height: 1.7; color: #2b2b2b; }

.svc-related { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.svc-related a { position: relative; display: grid; gap: 4px; padding: 20px 46px 20px 20px; border: 2px solid var(--ink); text-decoration: none; color: var(--ink); transition: background .2s var(--ease), color .2s var(--ease); }
.svc-related strong { font-size: 15px; font-weight: 800; }
.svc-related span { font-size: 13px; line-height: 1.45; color: var(--graphite); transition: color .2s var(--ease); }
.svc-related a i { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); }
.svc-related a:hover, .svc-related a:focus-visible { background: var(--ink); color: var(--paper); }
.svc-related a:hover span, .svc-related a:focus-visible span { color: var(--ash); }

@media (max-width: 900px) {
    .svc-steps { grid-template-columns: 1fr; gap: 22px; }
    .svc-steps li { padding: 0 0 0 56px; min-height: 40px; }
    .svc-two { grid-template-columns: 1fr; gap: 0; }
    .svc-two .svc-sec + .svc-sec { margin-top: 36px; }
}

/* ---------- Блоки під каталогом: заклик, «Наші переваги», інші розділи (tools/build-catalog-extras.js) ---------- */
.cx-cta { padding: 56px 0; }
.cx-cta p { max-width: 520px; }
.cx-adv, .cx-more { padding: 72px 0 0; }
.cx-more { padding-bottom: 88px; }
.cx-title {
    margin: 0 0 32px; padding-bottom: 18px; border-bottom: var(--line);
    font-size: clamp(24px, 3vw, 34px); font-weight: 800; line-height: 1.1; text-transform: uppercase; color: var(--ink);
}
.cx-adv-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 32px; }
.cx-adv-ico {
    display: flex; align-items: center; justify-content: center;
    width: 52px; height: 52px; margin-bottom: 18px;
    background: var(--ink); color: var(--paper); font-size: 26px;
}
/* Іконка із значком у куті (документ + розетка): складається з двох безкоштовних іконок Font Awesome */
.cx-ico-stack { position: relative; display: block; width: 1em; height: 1em; font-size: 1.18em; margin-left: -.12em; }
.cx-ico-stack > i { position: absolute; left: 0; top: 0; line-height: 1; }
.cx-ico-badge {
    position: absolute; right: -.3em; bottom: -.25em; width: .72em; height: .72em;
    display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--ink);
}
.cx-ico-badge i { position: static; font-size: .5em; line-height: 1; }
.cx-ico-svg { display: block; width: 1.25em; height: 1.25em; }
.cx-adv-item h3 { margin: 0 0 8px; font-size: 15px; font-weight: 800; letter-spacing: .03em; line-height: 1.25; text-transform: uppercase; color: var(--ink); }
.cx-adv-item p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--graphite); }
.cx-more .activity-grid.is-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cx-more .activity-card { min-height: 280px; }
.cx-more .activity-img img { height: 160px; }
.cx-card-tag { margin-bottom: 6px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--steel); }

@media (max-width: 900px) {
    .cx-adv, .cx-more { padding-top: 56px; }
    .cx-more { padding-bottom: 64px; }
    .cx-adv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 24px; }
}
@media (max-width: 720px) {
    .cx-more .activity-grid.is-three { grid-template-columns: minmax(0, 1fr); }
    .cx-more .activity-card { min-height: 240px; }
}
@media (max-width: 560px) {
    .cx-cta { padding: 44px 0; }
    .cx-cta .btn { width: 100%; justify-content: center; }
    .cx-adv-grid { grid-template-columns: minmax(0, 1fr); gap: 30px; }
}