/* Мраморные решения — базовые стили.
   Палитра и типографика сверены напрямую с gazobeton.spb.ru через инспектор
   (не на глаз): акцент #1976D2, бейдж "Хит" #2992D9, "Скидка"/успех #4FAD00,
   текст #383838/#555555, шрифт Open Sans -> Helvetica Neue -> Arial.
   Сайт light-only по брифу (без тёмных "премиальных" блоков) — тёмной темы
   нет намеренно. */

:root {
    --color-bg: #F2F3F5;
    --color-bg-muted: #F4F5F6;
    --color-accent: #1976D2;
    --color-accent-dark: #145A9E;
    --color-accent-badge: #2992D9;
    --color-topbar: #495057;
    --color-gray-dark: #495057;
    --color-yellow: #FFC107;
    --color-yellow-hover: #E0A800;
    --color-yellow-ink: #212529;
    --color-text: #383838;
    --color-text-body: #555555;
    --color-text-muted: #7A8088;
    --color-border: #E3E5E8;
    --color-danger: #D64545;
    --color-success: #4FAD00;
    --color-warning: #C97A17;
    --color-savings-bg: #FFF3D6;
    --color-savings-text: #8A5A00;
    --color-graphite: #1F2933;
    --color-graphite-dark: #161D24;
    --radius: 3px;
    --radius-badge: 2px;
    --radius-lg: 16px;
    --container-width: 1440px;
    --shadow-md: 0 10px 24px rgba(22, 29, 36, .10);
    --shadow-lg: 0 18px 44px rgba(22, 29, 36, .16);

    /* Desktop density tokens — на mobile/tablet равны исходным значениям,
       компактная версия подключается ниже через @media (min-width: 1200px). */
    --container-pad: 28px;
    --space-section: 40px;
    --space-section-head: 16px;
    --font-h1: 28px;
    --font-h1-hero: 30px;
    --font-h2: 22px;
    --font-h3: 17px;
    --header-pad-y: 16px;
    --logo-size: 48px;
}

/* Компактная desktop-плотность: при 100% масштабе браузера сайт визуально
   соответствует текущему виду при ~90% зуме. Мобильные/планшетные размеры
   (< 1200px) не затрагиваются — компактные токены переопределяются только здесь. */
@media (min-width: 1200px) {
    :root {
        --container-pad: 24px;
        --space-section: 34px;
        --space-section-head: 14px;
        --font-h1: 25px;
        --font-h1-hero: 27px;
        --font-h2: 20px;
        --font-h3: 16px;
        --font-h2-block: 18px;
        --header-pad-y: 13px;
        --logo-size: 42px;
        --topbar-pad-y: 7px;
        --search-pad-y: 9px;
        --icon-size: 18px;
        --quick-menu-pad-y: 10px;
        --quick-menu-pad-x: 14px;
        --quick-menu-font: 13px;
        --mega-pad: 20px;
        --mega-item-pad-y: 9px;
        --hero-min-h: 300px;
        --hero-pad: 32px;
        --cat-card-img-h: 108px;
        --card-pad-sm: 13px;
        --prod-card-img-h: 144px;
        --card-pad-md: 16px;
        --card-pad-lg: 18px;
        --card-pad-top: 14px;
        --font-card-title-xl: 17px;
        --font-card-title-lg: 16px;
        --tool-card-img-h: 160px;
        --article-img-h: 128px;
        --footer-margin-t: 48px;
        --footer-pad-y: 32px;
        --footer-gap: 20px;
        --service-cta-min-h: 116px;
        --service-cta-icon-size: 46px;
        --service-cta-pad-y: 20px;
        --service-cta-text-pad-y: 18px;
        --block-pad-y: 20px;
        --block-pad-x: 26px;
        --font-price: 16px;
    }
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    color: var(--color-text-body);
    background: var(--color-bg);
    line-height: 1.5;
    font-size: 14px;
}

a { color: var(--color-text); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--container-pad);
}
@media (max-width: 1280px) {
    .container { padding: 0 20px; }
}

nav ul, .sidebar-menu, .footer-grid ul, .product-badges, .main-nav-list, .submenu { list-style: none; margin: 0; padding: 0; }

.page-content ul, .page-content ol { padding-left: 22px; margin: 0 0 16px; }
.page-content li { margin-bottom: 6px; line-height: 1.55; }

h1, h2, h3, h4 { margin: 0 0 12px; line-height: 1.25; }
h1 { font-size: var(--font-h1); }
h2 { font-size: var(--font-h2); }
h3 { font-size: var(--font-h3); }
p { margin: 0 0 12px; }

/* -------------------- Buttons -------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    background: var(--color-accent);
    color: #fff;
    transition: background .15s ease;
}
.btn:hover { background: var(--color-accent-dark); text-decoration: none; color: #fff; }
.btn-outline {
    background: transparent;
    color: var(--color-text);
    border-color: var(--color-text);
}
.btn-outline:hover { background: var(--color-text); color: #fff; }
.btn-ghost {
    background: var(--color-yellow);
    color: var(--color-yellow-ink);
    border-color: transparent;
    font-weight: 700;
}
.btn-ghost:hover { background: var(--color-yellow-hover); color: var(--color-yellow-ink); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* -------------------- Top bar (уровень 1) -------------------- */
.topbar {
    background: var(--color-graphite);
    color: #fff;
    font-size: 13px;
}
.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: var(--topbar-pad-y, 8px);
    padding-bottom: var(--topbar-pad-y, 8px);
    flex-wrap: wrap;
    gap: 8px;
}
.topbar-zone { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.topbar-center { color: rgba(255,255,255,.78); }
.topbar-sep { color: rgba(255,255,255,.4); }
.topbar a { color: #fff; text-decoration: none; }
.topbar a:hover { text-decoration: underline; }
.topbar-phone { font-weight: 700; }
@media (max-width: 860px) { .topbar-center { display: none; } }

/* -------------------- Header -------------------- */
.site-header { position: relative; border-bottom: 1px solid var(--color-border); background: #fff; }
.header-main {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: var(--header-pad-y) 0;
    flex-wrap: wrap;
}
.logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
.logo-mark { height: var(--logo-size); width: var(--logo-size); display: block; }
/* Слово "Nordex" уже нарисовано внутри логотипа — дублирующий текст скрыт визуально,
   но остаётся для доступности/скринридеров и SEO. */
.logo-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.logo:hover { text-decoration: none; }

.catalog-trigger { flex: 0 0 auto; white-space: nowrap; }
.catalog-trigger .icon-glyph { font-size: 15px; }

.header-search { flex: 1 1 320px; min-width: 200px; }
.header-search form { display: flex; }
.header-search input[type="search"] {
    flex: 1;
    border: 1px solid var(--color-border);
    background: var(--color-bg-muted);
    border-radius: var(--radius) 0 0 var(--radius);
    padding: var(--search-pad-y, 10px) 14px;
    font-size: 14px;
}
.header-search button {
    border-radius: 0 var(--radius) var(--radius) 0;
    background: var(--color-yellow);
    color: var(--color-yellow-ink);
    font-weight: 700;
}
.header-search button:hover { background: var(--color-yellow-hover); color: var(--color-yellow-ink); }

.header-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.icon-link {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    font-size: 11px;
    color: var(--color-text);
    gap: 2px;
    min-width: 44px;
}
.icon-link:hover { color: var(--color-text); text-decoration: none; }
.icon-link .icon-glyph { font-size: var(--icon-size, 20px); line-height: 1; }
.icon-badge {
    position: absolute;
    top: -6px;
    right: 6px;
    background: var(--color-yellow);
    color: var(--color-yellow-ink);
    border-radius: 999px;
    font-size: 10px;
    min-width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}
/* -------------------- Quick menu (уровень 3) -------------------- */
.quick-menu { background: var(--color-bg-muted); border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); }
.quick-menu-list { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.quick-menu-list > li > a {
    display: block;
    padding: var(--quick-menu-pad-y, 12px) var(--quick-menu-pad-x, 16px);
    color: var(--color-text);
    font-size: var(--quick-menu-font, 14px);
    font-weight: 600;
}
.quick-menu-list > li > a:hover,
.quick-menu-list > li.active > a {
    color: var(--color-text);
    text-decoration: none;
    box-shadow: inset 0 -2px 0 var(--color-yellow);
}

/* -------------------- Mega menu -------------------- */
.mega-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 60;
    display: flex;
    justify-content: center;
    pointer-events: none;
}
.mega-menu[hidden] { display: none; }
.mega-menu-backdrop { display: none; }
.mega-menu-mobile-head { display: none; }
.mega-menu-inner {
    pointer-events: auto;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--mega-pad, 24px);
    margin-top: -1px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: var(--mega-pad, 24px);
    max-height: min(70vh, 640px);
    overflow-y: auto;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity .18s ease, transform .18s ease;
}
.mega-menu.is-open { pointer-events: auto; }
.mega-menu.is-open .mega-menu-inner { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
    .mega-menu-inner { transition: none; }
}

.mega-menu-categories { display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--color-border); padding-right: 16px; }
.mega-menu-cat-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    padding: var(--mega-item-pad-y, 10px) 12px;
    border: none;
    background: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    cursor: pointer;
}
.mega-menu-cat-btn:hover { background: var(--color-bg-muted); }
.mega-menu-cat-btn.is-active {
    background: var(--color-savings-bg);
    color: var(--color-text);
    box-shadow: inset 3px 0 0 var(--color-yellow);
}
.mega-cat-icon { font-size: 18px; line-height: 1; }
.mega-cat-name { flex: 1; }
.mega-cat-arrow { color: var(--color-text-muted); }

.mega-menu-panel { display: none; grid-column: 2; grid-row: 1; gap: 24px; grid-template-columns: 1fr 260px; }
.mega-menu-panel.is-active { display: grid; }
.mega-menu-subcats { display: flex; gap: 24px; flex-wrap: wrap; }
.mega-menu-subcol { list-style: none; margin: 0; padding: 0; min-width: 160px; flex: 1; }
.mega-menu-subcol li { margin-bottom: 4px; }
.mega-menu-subcol a { display: block; padding: 6px 4px; font-size: 14px; color: var(--color-text); border-radius: var(--radius); }
.mega-menu-subcol a:hover { background: var(--color-bg-muted); text-decoration: none; }

.mega-menu-promo { display: flex; flex-direction: column; gap: 10px; }
.mega-promo-card {
    background: var(--color-graphite);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 18px;
}
.mega-promo-title { font-weight: 700; margin-bottom: 6px; }
.mega-promo-card p { color: rgba(255,255,255,.8); font-size: 13px; margin: 0 0 12px; }
.mega-promo-link { font-size: 13px; font-weight: 600; color: var(--color-text); }

.mega-menu-bottom {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    border-top: 1px solid var(--color-border);
    margin-top: 4px;
    padding-top: 16px;
    font-size: 13px;
    font-weight: 600;
}

/* -------------------- Breadcrumbs -------------------- */
.breadcrumbs { font-size: 13px; color: var(--color-text-muted); margin: 16px 0; }
.breadcrumbs a { color: var(--color-text-muted); }
.breadcrumbs .sep { margin: 0 6px; }

/* -------------------- Home page blocks -------------------- */
.section { margin: var(--space-section) 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: var(--space-section-head); gap: 12px; flex-wrap: wrap; }
.section-head a { font-size: 14px; font-weight: 600; white-space: nowrap; }

/* Hero */
.hero {
    display: grid;
    grid-template-columns: minmax(320px, 460px) 1fr;
    gap: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin: 24px 0;
    min-height: var(--hero-min-h, 340px);
}
.hero-copy {
    background: linear-gradient(135deg, var(--color-graphite), var(--color-graphite-dark));
    color: #fff;
    padding: var(--hero-pad, 40px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
}
.hero-copy h1 { color: #fff; font-size: var(--font-h1-hero); margin: 0; }
.hero-copy > p { color: rgba(255,255,255,.82); margin: 0; max-width: 440px; }
.hero-cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-cta-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.hero-cta-outline:hover { background: rgba(255,255,255,.12); color: #fff; }
.hero-perks { list-style: none; margin: 8px 0 0; padding: 0; display: flex; gap: 20px; flex-wrap: wrap; }
.hero-perks li { font-size: 13px; color: rgba(255,255,255,.85); display: flex; align-items: center; gap: 6px; }
.hero-photo {
    background: var(--color-bg-muted);
    overflow: hidden;
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 900px) {
    .hero { grid-template-columns: 1fr; }
    .hero-photo { min-height: 180px; }
}

/* Категории (плоский список — используется на catalog/index.php, catalog/category.php, calculator/index.php) */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}
.category-tile {
    background: var(--color-bg-muted);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 20px 12px;
    text-align: center;
    color: var(--color-text);
    font-size: 14px;
    font-weight: 600;
}
.category-tile:hover { border-color: var(--color-text); color: var(--color-text); text-decoration: none; }
.category-tile .tile-icon { font-size: 30px; margin-bottom: 10px; }
.category-tile.is-stub { opacity: .55; }

/* Карточки подкатегорий с фото (страница category.php, разделы-концентраторы) */
.subcategory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
}
@media (max-width: 1199px) { .subcategory-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 767px) { .subcategory-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; } }
@media (max-width: 480px) { .subcategory-grid { grid-template-columns: 1fr; } }

.subcategory-card {
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .04);
    transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}
.subcategory-card:hover {
    transform: translateY(-3px);
    border-color: #C7CBD1;
    box-shadow: var(--shadow-md);
}
.subcategory-card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none;
}
.subcategory-card__link:hover { text-decoration: none; color: inherit; }
.subcategory-card__link:focus-visible {
    outline: 2px solid var(--color-text);
    outline-offset: -2px;
}
.subcategory-card__media {
    aspect-ratio: 2.33 / 1;
    overflow: hidden;
    background: var(--color-bg-muted);
}
/* Портретные исходники (например, фото мешков смесей) не обрезаем — показываем целиком в более высоком блоке. */
.subcategory-card--portrait .subcategory-card__media { aspect-ratio: 3 / 4; }
.subcategory-card__media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    transition: transform 220ms ease;
}
.subcategory-card:hover .subcategory-card__media img { transform: scale(1.03); }
.subcategory-card__body {
    padding: var(--card-pad-md, 18px);
    display: flex;
    flex-direction: column;
    flex: 1;
}
.subcategory-card__title {
    font-size: var(--font-card-title-xl, 19px);
    font-weight: 700;
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.subcategory-card__description {
    font-size: 14px;
    color: var(--color-text-muted);
    margin: 0 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.subcategory-card__cta {
    margin-top: auto;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-warning);
    transition: transform 200ms ease;
    display: inline-block;
}
.subcategory-card:hover .subcategory-card__cta { transform: translateX(3px); }

.subcategory-card--plain .subcategory-card__body { justify-content: center; text-align: center; background: var(--color-bg-muted); min-height: 120px; }
.subcategory-card--plain .subcategory-card__title { font-size: 16px; }

/* Категории на главной (карточки с фото) */
.category-grid-v2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.category-card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    color: var(--color-text);
    display: flex;
    flex-direction: column;
    transition: transform .15s ease, box-shadow .15s ease;
}
.category-card:hover { text-decoration: none; color: var(--color-text); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.category-card-photo {
    height: var(--cat-card-img-h, 120px);
    background: var(--color-bg-muted);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.category-card-photo img { width: 100%; height: 100%; object-fit: cover; }
.category-card-icon { font-size: 36px; }
.category-card-body { padding: var(--card-pad-sm, 14px); display: flex; flex-direction: column; gap: 4px; }
.category-card-name { font-weight: 700; font-size: 15px; }
.category-card-caption { font-size: 12px; }
.category-card-link { font-size: 13px; font-weight: 600; margin-top: 6px; display: inline-flex; align-items: center; gap: 4px; }
.category-card-arrow { color: var(--color-yellow-ink); transition: transform .15s ease; }
.category-card:hover .category-card-arrow { transform: translateX(3px); color: var(--color-warning); }

/* Сервисный блок */
.service-cta-block {
    background: var(--color-graphite);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 0;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    overflow: hidden;
    min-height: var(--service-cta-min-h, 128px);
}
.service-cta-icon {
    flex: 0 0 auto;
    width: var(--service-cta-icon-size, 52px); height: var(--service-cta-icon-size, 52px);
    margin: var(--service-cta-pad-y, 24px) 0 var(--service-cta-pad-y, 24px) 28px;
    border-radius: var(--radius);
    background: var(--color-yellow);
    color: var(--color-yellow-ink);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
}
.service-cta-text { flex: 1 1 320px; display: flex; flex-direction: column; justify-content: center; padding: var(--service-cta-text-pad-y, 20px) 0; min-width: 0; }
.service-cta-block h2 { color: #fff; margin-bottom: 6px; font-size: var(--font-h2-block, 20px); }
.service-cta-block p { color: rgba(255,255,255,.8); margin: 0; max-width: 480px; font-size: 14px; }
.service-cta-block .btn { flex: 0 0 auto; align-self: center; margin-right: 24px; }
.service-cta-photo { flex: 0 0 260px; background-size: cover; background-position: center; position: relative; }
.service-cta-photo::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--color-graphite), rgba(31,41,51,0)); }
@media (max-width: 860px) { .service-cta-photo { display: none; } }

/* Инструменты / калькуляторы */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; align-items: stretch; }
.tool-card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .04);
    transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}
.tool-card:hover {
    transform: translateY(-3px);
    border-color: #C7CBD1;
    box-shadow: var(--shadow-md);
}
.tool-card-photo { height: var(--tool-card-img-h, 180px); background: var(--color-bg-muted); display: flex; align-items: center; justify-content: center; }
.tool-card-photo img { width: 100%; height: 100%; object-fit: contain; padding: 10px; transition: transform 220ms ease; }
.tool-card:hover .tool-card-photo img { transform: scale(1.03); }
.tool-card-body { padding: var(--card-pad-top, 16px) var(--card-pad-lg, 20px) var(--card-pad-lg, 20px); display: flex; flex-direction: column; gap: 6px; flex: 1; }
.tool-card-title { font-weight: 700; font-size: var(--font-card-title-lg, 18px); }
.tool-card p { font-size: 14px; margin: 0 0 10px; flex: 1; }
.tool-card-body .btn:focus-visible { outline: 2px solid var(--color-text); outline-offset: 2px; }

/* B2B блок */
.b2b-block {
    background: var(--color-graphite);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: var(--block-pad-y, 24px) var(--block-pad-x, 32px);
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}
.b2b-block h2 { color: #fff; margin: 0; flex: 0 0 auto; font-size: var(--font-h2-block, 20px); }
.b2b-perks { list-style: none; margin: 0; padding: 0; display: flex; gap: 24px; flex-wrap: wrap; flex: 1; }
.b2b-perks li { font-size: 13px; color: rgba(255,255,255,.9); display: flex; align-items: center; gap: 8px; }
.b2b-perks li span { font-size: 16px; }
.b2b-cta { background: transparent; color: #fff; border-color: var(--color-yellow); flex: 0 0 auto; }
.b2b-cta:hover { background: rgba(255,255,255,.12); color: #fff; }

/* Бренды */
.partners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}
.partner-tile {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 22px 10px;
    text-align: center;
    font-weight: 700;
    color: var(--color-text-muted);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 72px;
}

/* Статьи */
.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.article-card { border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; background: #fff; transition: box-shadow .15s ease; }
.article-card:hover { box-shadow: var(--shadow-md); }
.article-card .article-photo { height: var(--article-img-h, 140px); background: var(--color-bg-muted); display: flex; align-items: center; justify-content: center; color: var(--color-text-muted); font-size: 13px; }
.article-card .article-body { padding: var(--card-pad-sm, 14px); }
.article-card h3 { font-size: 15px; margin-bottom: 6px; }
.article-card p { font-size: 13px; color: var(--color-text-muted); margin: 0 0 8px; }
.article-read-link { font-size: 13px; font-weight: 600; color: var(--color-text); }

/* -------------------- Catalog -------------------- */
.catalog-layout { display: grid; grid-template-columns: 240px 1fr; gap: 28px; align-items: start; }
@media (max-width: 860px) { .catalog-layout { grid-template-columns: 1fr; } }

.filters-box {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 16px;
    background: #fff;
}
.filters-box h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .03em; color: var(--color-text-muted); }
.filter-group { margin-bottom: 18px; }
.filter-group label { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 6px; cursor: pointer; }

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 18px;
}
.product-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: #fff;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}
.product-photo-wrap { position: relative; }
.product-card .product-photo {
    height: var(--prod-card-img-h, 160px);
    background: var(--color-bg-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font-size: 13px;
    position: relative;
    overflow: hidden;
}
.fav-form { position: absolute; top: 10px; right: 10px; z-index: 2; margin: 0; }
.fav-btn {
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.9);
    border: none; border-radius: 999px;
    font-size: 17px; line-height: 1;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: color .15s ease, transform .1s ease;
}
.fav-btn:hover { color: #E0364A; transform: scale(1.08); }
.fav-btn.is-active { color: #E0364A; }
.fav-form-lg .fav-btn { width: 40px; height: 40px; font-size: 22px; }
.product-card .product-photo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.product-badges { position: absolute; top: 10px; left: 10px; display: flex; flex-direction: column; gap: 4px; }
.badge { font-size: 10px; font-weight: 700; letter-spacing: .02em; padding: 5px 9px 4px; border-radius: var(--radius-badge); color: #fff; text-transform: uppercase; }
.badge-hit { background: var(--color-gray-dark); }
.badge-sale { background: var(--color-yellow); color: var(--color-yellow-ink); }
.stock-label { font-size: 12px; }
.stock-many { color: var(--color-success); }
.stock-many::before { content: "\2713 "; }
.stock-few { color: var(--color-warning); }
.stock-out { color: var(--color-text-muted); }

.savings-chip { display: inline-block; background: var(--color-savings-bg); color: var(--color-savings-text); font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: var(--radius-badge); margin-top: 6px; }

.star-rating { display: inline-flex; gap: 1px; font-size: 13px; color: var(--color-border); letter-spacing: 1px; }
.star-rating .filled { color: #F5A623; }

.spec-row { display: flex; align-items: baseline; gap: 6px; padding: 6px 0; font-size: 14px; }
.spec-row .spec-label { color: var(--color-text-muted); white-space: nowrap; }
.spec-row .spec-dots { flex: 1; border-bottom: 1px dotted var(--color-border); height: 0; margin-bottom: 4px; }
.spec-row .spec-value { font-weight: 600; color: var(--color-text); white-space: nowrap; }

.product-card .product-body { padding: var(--card-pad-sm, 14px); display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-card .product-name { font-size: 14px; font-weight: 600; color: var(--color-text); min-height: 40px; }
.product-card .product-name:hover { color: var(--color-text); }
.product-card .product-meta { font-size: 12px; color: var(--color-text-muted); }
.product-card .product-price { font-size: var(--font-price, 18px); font-weight: 800; }
.product-card .product-price .old-price { font-size: 13px; font-weight: 400; color: var(--color-text-muted); text-decoration: line-through; margin-left: 6px; }
.product-card .product-actions { margin-top: auto; display: flex; gap: 8px; }
.product-actions-with-qty { flex-direction: column; align-items: stretch; }
.card-add-form { display: flex; gap: 6px; }
.card-add-form .btn { flex: 1; }
.qty-input-sm { flex: 0 0 auto; }
.qty-input-sm button { width: 26px; height: 32px; font-size: 14px; }
.qty-input-sm input { width: 46px; height: 32px; font-size: 13px; }

.product-detail { display: grid; grid-template-columns: 380px 1fr; gap: 32px; }
@media (max-width: 760px) { .product-detail { grid-template-columns: 1fr; } }
.product-detail .product-photo-lg {
    position: relative;
    height: 320px;
    background: var(--color-bg-muted);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    color: var(--color-text-muted);
    overflow: hidden;
}
.product-detail .product-photo-lg.has-zoom { cursor: zoom-in; }
.product-detail .product-photo-lg img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.product-detail .product-photo-lg img.product-photo-zoom {
    position: absolute;
    top: 0;
    left: 0;
    width: auto;
    height: auto;
    max-width: none;
    object-fit: none;
    display: none;
    pointer-events: none;
}
.spec-table { margin: 16px 0; }

.tabs-block { margin-top: 40px; }
.tabs-nav { display: flex; gap: 4px; border-bottom: 1px solid var(--color-border); }
.tabs-nav .tab-btn { background: none; border: none; cursor: pointer; font-family: inherit; font-size: 15px; font-weight: 600; color: var(--color-text-muted); padding: 12px 18px; margin-bottom: -1px; border-bottom: 2px solid transparent; }
.tabs-nav .tab-btn:hover { color: var(--color-text); }
.tabs-nav .tab-btn.is-active { color: var(--color-text); border-bottom-color: var(--color-text); }
.tab-panel { padding: 20px 0; }
.tab-panel[hidden] { display: none; }

.qty-input { display: inline-flex; align-items: center; border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; }
.qty-input button { background: var(--color-bg-muted); border: none; width: 32px; height: 36px; cursor: pointer; font-size: 16px; }
.qty-input input { width: 60px; border: none; text-align: center; font-size: 14px; }

/* -------------------- Forms -------------------- */
.form-box { max-width: 480px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    background: #fff;
}
.form-group textarea { resize: vertical; min-height: 90px; }
.form-hint { font-size: 12px; color: var(--color-text-muted); margin-top: 4px; }
.form-error { color: var(--color-danger); font-size: 13px; margin-bottom: 12px; }
.checkbox-line { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--color-text-muted); }
.checkbox-line input { margin-top: 3px; }

.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 14px; margin: 16px 0; }
.alert-success { background: #E7F6ED; color: #1E6B3E; border: 1px solid #BEE6CC; }
.alert-error { background: #FCE9E9; color: #A32424; border: 1px solid #F4C2C2; }
.alert-info { background: #EAF1FC; color: var(--color-accent-dark); border: 1px solid #C9DBF5; }

/* -------------------- Cart / checkout -------------------- */
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th { text-align: left; font-size: 12px; color: var(--color-text-muted); text-transform: uppercase; padding: 10px; border-bottom: 1px solid var(--color-border); }
.cart-table td { padding: 12px 10px; border-bottom: 1px solid var(--color-border); font-size: 14px; vertical-align: middle; }
.cart-summary { max-width: 340px; margin-left: auto; border: 1px solid var(--color-border); border-radius: var(--radius); padding: 20px; }
.cart-summary .total-row { display: flex; justify-content: space-between; font-size: 18px; font-weight: 800; margin: 12px 0; }

/* -------------------- Footer -------------------- */
.site-footer { background: #1E2733; color: #C9D1DB; margin-top: var(--footer-margin-t, 60px); padding: var(--footer-pad-y, 40px) 0 20px; font-size: 13px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--footer-gap, 24px); }
.footer-grid h4 { color: #fff; font-size: 14px; margin-bottom: 12px; }
.footer-grid a { color: #C9D1DB; }
.footer-grid li { margin-bottom: 6px; }
.footer-bottom { border-top: 1px solid #33404F; margin-top: 30px; padding-top: 16px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: #8A94A3; }

/* -------------------- Cookie banner -------------------- */
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: #1E2733;
    color: #fff;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
    z-index: 100;
}
.cookie-banner a { color: #9CC1F5; }

/* -------------------- Misc -------------------- */
.muted { color: var(--color-text-muted); }
.text-center { text-align: center; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--color-text-muted); }
.sidebar-menu { border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; }
.sidebar-menu li a { display: block; padding: 10px 14px; font-size: 14px; border-bottom: 1px solid var(--color-border); color: var(--color-text); }
.sidebar-menu li:last-child a { border-bottom: none; }
.sidebar-menu li a:hover, .sidebar-menu li.active a { background: var(--color-bg-muted); color: var(--color-text); text-decoration: none; }

@media (max-width: 600px) {
    .header-main { flex-direction: column; align-items: stretch; }
    .header-actions { justify-content: space-between; }
    .product-detail { gap: 20px; }
}

/* На mobile тот же mega-menu превращается в полноэкранную шторку с drill-down:
   список категорий -> тап -> её подкатегории (с кнопкой "Назад"), вместо
   десктопного дропдауна с двумя колонками. */
@media (max-width: 767px) {
    body.catalog-menu-lock-scroll { overflow: hidden; }

    .mega-menu {
        display: block;
        position: fixed;
        inset: 0;
        justify-content: unset;
    }
    .mega-menu-backdrop {
        display: block;
        position: absolute;
        inset: 0;
        background: rgba(15, 20, 25, .5);
        opacity: 0;
        transition: opacity .2s ease;
    }
    .mega-menu.is-open .mega-menu-backdrop { opacity: 1; }

    .mega-menu-inner {
        position: absolute;
        top: 0; right: 0; bottom: 0;
        width: min(88vw, 380px);
        max-width: none;
        margin: 0;
        padding: 0;
        border: none;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        grid-template-columns: none;
        gap: 0;
        max-height: none;
        height: 100%;
        transform: translateX(100%);
        transition: transform .22s ease;
    }
    .mega-menu.is-open .mega-menu-inner { transform: translateX(0); opacity: 1; }

    .mega-menu-mobile-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex: 0 0 auto;
        padding: 14px 16px;
        border-bottom: 1px solid var(--color-border);
    }
    .mega-menu-mobile-title { font-weight: 700; }
    .mega-menu-back, .mega-menu-close {
        background: none;
        border: none;
        font-size: 15px;
        font-weight: 600;
        color: var(--color-text);
        cursor: pointer;
        padding: 6px;
        min-height: 40px;
        display: none;
        align-items: center;
    }
    .mega-menu-close { display: flex; margin-left: auto; font-size: 20px; }
    .mega-menu.is-panel-open .mega-menu-back { display: flex; }
    .mega-menu.is-panel-open .mega-menu-mobile-title { display: none; }

    .mega-menu-categories {
        display: flex;
        border-right: none;
        padding-right: 0;
        gap: 0;
        overflow-y: auto;
    }
    .mega-menu.is-panel-open .mega-menu-categories { display: none; }
    .mega-menu-cat-btn { border-radius: 0; border-bottom: 1px solid var(--color-border); padding: 14px 16px; min-height: 44px; }
    .mega-menu-cat-btn.is-active { box-shadow: none; }

    .mega-menu-panel {
        grid-column: auto;
        grid-row: auto;
        grid-template-columns: none;
        gap: 0;
        overflow-y: auto;
        padding: 4px 16px 16px;
    }
    /* На mobile панель скрыта, пока не открыт drill-down (переопределяет десктопное .is-active{display:grid}). */
    .mega-menu-panel.is-active { display: none; }
    .mega-menu.is-panel-open .mega-menu-panel.is-active { display: block; }
    .mega-menu-subcats { flex-direction: column; gap: 0; flex-wrap: nowrap; }
    .mega-menu-subcol { min-width: 0; }
    .mega-menu-subcol a { padding: 11px 4px; min-height: 44px; display: flex; align-items: center; }
    .mega-menu-promo { margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--color-border); }

    .mega-menu-bottom {
        flex-direction: column;
        gap: 4px;
        padding: 12px 16px 16px;
    }
    .mega-menu-bottom a { padding: 8px 0; min-height: 40px; display: flex; align-items: center; }
}

/* -------------------- AI-ассистент -------------------- */
.ai-widget { position: fixed; right: 20px; bottom: 20px; z-index: 500; }
.ai-widget-toggle {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--color-graphite); color: #fff;
    border: none; border-radius: 999px;
    padding: 12px 18px; font-size: 14px; font-weight: 700;
    cursor: pointer; box-shadow: var(--shadow-lg);
}
.ai-widget-toggle:hover { background: var(--color-graphite-dark); }
.ai-widget-toggle-icon { font-size: 18px; }
.ai-widget-panel {
    position: absolute; right: 0; bottom: 60px;
    width: 360px; max-width: calc(100vw - 40px);
    max-height: min(600px, calc(100vh - 100px));
    background: #fff; border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); border: 1px solid var(--color-border);
    display: flex; flex-direction: column; overflow: hidden;
}
.ai-widget-panel[hidden] { display: none; }
.ai-widget-header {
    flex: 0 0 auto;
    background: var(--color-graphite); color: #fff;
    padding: 12px 16px; font-weight: 700; font-size: 14px;
    display: flex; align-items: center; justify-content: space-between;
}
.ai-widget-close, .ai-widget-reset { background: none; border: none; color: #fff; font-size: 16px; cursor: pointer; padding: 0; line-height: 1; }
.ai-widget-reset { font-size: 15px; opacity: .85; }
.ai-widget-reset:hover, .ai-widget-close:hover { opacity: 1; }
.ai-widget-messages { flex: 1 1 auto; min-height: 0; padding: 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.ai-msg { font-size: 13px; line-height: 1.5; padding: 8px 12px; border-radius: 10px; max-width: 85%; white-space: pre-wrap; }
.ai-msg-bot { background: var(--color-bg-muted); color: var(--color-text); align-self: flex-start; }
.ai-msg-user { background: var(--color-yellow); color: var(--color-yellow-ink); align-self: flex-end; }
.ai-msg-link { align-self: flex-start; text-decoration: none; }
.ai-widget-chips { flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }
.ai-widget-chips[hidden] { display: none; }
.ai-chip {
    background: var(--color-bg-muted); border: 1px solid var(--color-border); border-radius: 999px;
    padding: 5px 12px; font-size: 12px; color: var(--color-text); cursor: pointer;
}
.ai-chip:hover { border-color: var(--color-text); }
.ai-widget-form { flex: 0 0 auto; display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--color-border); }
.ai-widget-form input { flex: 1; border: 1px solid var(--color-border); border-radius: var(--radius); padding: 8px 10px; font-size: 13px; }

.ai-products { display: flex; flex-direction: column; gap: 8px; }
.ai-product-card {
    display: flex; gap: 10px; align-items: center;
    border: 1px solid var(--color-border); border-radius: var(--radius);
    padding: 8px; background: #fff;
}
.ai-product-photo {
    flex: 0 0 auto; width: 52px; height: 52px; border-radius: var(--radius);
    background: var(--color-bg-muted); display: flex; align-items: center; justify-content: center;
    overflow: hidden; font-size: 10px; color: var(--color-text-muted); text-decoration: none;
}
.ai-product-photo img { width: 100%; height: 100%; object-fit: contain; }
.ai-product-body { flex: 1; min-width: 0; }
.ai-product-name { display: block; font-size: 12px; font-weight: 600; color: var(--color-text); text-decoration: none; line-height: 1.3; }
.ai-product-meta { font-size: 11px; color: var(--color-text-muted); margin-top: 2px; }
.ai-product-price { font-size: 13px; font-weight: 700; margin-top: 2px; }
.ai-product-actions { display: flex; gap: 6px; margin-top: 6px; }
.ai-product-actions .btn, .ai-product-actions .btn-outline { padding: 4px 10px; font-size: 11px; }

@media (max-width: 480px) {
    .ai-widget { right: 12px; bottom: 12px; }
    .ai-widget-panel { width: calc(100vw - 24px); max-height: min(70vh, calc(100vh - 90px)); }
}
