/* Плашка согласия на cookie и окно настроек. Разметка: include/cookie-consent.php, логика: js/cookie-consent.js */

:root {
    --cc-navy: #153953;
    --cc-navy-deep: #0f2b40;
    --cc-blue: #0078A6;
    --cc-blue-hover: #00638a;
    --cc-link: #32C4F2;
    --cc-text-2: #444444;
    --cc-muted: #6b7a86;
    --cc-line: #dfe6ec;
    --cc-soft: #f3f7fa;
    --cc-white: #ffffff;
    --cc-white-a18: rgba(255, 255, 255, .18);
    --cc-white-a30: rgba(255, 255, 255, .3);
    --cc-track-off: #7d8e9b;
    --cc-scrim: rgba(15, 43, 64, .55);
    --cc-shadow-bar: rgba(15, 43, 64, .22);
    --cc-shadow-modal: rgba(0, 0, 0, .35);
    --cc-shadow-knob: rgba(0, 0, 0, .3);
}

html.cc-lock {
    overflow: hidden;
}

/* ---------- Плашка ---------- */
.cc .cc-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    box-sizing: border-box;
    background: var(--cc-blue);
    color: var(--cc-white);
    font-family: Roboto, Arial, sans-serif;
    box-shadow: 0 -6px 24px var(--cc-shadow-bar);
    transform: translateY(110%);
    visibility: hidden;
    transition: transform .35s ease, visibility 0s linear .35s;
}

.cc .cc-bar.is-open {
    transform: none;
    visibility: visible;
    transition-delay: 0s;
}

.cc .cc-bar__in {
    box-sizing: border-box;
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.cc .cc-bar__img {
    flex: 0 0 auto;
    width: 64px;
    height: 64px;
}

.cc .cc-bar__text {
    flex: 1 1 auto;
    font-size: 15px;
    line-height: 1.45;
    margin: 0;
}

.cc .cc-bar__text b {
    display: block;
    font-size: 16px;
    margin-bottom: 2px;
}

.cc .cc-bar__text a {
    color: var(--cc-white);
    text-decoration: underline;
    white-space: nowrap;
}

.cc .cc-bar__text a:hover {
    text-decoration: none;
}

.cc .cc-bar__btns {
    flex: 0 0 auto;
    display: flex;
    gap: 8px;
}

/* ---------- Кнопки ---------- */
.cc .cc-btn {
    box-sizing: border-box;
    width: auto;
    height: auto;
    min-width: 0;
    margin: 0;
    padding: 12px 16px;
    border: 2px solid var(--cc-white);
    border-radius: 2px;
    background: transparent;
    color: var(--cc-white);
    font: 500 14px/1.2 Roboto, Arial, sans-serif;
    letter-spacing: 0;
    text-transform: none;
    text-align: center;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: none;
    transition: background .15s, color .15s, border-color .15s;
}

.cc .cc-btn:hover {
    background: var(--cc-white-a18);
}

.cc .cc-btn:active {
    background: var(--cc-white-a30);
}

.cc .cc-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.cc .cc-btn--main {
    background: var(--cc-navy);
    border-color: var(--cc-white);
}

.cc .cc-btn--main:hover,
.cc .cc-btn--main:active {
    background: var(--cc-navy-deep);
}

.cc .cc-btn:focus-visible,
.cc .cc-x:focus-visible,
.cc .cc-cat__more:focus-visible {
    outline: 3px solid var(--cc-white);
    outline-offset: 2px;
}

/* ---------- Окно настроек ---------- */
.cc .cc-overlay {
    position: fixed;
    inset: 0;
    z-index: 100001;
    box-sizing: border-box;
    background: var(--cc-scrim);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    font-family: Roboto, Arial, sans-serif;
}

.cc .cc-overlay.is-open {
    display: flex;
}

.cc .cc-modal {
    box-sizing: border-box;
    width: 100%;
    max-width: 640px;
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
    background: var(--cc-white);
    color: #252525;
    border-radius: 2px;
    box-shadow: 0 20px 60px var(--cc-shadow-modal);
    overflow: hidden;
}

.cc .cc-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 24px;
    background: var(--cc-navy);
    color: var(--cc-white);
}

.cc .cc-modal__head h2 {
    margin: 0;
    padding: 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--cc-white);
    text-wrap: balance;
}

.cc .cc-x {
    margin: 0;
    padding: 0 4px;
    border: 0;
    background: none;
    color: var(--cc-white);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.cc .cc-modal__body {
    padding: 20px 24px;
    overflow: auto;
}

.cc .cc-lead {
    margin: 0 0 16px;
    font-size: 14px;
    line-height: 1.45;
    color: var(--cc-text-2);
}

.cc .cc-lead a {
    color: var(--cc-blue);
}

.cc .cc-cat {
    margin: 0 0 8px;
    border: 1px solid var(--cc-line);
    border-radius: 2px;
}

.cc .cc-cat__row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
}

.cc .cc-cat__title {
    margin: 0 0 2px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--cc-navy);
}

.cc .cc-cat__desc {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    color: var(--cc-text-2);
}

.cc .cc-cat__more {
    margin: 8px 0 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--cc-blue);
    font: 400 13px/1.3 Roboto, Arial, sans-serif;
    text-decoration: underline;
    cursor: pointer;
}

.cc .cc-cat__more:hover {
    text-decoration: none;
}

.cc .cc-cat__list {
    display: none;
    padding: 12px 16px;
    border-top: 1px solid var(--cc-line);
    background: var(--cc-soft);
    font-size: 13px;
    line-height: 1.45;
    color: var(--cc-text-2);
}

.cc .cc-cat.is-expanded .cc-cat__list {
    display: block;
}

.cc .cc-cat__list dl {
    margin: 0;
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 4px 12px;
}

.cc .cc-cat__list dt {
    font-weight: 500;
    color: var(--cc-navy);
    overflow-wrap: anywhere;
}

.cc .cc-cat__list dd {
    margin: 0;
}

.cc .cc-always {
    flex: 0 0 auto;
    padding-top: 4px;
    font-size: 13px;
    color: var(--cc-muted);
    white-space: nowrap;
}

/* ---------- Переключатель ---------- */
.cc .cc-switch {
    position: relative;
    flex: 0 0 auto;
    display: block;
    width: 46px;
    height: 26px;
    margin: 0;
    padding: 0;
}

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

.cc .cc-switch i {
    position: absolute;
    inset: 0;
    border-radius: 26px;
    background: var(--cc-track-off);
    transition: background .2s;
}

.cc .cc-switch i::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--cc-white);
    box-shadow: 0 1px 3px var(--cc-shadow-knob);
    transition: transform .2s;
}

.cc .cc-switch input:checked + i {
    background: var(--cc-blue);
}

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

.cc .cc-switch input:focus-visible + i {
    outline: 3px solid var(--cc-navy);
    outline-offset: 2px;
}

.cc .cc-modal__foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid var(--cc-line);
    background: var(--cc-white);
}

.cc .cc-modal .cc-btn {
    color: var(--cc-navy);
    border-color: var(--cc-navy);
}

.cc .cc-modal .cc-btn:hover {
    background: var(--cc-soft);
}

.cc .cc-modal .cc-btn:active {
    background: var(--cc-line);
}

.cc .cc-modal .cc-btn--main {
    background: var(--cc-blue);
    border-color: var(--cc-blue);
    color: var(--cc-white);
}

.cc .cc-modal .cc-btn--main:hover,
.cc .cc-modal .cc-btn--main:active {
    background: var(--cc-blue-hover);
    border-color: var(--cc-blue-hover);
}

.cc .cc-modal .cc-btn:focus-visible {
    outline-color: var(--cc-blue);
}

/* ---------- Ссылка в подвале ---------- */
.footer-bottom__link .cc-open {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--cc-link);
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.footer-bottom__link .cc-open:hover {
    text-decoration: none;
}

/* ---------- Телефоны ---------- */
@media (max-width: 900px) {
    .cc .cc-bar__in {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        padding: 16px;
    }

    .cc .cc-bar__img {
        display: none;
    }

    .cc .cc-bar__btns {
        flex-wrap: wrap;
    }

    .cc .cc-bar__btns .cc-btn {
        flex: 1 1 auto;
    }

    .cc .cc-bar__btns .cc-btn--main {
        flex-basis: 100%;
        order: -1;
    }
}

@media (max-width: 600px) {
    .cc .cc-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .cc .cc-modal {
        max-width: none;
        max-height: 92vh;
        border-radius: 12px 12px 0 0;
    }

    .cc .cc-modal__foot .cc-btn {
        flex: 1 1 100%;
    }

    .cc .cc-modal__foot .cc-btn--main {
        order: -1;
    }

    .cc .cc-cat__list dl {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cc .cc-bar,
    .cc .cc-switch i,
    .cc .cc-switch i::after {
        transition: none;
    }
}
