/* ============================================================
   Релиз R14 (05.10.2026) — 152-ФЗ: согласие на cookie, формы, документы.
   Разметка — чанки cookie-consent, form-consent, footer-legal и страницы документов;
   логика баннера — /assets/tamplate/js/consent.js.

   Отдельный файл, а не конец main.css: у main.css нет версии в адресе, и браузеры
   вернувшихся посетителей держали бы старую копию — баннер вывелся бы без стилей.
   Подключается в <head> (чанк meta-new) и в начале чанка cookie-consent — для страниц
   кейсов, блога и портфолио, у которых свой <head>. При правке файла увеличьте ?v=
   в обоих местах.
   Правила #cookie_notification в main.css (R13) больше не используются: оставлены,
   чтобы откат релиза возвращал старый баннер без правки CSS.
   ============================================================ */

/* --- Баннер --- */
.cc-banner {
    position: fixed;
    left: 50%;
    bottom: 20px;
    z-index: 1040;
    display: flex;
    align-items: center;
    gap: 20px;
    width: calc(100% - 32px);
    max-width: 920px;
    padding: 16px 20px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 32px rgba(15, 23, 42, .16);
    color: #374151;
    opacity: 0;
    transform: translate(-50%, 16px);
    transition: opacity .25s ease, transform .25s ease;
}

.cc-banner[hidden] {
    display: none;
}

.cc-banner.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.cc-banner__text {
    flex: 1;
    min-width: 0;
}

.cc-banner__text p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

.cc-banner__text .cc-banner__title {
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 700;
    color: #111827;
}

.cc-banner a,
.cc-dialog a {
    color: #2563eb;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cc-banner a:hover,
.cc-dialog a:hover {
    color: #1d4ed8;
}

.cc-banner__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex: none;
    max-width: 330px;
}

/* --- Кнопки --- */
.cc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 18px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

.cc-btn:focus-visible,
.cc-dialog__close:focus-visible,
.footer-legal button:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* «Принять» и «Отклонить» одного размера и веса — отказ не должен быть сложнее согласия */
.cc-btn--primary {
    background: #2563eb;
    color: #fff;
}

.cc-btn--primary:hover {
    background: #1d4ed8;
}

.cc-btn--secondary {
    border-color: #d1d5db;
    background: #fff;
    color: #111827;
}

.cc-btn--secondary:hover {
    border-color: #9ca3af;
    background: #f9fafb;
}

.cc-btn--link {
    min-height: 40px;
    padding: 8px 6px;
    background: none;
    color: #2563eb;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cc-btn--link:hover {
    color: #1d4ed8;
}

/* --- Окно настроек --- */
html.cc-lock,
html.cc-lock body {
    overflow: hidden;
}

.cc-dialog {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, .5);
    overflow-y: auto;
}

.cc-dialog[hidden] {
    display: none;
}

.cc-dialog__panel {
    position: relative;
    width: 100%;
    max-width: 560px;
    margin: auto;
    padding: 28px 28px 24px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .3);
    color: #374151;
}

.cc-dialog__close {
    position: absolute;
    top: 14px;
    right: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: #6b7280;
    cursor: pointer;
}

.cc-dialog__close:hover {
    background: #f3f4f6;
    color: #111827;
}

.cc-dialog__title {
    margin: 0 40px 8px 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    color: #111827;
}

.cc-dialog__intro {
    margin: 0 0 18px;
    font-size: 14px;
    line-height: 1.55;
}

.cc-cat {
    padding: 14px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.cc-cat + .cc-cat {
    margin-top: 10px;
}

.cc-cat__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.cc-cat__name {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    cursor: default;
}

label.cc-cat__name {
    cursor: pointer;
}

.cc-cat__always {
    flex: none;
    font-size: 13px;
    font-weight: 600;
    color: #059669;
}

.cc-cat__desc {
    margin: 6px 0 0;
    font-size: 13px;
    line-height: 1.5;
    color: #4b5563;
}

/* Переключатель */
.cc-switch {
    position: relative;
    flex: none;
    width: 44px;
    height: 24px;
}

.cc-switch input {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.cc-switch__track {
    position: absolute;
    inset: 0;
    border-radius: 9999px;
    background: #d1d5db;
    transition: background-color .18s ease;
}

.cc-switch__track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .25);
    transition: transform .18s ease;
}

.cc-switch input:checked + .cc-switch__track {
    background: #2563eb;
}

.cc-switch input:checked + .cc-switch__track::after {
    transform: translateX(20px);
}

.cc-switch input:focus-visible + .cc-switch__track {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.cc-dialog__docs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin: 16px 0 0;
    font-size: 13px;
    line-height: 1.4;
}

.cc-dialog__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* --- Формы: справочная строка под отметкой согласия --- */
.form-legal {
    margin: 6px 0 0 27px;
    font-size: 12px;
    line-height: 1.45;
    color: #6b7280;
}

.form-legal a {
    color: #2563eb;
}

.form-legal a:hover {
    text-decoration: underline;
}

/* --- Подвал: правовые ссылки --- */
.footer-legal {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 22px;
    margin-bottom: 14px;
    font-size: 13px;
}

.footer-legal a,
.footer-legal button {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: #9ca3af;
    text-decoration: none;
    cursor: pointer;
    transition: color .18s ease;
}

.footer-legal a:hover,
.footer-legal button:hover {
    color: #60a5fa;
}

/* --- Страницы документов --- */
.legal-doc {
    max-width: 820px;
    color: #374151;
    font-size: 16px;
    line-height: 1.7;
}

.legal-doc .legal-doc__meta {
    margin: 0 0 24px;
    padding: 12px 16px;
    border-left: 3px solid #2563eb;
    border-radius: 0 8px 8px 0;
    background: #f3f6fd;
    font-size: 14px;
    line-height: 1.6;
    color: #4b5563;
}

.legal-doc h2 {
    margin: 36px 0 12px;
    text-align: left;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    color: #111827;
}

.legal-doc h3 {
    margin: 24px 0 8px;
    text-align: left;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.35;
    color: #1f2937;
}

.legal-doc p {
    margin: 0 0 12px;
}

.legal-doc ul,
.legal-doc ol {
    margin: 0 0 14px;
    padding-left: 22px;
}

.legal-doc ul {
    list-style: disc;
}

.legal-doc ol {
    list-style: decimal;
}

.legal-doc li {
    margin: 4px 0;
}

.legal-doc a {
    color: #2563eb;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.legal-doc .legal-table {
    width: 100%;
    margin: 8px 0 18px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.legal-doc table {
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
    font-size: 14px;
    line-height: 1.5;
}

.legal-doc th,
.legal-doc td {
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
}

.legal-doc th {
    background: #f9fafb;
    font-weight: 600;
    color: #111827;
}

.legal-doc code {
    padding: 1px 5px;
    border-radius: 4px;
    background: #f3f4f6;
    font-size: 13px;
}

/* --- Мобильные --- */
@media (max-width: 760px) {
    .cc-banner {
        left: 12px;
        right: 12px;
        bottom: 12px;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        width: auto;
        max-width: none;
        padding: 14px 16px;
        transform: translateY(16px);
    }

    .cc-banner.is-visible {
        transform: translateY(0);
    }

    .cc-banner__actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        max-width: none;
    }

    .cc-banner__actions .cc-btn--link {
        grid-column: 1 / -1;
        min-height: 32px;
        padding: 4px;
    }

    .cc-dialog {
        align-items: flex-end;
        padding: 0;
    }

    .cc-dialog__panel {
        max-width: none;
        margin: 0;
        padding: 24px 18px 20px;
        border-radius: 16px 16px 0 0;
    }

    .cc-dialog__actions {
        flex-direction: column-reverse;
    }

    .cc-dialog__actions .cc-btn {
        width: 100%;
    }

    .legal-doc {
        font-size: 15px;
    }

    .legal-doc h2 {
        font-size: 19px;
    }
}

/* ============================================================
   Релиз R15 — способы связи и подвал.
   Кнопки мессенджеров выводит сниппет contactWays по чанкам cw-*;
   какие способы показывать — «Настройки сайта» → «Способы связи».
   При правке файла увеличьте ?v= в чанках meta-new и cookie-consent (сейчас v=3).
   ============================================================ */

/* Блок «Написать напрямую» на первом экране (чанки cw-hero-wrap и cw-hero).
   Кнопки белые и одинаковые, цвет мессенджера — только у значка и рамки при наведении:
   так четыре кнопки помещаются в одну строку и не спорят с синей кнопкой формы. */
.cw-hero {
    margin: 0 0 32px;
}

.cw-hero__label {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #6b7280;
}

.cw-hero__list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cw-btn {
    --cw: #2563eb;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 46px;
    padding: 10px 18px 10px 14px;
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    background: #fff;
    color: #111827;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.cw-btn:hover {
    border-color: var(--cw);
    box-shadow: 0 6px 16px -6px rgba(15, 23, 42, .18);
    transform: translateY(-1px);
}

.cw-btn:focus-visible {
    outline: 2px solid var(--cw);
    outline-offset: 2px;
}

.cw-btn svg {
    flex: none;
    color: var(--cw);
}

.cw-btn--tg { --cw: #229ed9; }
.cw-btn--wa { --cw: #1fae54; }
.cw-btn--max { --cw: #843ce2; }
.cw-btn--vk { --cw: #0077ff; }

@media (max-width: 560px) {
    .cw-hero__list {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .cw-btn {
        justify-content: center;
        padding: 10px 12px;
    }

    /* Нечётная последняя кнопка — на всю ширину, чтобы не висела одна в углу */
    .cw-btn:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cw-btn,
    .cw-btn:hover {
        transition: none;
        transform: none;
    }
}

/* Поле «Ваша страница ВКонтакте» видно, только когда выбран вариант ВКонтакте */
.form-vk-field {
    display: none;
}

form:has(input[data-cw="vk"]:checked) .form-vk-field {
    display: block;
}

.form-vk-field {
    margin-top: 12px;
    margin-bottom: 0;
}

/* Браузеры без :has() — поле показываем всегда, иначе его нельзя было бы заполнить */
@supports not selector(:has(*)) {
    .form-vk-field {
        display: block;
    }
}

/* Подвал: копирайт — последней строкой нижней полосы */
.footer-copy {
    margin-top: 10px;
    font-size: 13px;
    color: #9ca3af;
}
