/* ─────────────────────────────────────────────────────────────────────────
   ГЕРЦ · общие стили (v2, ноябрь 2026)
   Светлый tech B2B: графит, холодные серые, сигнальный оранжево-красный
   акцент из логотипа с пульсом. Шрифты – style/fonts.css (Onest, Unbounded,
   JetBrains Mono, самохостинг).
   Старые имена переменных сохранены: их используют стили кабинета.
   ───────────────────────────────────────────────────────────────────────── */

:root {
    /* Палитра */
    --c-bg:           #F4F5F7;   /* фон страницы и серых полос */
    --c-surface:      #FFFFFF;   /* карточки */
    --c-surface-2:    #F8F9FB;
    --c-ink:          #0F1115;   /* основной текст */
    --c-ink-2:        #474E59;   /* второстепенный текст */
    --c-ink-3:        #6F7783;   /* подписи */
    --c-line:         #E6E8EC;   /* тонкие линии */
    --c-line-2:       #D6DAE0;
    --c-graphite:     #0E1014;   /* темные полосы */
    --c-graphite-2:   #16191F;
    --c-graphite-3:   #252A32;
    --c-on-dark:      #F4F5F7;
    --c-on-dark-2:    #A3ABB6;
    --c-accent:       #D63A12;   /* кнопки: белый текст AA */
    --c-accent-hover: #BC300C;
    --c-accent-text:  #C2370F;   /* акцентный текст на белом */
    --c-accent-glow:  #FF6A2A;   /* акцент на темном */
    --c-accent-soft:  #FFF1EA;
    --c-ok:           #1E8A4C;
    --c-warn:         #B7791F;
    --grad-pulse:     linear-gradient(90deg, #F7A21B 0%, #F05A1E 55%, #E1251B 100%);

    /* Шрифты */
    --f-display: "Unbounded", "Onest", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --f-body:    "Onest", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --f-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

    /* Сетка */
    --container: 1280px;
    --gutter: max(16px, min(5vw, 48px));
    --pad-inline: max(var(--gutter), calc((100% - var(--container)) / 2));
    --radius-l: 28px;
    --radius-m: 20px;
    --radius-s: 12px;
    --shadow-1: 0 1px 2px rgba(15, 17, 21, .04), 0 10px 30px -12px rgba(15, 17, 21, .14);
    --shadow-2: 0 1px 2px rgba(15, 17, 21, .05), 0 30px 60px -24px rgba(15, 17, 21, .28);
    --tile: linear-gradient(180deg, #F7F8FA 0%, #ECEEF2 100%);
    --ease: cubic-bezier(.2, .7, .2, 1);
    --header-h: 76px;
}

/* Совместимость со стилями кабинета (старые имена) */
* {
    --commonWhiteColor: #FFFFFF;
    --commonGreyColor: #ECEEF1;
    --strokeGreyColor: #C3C9D0;
    --darkGreyColor: #5C6570;

    --commonRedColor: #E5484D;
    --commonDarkRedColor: #C9353A;

    --commonBlackColor: #0F1115;
    --blackColor: #0B0D10;
    --tealColor: #D63A12;

    --pageGutter: max(16px, min(5vw, 48px));
    --bodyMarginVertical: 2%;
    --bodyMarginHorizontal: 7.5%;
    --bodyBackgroundColor: #F4F5F7;

    --headerOffset: 50px;
    --sectionVerticalMargin: 50px;

    --blockPadding: 40px;
    --blockBorderRadius: 28px;
    --blockTitleFontSize: 38pt;
    --blockContentFontSize: 30pt;
    --blockBackgroundColor: #0F1115;

    --buttonPaddingX: 22px;
    --buttonPaddingY: 12px;
    --buttonBorderRadius: 999px;
    --buttonBorderWidth: 1px;

    --textFieldBorderRadius: 10px;
    --textFieldBorderColor: var(--strokeGreyColor);
    --textFieldFontSize: 15px;
    --textFieldPaddingX: 16px;
    --textFieldPaddingY: 11px;

    --tableBorderRadius: 10px;
}

html {
    --textColorBright: var(--commonWhiteColor);
    --textColorDark: var(--commonBlackColor);

    --defaultFontFamily: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --defaultFontWeight: 400;

    --linkColor: var(--commonWhiteColor);
    --linkHoverColor: var(--strokeGreyColor);

    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

body {
    margin: 0;
    overflow: hidden auto;
    box-sizing: border-box;

    color: var(--c-ink);
    font-family: var(--defaultFontFamily);
    font-weight: var(--defaultFontWeight);
    font-size: 16px;
    line-height: 1.6;
    font-feature-settings: "ss01" 0, "cv11" 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;

    background: var(--bodyBackgroundColor);
}

::selection { background: #FFD9C7; color: var(--c-ink); }

.hidden { display: none; }

.mainContent {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    min-height: 100vh;
}

/* ─── Верхняя служебная полоса ───────────────────────────────────────── */
.topBar {
    width: 100%;
    background: var(--c-graphite);
    color: var(--c-on-dark-2);
    font-size: 12.5px;
    line-height: 18px;
    letter-spacing: .01em;
}
.topBar__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;

    box-sizing: border-box;
    width: 100%;
    padding: 8px var(--pad-inline);
}
.topBar__meta,
.topBar__contacts {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.topBar__meta span:first-child::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 8px;
    border-radius: 50%;
    background: var(--c-accent-glow);
    box-shadow: 0 0 0 3px rgba(255, 106, 42, .18);
    vertical-align: 1px;
}
.topBar__label { color: #7E8794; }
.topBar a { color: var(--c-on-dark); }
.topBar a:hover { color: var(--c-accent-glow); }

/* ─── Шапка ──────────────────────────────────────────────────────────── */
.siteHeader {
    position: sticky;
    top: 0;
    z-index: 60;
    width: 100%;
    background: rgba(255, 255, 255, .96);
    -webkit-backdrop-filter: saturate(1.8) blur(18px);
    backdrop-filter: saturate(1.8) blur(18px);
    border-bottom: 1px solid rgba(15, 17, 21, .07);
}
.siteHeader__inner {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 28px;

    box-sizing: border-box;
    width: 100%;
    min-height: var(--header-h);
    padding: 0 var(--pad-inline);
}
.siteHeader__logo { display: inline-flex; align-items: center; flex-shrink: 0; }
.siteHeader__logo img {
    display: block;
    width: 176px;
    height: auto;
}

.mainNav { display: flex; flex: 1; min-width: 0; justify-content: center; }
.mainNav > ul {
    display: flex;
    align-items: stretch;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.mainNav > ul > li { display: flex; align-items: center; }
.mainNav > ul > li > a {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;

    color: var(--c-ink-2);
    font-size: 15px;
    font-weight: 500;
    line-height: 22px;
    white-space: nowrap;
    transition: color .2s ease, background-color .2s ease;
}
.mainNav > ul > li > a:hover { background: var(--c-bg); color: var(--c-ink); }
.mainNav > ul > li > a.is-active { color: var(--c-ink); }
.mainNav > ul > li > a.is-active::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: -14px;
    height: 2px;
    border-radius: 2px;
    background: var(--c-accent);
}
.mainNav .navCaret {
    width: 10px;
    height: 10px;
    transition: transform .2s ease;
}
.mainNav li.hasMega:hover .navCaret,
.mainNav li.hasMega:focus-within .navCaret { transform: rotate(180deg); }

/* Мега-меню каталога */
.megaMenu {
    position: absolute;
    top: 100%;
    left: var(--pad-inline);
    right: var(--pad-inline);
    z-index: 70;

    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    padding: 18px;
    border: 1px solid rgba(15, 17, 21, .06);
    border-radius: 0 0 24px 24px;
    background: var(--c-surface);
    box-shadow: 0 40px 80px -30px rgba(15, 17, 21, .35);

    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
}
.mainNav li.hasMega:hover .megaMenu,
.mainNav li.hasMega:focus-within .megaMenu {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition-delay: .06s, .06s, 0s;
}
.megaMenu__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.megaMenu__link {
    display: grid !important;
    grid-template-columns: 52px 1fr;
    align-items: center;
    gap: 14px;
    padding: 8px;
    border-radius: 14px;
    white-space: normal !important;
    color: var(--c-ink) !important;
}
.megaMenu__link:hover { background: var(--c-bg); }
.megaMenu__link img {
    box-sizing: border-box;
    width: 52px;
    height: 52px;
    padding: 6px;
    border-radius: 14px;
    object-fit: contain;
    background: var(--tile);
}
.megaMenu__title { display: block; font-size: 15px; font-weight: 600; line-height: 20px; }
.megaMenu__note  { display: block; color: var(--c-ink-3); font-size: 13px; line-height: 18px; }
.megaMenu__aside {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
    padding: 22px;
    border-radius: 16px;
    background: var(--c-graphite);
    color: var(--c-on-dark);
}
.megaMenu__aside p { margin: 0; color: var(--c-on-dark-2); font-size: 14px; line-height: 21px; }
.megaMenu__aside strong { display: block; margin-bottom: 8px; color: var(--c-on-dark); font-size: 18px; font-weight: 600; line-height: 24px; letter-spacing: -0.01em; }
.megaMenu__all { color: var(--c-on-dark) !important; font-size: 14px; font-weight: 600; }
.megaMenu__all:hover { color: var(--c-accent-glow) !important; }

.siteHeader__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}
.siteHeader__actions .buttonBase {
    --buttonPaddingX: 16px;
    --buttonPaddingY: 10px;
    font-size: 14px;
}
.siteHeader__cart {
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    color: var(--c-ink);
}
.siteHeader__cart:hover { color: var(--c-accent-text); }

.navToggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    align-self: center;

    width: 42px;
    height: 42px;
    padding: 0;

    border: 1px solid var(--c-line-2);
    border-radius: 12px;
    background: var(--c-surface);
    cursor: pointer;
}
.navToggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 0 auto;
    border-radius: 2px;
    background: var(--c-ink);
    transition: transform .2s ease, opacity .2s ease;
}
.siteHeader.is-open .navToggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.siteHeader.is-open .navToggle span:nth-child(2) { opacity: 0; }
.siteHeader.is-open .navToggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── Подвал ─────────────────────────────────────────────────────────── */
.siteFooter {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    margin-top: auto;
    padding: 64px var(--pad-inline) 28px;
    overflow: hidden;

    background: var(--c-graphite);
    color: var(--c-on-dark-2);
    font-size: 14px;
    line-height: 22px;
}
.siteFooter::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(240, 90, 30, .7), transparent);
}
.siteFooter p { margin: 0 0 10px; }
.siteFooter a { color: #C9CED6; white-space: normal; }
.siteFooter a:hover { color: #FFFFFF; }

.siteFooter__top {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.3fr;
    gap: 40px;
}
.siteFooter__brand img {
    display: block;
    width: 200px;
    height: auto;
    margin-bottom: 18px;
}
.siteFooter__brand p { color: var(--c-on-dark-2); max-width: 340px; }
.siteFooter__phone a { color: var(--c-on-dark); font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }

.footerCol__title {
    margin: 0 0 16px;
    color: var(--c-on-dark);
    font-family: var(--f-mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.footerCol ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.footerCol strong { color: var(--c-on-dark); font-weight: 600; }

.siteFooter__legal {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    margin-top: 48px;
    padding-top: 22px;
    border-top: 1px solid var(--c-graphite-3);

    color: #7E8794;
    font-family: var(--f-mono);
    font-size: 12px;
    line-height: 20px;
}
.siteFooter__bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;

    margin-top: 16px;
    font-size: 13px;
    line-height: 20px;
}
.siteFooter__bottom p { margin: 0; }
.siteFooter__links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

/* ─── Кнопки ─────────────────────────────────────────────────────────── */
.buttonBase {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    cursor: pointer;
    width: fit-content;
    padding: var(--buttonPaddingY) var(--buttonPaddingX);
    border-radius: var(--buttonBorderRadius);
    border: var(--buttonBorderWidth) solid transparent;

    font-family: var(--defaultFontFamily);
    font-size: 15px;
    font-weight: 600;
    line-height: 22px;
    letter-spacing: -0.005em;
    white-space: nowrap;
    transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease), transform .25s var(--ease);

    &.bright {
        color: var(--c-ink);
        background: var(--c-surface);
        border-color: var(--c-line-2);

        &:hover { background-color: var(--c-surface); border-color: var(--c-ink); color: var(--c-ink); }
        &:focus { outline: none; }
    }
    &.dark {
        color: #FFFFFF;
        background: var(--c-graphite);
        border-color: var(--c-graphite);

        &:hover { background-color: var(--c-graphite-3); color: #FFFFFF; }
        &:focus { outline: none; }
    }
    &.teal,
    &.accent {
        color: #FFFFFF;
        background: var(--c-accent);
        border-color: var(--c-accent);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);

        &:hover { background: var(--c-accent-hover); border-color: var(--c-accent-hover); color: #FFFFFF; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 10px 24px -10px rgba(214, 58, 18, .6); }
        &:focus { outline: none; }
    }
    &.ghostLight {
        color: var(--c-on-dark);
        background: transparent;
        border-color: rgba(255, 255, 255, .28);

        &:hover { border-color: rgba(255, 255, 255, .7); color: #FFFFFF; }
    }

    &.red {
        color: #FFFFFF;
        background: var(--commonRedColor);

        &:hover { background-color: var(--commonDarkRedColor); }
        &:focus { outline: none; background-color: var(--commonDarkRedColor); }
    }
    &.redHollow {
        color: var(--commonDarkRedColor);
        border-color: var(--commonRedColor);

        &:hover { color: var(--commonDarkRedColor); border-color: var(--commonDarkRedColor); }
        &:focus { outline: none; }
    }
}
.buttonBase .arrow { width: 16px; height: 16px; transition: transform .2s ease; }
.buttonBase:hover .arrow { transform: translateX(3px); }

/* Checkbox */
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--c-accent);
}

/* Ссылки по умолчанию */
a {
    display: inline-block;

    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
    white-space: nowrap;

    color: var(--linkColor);
    transition: color .2s linear;

    &:hover {
        color: var(--linkHoverColor);
    }
}

/* Таблицы */
table {
    border-spacing: 0;
    border-collapse: separate;

    thead {
        th {
            text-align: left;
            padding: 12px 16px;
            color: var(--darkGreyColor);
            background: var(--commonGreyColor);
            font-weight: 600;
        }

        tr:first-child th:first-child { border-top-left-radius: var(--tableBorderRadius); }
        tr:first-child th:last-child { border-top-right-radius: var(--tableBorderRadius); }
    }

    tbody {
        tr {
            background: var(--commonWhiteColor);
        }
        td {
            padding: 8px 12px;
            border-top: 1px solid var(--commonGreyColor);
        }

        tr:last-child td:first-child { border-bottom-left-radius: var(--tableBorderRadius); }
        tr:last-child td:last-child { border-bottom-right-radius: var(--tableBorderRadius); }
    }
}

/* Поле ввода */
.textFieldBase {
    display: block;
    box-sizing: border-box;
    resize: none;

    width: 100%;
    padding: var(--textFieldPaddingY) var(--textFieldPaddingX);
    border-radius: var(--textFieldBorderRadius);
    border: 1px solid var(--textFieldBorderColor);

    font-size: var(--textFieldFontSize);
    font-family: var(--defaultFontFamily);
    font-weight: var(--defaultFontWeight);
    line-height: 22px;

    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;

    &.bright {
        color: var(--textColorDark);
        background: var(--c-surface);
        border-color: var(--textFieldBorderColor);

        &:hover { border-color: var(--c-ink-3); }
        &:focus {
            outline: none;
            border-color: var(--c-accent);
            box-shadow: 0 0 0 3px rgba(214, 58, 18, .14);
        }
    }

    &.dark {
        color: var(--textColorBright);
        background: var(--blockBackgroundColor);

        &:hover { background-color: #2A2F37; }
        &:focus { outline: none; }
    }
}

/* ─── Служебные классы ───────────────────────────────────────────────── */
.tableScroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.popupError {
    margin: 0;
    font-size: 13px;
    line-height: 18px;
    text-align: center;
    white-space: pre-line;
    color: var(--commonDarkRedColor);
}

.emptyRow {
    text-align: center;
    padding: 32px 12px !important;
    color: var(--darkGreyColor);
}
.emptyLink {
    color: var(--commonBlackColor);
    text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline: 2px solid var(--c-accent);
    outline-offset: 2px;
}

/* ─── Адаптивность ───────────────────────────────────────────────────── */
@media (max-width: 1280px) {
    .mainNav > ul > li > a { padding: 8px 9px; font-size: 14px; }
    .siteHeader__logo img { width: 168px; }
    .siteHeader__inner { gap: 18px; }
}

@media (max-width: 1180px) {
    .navToggle { display: flex; }
    .mainNav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;

        display: none;
        padding: 8px var(--pad-inline) 20px;

        background: var(--c-surface);
        border-bottom: 1px solid var(--c-line);
        box-shadow: 0 18px 30px rgba(0, 0, 0, .08);
    }
    .siteHeader.is-open .mainNav { display: block; }
    .mainNav > ul {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }
    .mainNav > ul > li { display: block; }
    .mainNav > ul > li > a {
        display: flex;
        padding: 14px 4px;
        border-radius: 0;
        border-bottom: 1px solid var(--c-line);
        font-size: 16px;
    }
    .mainNav > ul > li > a:hover { background: none; }
    .mainNav .navCaret { display: none; }
    .megaMenu { display: none; }
    .siteHeader__inner { gap: 14px; align-items: center; }
    .topBar__meta { display: none; }
}

@media (max-width: 1024px) {
    .siteFooter__top {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }
}

@media (max-width: 760px) {
    :root { --header-h: 64px; }
    .siteHeader__actions { gap: 8px; }
    .siteHeader__actions .buttonBase.bright { display: none; }
    .siteHeader__logo img { width: 150px; }
    .topBar__inner { justify-content: center; }
}

@media (max-width: 640px) {
    .buttonBase {
        --buttonPaddingX: 18px;
        --buttonPaddingY: 11px;
    }
    .siteFooter { padding-top: 48px; }
    .siteFooter__top { grid-template-columns: 1fr; gap: 28px; }
    .siteFooter__bottom { flex-direction: column; align-items: flex-start; gap: 12px; }
    .siteFooter__links { gap: 12px 24px; }
}

@media (max-width: 400px) {
    .siteHeader__logo img { width: 128px; }
    .siteHeader__actions .buttonBase { --buttonPaddingX: 12px; font-size: 13px; }
}
