/* ============================================================
   Глобальные стили шапки и подвала — ООО ТО178.РУ
   Сквозные блоки: header, footer (общие для всех страниц)
   ============================================================ */

:root {
    --c-dark: #0e1b2e;
    --c-dark-2: #16263f;
    --c-accent: #ff0000;
    --c-accent-dark: #d60000;
    --c-accent-light: #ffe6e6;
    --c-text: #1d2939;
    --c-muted: #5b6b7f;
    --c-line: #e6ebf2;
    --c-bg: #ffffff;
    --c-bg-soft: #f4f7fb;
    --radius: 12px;
    --container: 1200px;
    --header-h: 76px;
    --font-main: "Inter", "Segoe UI", Arial, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-main);
    font-size: 16px;
    line-height: 1.55;
    color: var(--c-text);
    background: var(--c-bg);
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
figure {
    margin: 0;
}

ul {
    padding: 0;
    list-style: none;
}

a {
    color: inherit;
    text-decoration: none;
}

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

.container {
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: 20px;
}

/* ============================================================
   ШАПКА (header)
   ============================================================ */

.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--c-bg);
    box-shadow: 0 1px 0 var(--c-line);
}

/* верхняя информационная полоса */
.header__top {
    background: var(--c-dark);
    color: #c9d4e3;
    font-size: 13px;
    line-height: 1.4;
}

.header__top-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-block: 8px;
    min-height: 36px;
}

.header__top-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header__top-icon {
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    fill: var(--c-accent);
}

/* основная строка шапки */
.header__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: var(--header-h);
}

.header__logo {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
}

.header__logo-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--c-accent), #ff5252);
    color: #fff;
    font-weight: 800;
    font-size: 20px;
    line-height: 1;
    letter-spacing: -0.02em;
}

.header__logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.header__logo-name {
    font-weight: 800;
    font-size: 20px;
    letter-spacing: -0.01em;
    color: var(--c-dark);
    white-space: nowrap;
}

.header__logo-name em {
    font-style: normal;
    color: var(--c-accent);
}

.header__logo-sub {
    font-size: 12px;
    color: var(--c-muted);
    white-space: nowrap;
}

/* чекбокс-переключатель бургера (полуфабрикат, без JS) */
.header__nav-toggle {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.header__burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    border: 1px solid var(--c-line);
    border-radius: 10px;
    background: var(--c-bg);
    cursor: pointer;
    flex: 0 0 auto;
}

.header__burger-line {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: var(--c-dark);
}

.header__nav {
    flex: 1 1 auto;
}

.header__menu {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.header__menu-link {
    display: inline-flex;
    align-items: center;
    padding: 10px 11px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--c-text);
    transition: color 0.15s ease, background-color 0.15s ease;
}

.header__menu-link:hover {
    color: var(--c-accent-dark);
    background: var(--c-bg-soft);
}

/* активный пункт: то же состояние, что при наведении, но постоянно.
   pdoMenu ставит class="active" на текущий пункт (hereClass), а в дизайне
   для него не было ни одного правила — поэтому «активность» была
   неотличима от обычного пункта и стояла не на том пункте на каждой странице. */
.header__menu-item.active .header__menu-link,
.header__menu-item.active .header__menu-link:hover {
    color: var(--c-accent-dark);
    background: var(--c-bg-soft);
}

/* телефон в шапке */
.header__contacts {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 0 0 auto;
}

.header__phone {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.header__phone-link {
    font-weight: 700;
    font-size: 16px;
    line-height: 1.35;
    color: var(--c-dark);
    white-space: nowrap;
    padding: 0;
}

.header__phone-link:hover {
    color: var(--c-accent-dark);
}

.header__phone-link--alt {
    font-size: 14px;
    font-weight: 600;
    color: var(--c-muted);
}

.header__phone-link--alt:hover {
    color: var(--c-accent-dark);
}

.header__phone-note {
    font-size: 12px;
    color: var(--c-muted);
    white-space: nowrap;
}

.header__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: var(--radius);
    background: var(--c-accent);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    transition: background-color 0.15s ease;
}

.header__cta:hover {
    background: var(--c-accent-dark);
}

/* ============================================================
   ПОДВАЛ (footer)
   ============================================================ */

.footer {
    background: var(--c-dark);
    color: #c9d4e3;
    font-size: 14px;
}

.footer__grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr 1fr 1.2fr;
    gap: 40px;
    padding-block: 56px 48px;
}

.footer__col {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.footer__logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer__logo-mark {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--c-accent), #ff5252);
    color: #fff;
    font-weight: 800;
    font-size: 18px;
    line-height: 1;
}

.footer__logo-name {
    font-weight: 800;
    font-size: 18px;
    letter-spacing: -0.01em;
    color: #fff;
}

.footer__logo-name em {
    font-style: normal;
    color: var(--c-accent);
}

.footer__about {
    max-width: 34ch;
    color: #a7b4c6;
    line-height: 1.55;
}

.footer__title {
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fff;
}

.footer__list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #c9d4e3;
    transition: color 0.15s ease;
}

.footer__link:hover {
    color: var(--c-accent);
}

.footer__icon {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.footer__text {
    color: #a7b4c6;
    line-height: 1.55;
}

.footer__requisites {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #a7b4c6;
    line-height: 1.5;
}

.footer__requisites strong {
    font-weight: 600;
    color: #d7e0ec;
}

/* кнопка соцсети VK */
.footer__social {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    padding: 9px 16px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.06);
    color: #c9d4e3;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.footer__social:hover {
    border-color: var(--c-accent);
    background: var(--c-accent);
    color: #fff;
}

.footer__social svg {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* приём оплаты картами */
.footer__pay {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #a7b4c6;
    font-size: 13px;
    line-height: 1.4;
}

.footer__pay svg {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    fill: var(--c-accent);
}

.footer__bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer__bottom-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 24px;
    padding-block: 18px;
    font-size: 13px;
    color: #8fa0b5;
}

.footer__bottom-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 20px;
}

.footer__bottom-links a:hover {
    color: var(--c-accent);
}

.footer__notice {
    color: #8fa0b5;
}

/* ============================================================
   Адаптив
   ============================================================ */

@media (max-width: 1080px) {
    .footer__grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 960px) {
    :root {
        --header-h: 64px;
    }

    .header__top {
        display: none;
    }

    .header__burger {
        display: flex;
        order: 3;
    }

    .header__nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        display: none;
        background: var(--c-bg);
        border-bottom: 1px solid var(--c-line);
        box-shadow: 0 12px 24px rgba(14, 27, 46, 0.08);
        max-height: calc(100vh - var(--header-h));
        overflow-y: auto;
        padding: 12px 20px 20px;
    }

    .header__nav-toggle:checked ~ .header__nav {
        display: block;
    }

    .header__menu {
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
    }

    .header__menu-link {
        padding: 13px 12px;
        font-size: 15px;
        border-bottom: 1px solid var(--c-line);
        border-radius: 0;
    }

    .header__menu-link:hover {
        background: var(--c-bg-soft);
    }

    .header__menu li:last-child .header__menu-link {
        border-bottom: 0;
    }

    .header__contacts {
        order: 2;
        gap: 12px;
    }

    .header__phone-note {
        display: none;
    }

    .header__phone-link {
        font-size: 15px;
    }

    .header__cta {
        padding: 10px 16px;
        font-size: 13px;
    }
}

@media (max-width: 640px) {
    .container {
        padding-inline: 16px;
    }

    .header__logo-sub {
        display: none;
    }

    .header__logo-name {
        font-size: 18px;
    }

    .header__logo-mark {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }

    .header__cta {
        display: none;
    }

    .header__phone-link {
        font-size: 15px;
    }

    .footer__grid {
        grid-template-columns: 1fr;
        gap: 32px;
        padding-block: 44px 36px;
    }

    .footer__bottom-inner {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* сверхмалые экраны: телефон в шапке без вторичного номера,
   чтобы не было горизонтального скролла */
@media (max-width: 400px) {
    .header__phone-link--alt {
        display: none;
    }

    .header__phone-link {
        font-size: 12px;
        letter-spacing: -0.01em;
    }

    .header__logo-name {
        font-size: 15px;
    }

    .header__logo-mark {
        width: 34px;
        height: 34px;
        font-size: 16px;
    }

    .header__bar {
        gap: 8px;
    }

    .header__logo-sub {
        display: none;
    }
}

/* ============================================================
   Меню: пункт «Запись на техосмотр»
   Показываем только в мобильном меню (≤960px) — на десктопе
   он продублирован кнопкой .header__cta, а на мобильном она
   скрыта (display:none), поэтому пункт остаётся в бургер-меню.
   ============================================================ */

@media (min-width: 641px) {
    .header__menu-item:last-child {
        display: none;
    }
}

/* ============================================================
   Глобальная динамика (фронтендер)
   Reveal-анимации, лайтбокс, статусы форм, бургер-блокировка
   ============================================================ */

/* --- видимый focus-ring --- */
:focus-visible {
    outline: 2px solid var(--c-accent);
    outline-offset: 2px;
}

.header__burger:focus-visible {
    outline: 2px solid var(--c-accent);
    outline-offset: 2px;
}

/* --- reveal-анимации появления --- */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition-property: opacity, transform;
    transition-duration: 0.6s, 0.6s;
    transition-timing-function: ease, ease;
    will-change: opacity, transform;
}

.reveal.is-revealed {
    opacity: 1;
    transform: none;
}

/* --- бургер: блокировка скролла --- */
body.menu-open {
    overflow: hidden;
}

/* --- модальное окно: блокировка скролла --- */
body.modal-open {
    overflow: hidden;
}

/* --- статус форм и ошибки --- */
.form-status {
    display: none;
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: 10px;
    background: var(--c-accent-light);
    color: var(--c-accent-dark);
    font-size: 14px;
    font-weight: 600;
}

.form-status.is-shown {
    display: block;
}

.field-error {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #d60000;
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
    border-color: #d60000;
}

/* --- лайтбокс (модальное окно просмотра фото) --- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
}

.lightbox.is-open {
    display: block;
}

.lightbox__overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 16, 28, 0.9);
    backdrop-filter: blur(2px);
}

.lightbox__figure {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 24px;
}

.lightbox__img {
    max-width: min(100%, 1100px);
    max-height: 74vh;
    border-radius: 14px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

.lightbox__caption {
    color: #d7e0ec;
    font-size: 14px;
    text-align: center;
}

.lightbox__btn,
.lightbox__close {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
    transition-property: background-color, border-color;
    transition-duration: 0.15s, 0.15s;
    transition-timing-function: ease, ease;
}

.lightbox__btn:hover,
.lightbox__close:hover {
    background: var(--c-accent);
    border-color: var(--c-accent);
}

.lightbox__btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox__btn--prev {
    left: max(16px, calc((100vw - 1100px) / 2 - 64px));
}

.lightbox__btn--next {
    right: max(16px, calc((100vw - 1100px) / 2 - 64px));
}

.lightbox__btn svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.lightbox__close {
    position: absolute;
    top: 16px;
    right: 16px;
    border: 0;
    background: rgba(255, 255, 255, 0.12);
}

.lightbox__close svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* --- фото: курсор-зум для открытия лайтбокса --- */
.photo__item {
    cursor: zoom-in;
}

.photo__open {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
    border-radius: 16px;
}

.photo__open:focus-visible {
    outline: 2px solid var(--c-accent);
    outline-offset: 2px;
}

/* --- статья: интро-фото открывается в том же лайтбоксе --- */
.doc-content__media {
    cursor: zoom-in;
}

.doc-content__open {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
    border-radius: 20px;
}

.doc-content__open:focus-visible {
    outline: 2px solid var(--c-accent);
    outline-offset: -2px;
}

/* --- уважение к prefers-reduced-motion --- */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
#seo-page .seo-content__cta p{
    color:  var(--c-foot-muted);
}
#seo-page .seo-content__cta a{
     color:  var(--c-foot-muted);
}
#seo-page .seo-content__cta a:hover{
     color:  var(--c-foot-muted);
}