/* Cookie Consent — баннер и модалка настроек.
 * Соответствует 152-ФЗ: «Принять все» и «Только необходимое» — равнозначные кнопки
 * одного размера и расположения. «Настроить» — текст-ссылка, что допустимо
 * (это не кнопка отказа, а путь к детальной настройке).
 * Стиль подогнан под бренд #2f6685.
 */

.cc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 25, 35, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 999998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.cc-overlay.cc-visible {
    opacity: 1;
    visibility: visible;
}

/* ---------- Banner ---------- */
.cc-banner {
    position: fixed;
    left: 20px;
    right: 20px;
    bottom: 20px;
    z-index: 999999;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    color: #1d2d3d;
    border-radius: 16px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.6) inset,
        0 20px 50px -10px rgba(15, 40, 60, 0.25),
        0 4px 12px rgba(15, 40, 60, 0.08);
    padding: 24px 28px;
    max-width: 1100px;
    margin: 0 auto;
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    transform: translateY(160%);
    opacity: 0;
    visibility: hidden;
    transition:
        transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.3s ease,
        visibility 0.3s ease;
}
.cc-banner.cc-visible {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}
.cc-banner__inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 22px;
}
.cc-banner__icon {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f1c64a 0%, #e9a32a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(233, 163, 42, 0.35);
    flex-shrink: 0;
}
.cc-banner__icon svg { width: 30px; height: 30px; }

.cc-banner__body { min-width: 0; }
.cc-banner__title {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 700;
    color: #2f6685;
    letter-spacing: -0.01em;
}
.cc-banner__text {
    margin: 0;
    color: #4a5563;
    font-size: 14.5px;
}
.cc-banner__text-link {
    margin: 6px 0 0;
    font-size: 13.5px;
    color: #6a7480;
}
.cc-link-button {
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    font: inherit;
    color: #2f6685;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}
.cc-link-button:hover { color: #1f4a64; }
.cc-link-button:focus-visible { outline: 2px solid #ffb74d; outline-offset: 3px; border-radius: 2px; }

.cc-banner__buttons {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    align-items: stretch;
    flex-shrink: 0;
}

/* ---------- Buttons ---------- */
.cc-btn {
    /* Равнозначные кнопки: одинаковый размер, шрифт, расположение.
       Различие только в fill/outline — это юридически допустимо. */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 160px;
    min-height: 46px;
    padding: 12px 24px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    border: 1.5px solid #2f6685;
    background: #fff;
    color: #2f6685;
    text-decoration: none;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.08s ease,
        box-shadow 0.2s ease;
    box-sizing: border-box;
    white-space: nowrap;
    text-align: center;
}
.cc-btn:hover { background: #eaf2f7; }
.cc-btn:active { transform: translateY(1px); }
.cc-btn:focus-visible { outline: 3px solid #ffb74d; outline-offset: 2px; }

.cc-btn--primary {
    background: linear-gradient(135deg, #3a78a0 0%, #2f6685 100%);
    color: #fff;
    border-color: #2f6685;
    box-shadow: 0 4px 14px rgba(47, 102, 133, 0.35);
}
.cc-btn--primary:hover {
    background: linear-gradient(135deg, #2f6685 0%, #1f4a64 100%);
    color: #fff;
    box-shadow: 0 6px 18px rgba(47, 102, 133, 0.45);
}

/* ---------- Link ---------- */
.cc-link {
    color: #2f6685;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.cc-link:hover { color: #1f4a64; }

/* ---------- Modal ---------- */
.cc-modal {
    position: fixed;
    inset: 0;
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}
.cc-modal.cc-visible {
    opacity: 1;
    visibility: visible;
}
.cc-modal__inner {
    background: #fff;
    color: #1d2d3d;
    border-radius: 18px;
    box-shadow: 0 25px 70px rgba(15, 40, 60, 0.4);
    width: 100%;
    max-width: 620px;
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    transform: translateY(14px) scale(0.98);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.cc-modal.cc-visible .cc-modal__inner { transform: translateY(0) scale(1); }

.cc-modal__header {
    padding: 24px 28px 12px;
    border-bottom: 1px solid #eef1f4;
    display: flex;
    align-items: center;
    gap: 14px;
}
.cc-modal__header-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f1c64a 0%, #e9a32a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(233, 163, 42, 0.3);
    flex-shrink: 0;
}
.cc-modal__header-icon svg { width: 22px; height: 22px; }
.cc-modal__title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #2f6685;
    letter-spacing: -0.01em;
}
.cc-modal__body {
    padding: 20px 28px;
    overflow-y: auto;
    flex: 1 1 auto;
}
.cc-modal__intro {
    margin: 0 0 18px;
    color: #555c66;
}
.cc-modal__legal {
    margin: 18px 0 0;
    font-size: 13px;
    color: #7c8590;
}
.cc-modal__footer {
    padding: 16px 28px 24px;
    border-top: 1px solid #eef1f4;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

/* ---------- Category rows ---------- */
.cc-category {
    padding: 16px 0;
    border-bottom: 1px solid #eef1f4;
}
.cc-category:last-child { border-bottom: none; }
.cc-category__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}
.cc-category__name {
    font-weight: 600;
    font-size: 16px;
    color: #1d2d3d;
    cursor: pointer;
}
.cc-category__desc {
    margin: 8px 0 0;
    color: #5a6470;
    font-size: 14px;
}

/* ---------- Toggle switch ---------- */
.cc-toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 28px;
    flex: 0 0 auto;
}
.cc-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.cc-toggle__slider {
    position: absolute;
    inset: 0;
    background: #d1d8df;
    border-radius: 28px;
    cursor: pointer;
    transition: background 0.25s ease;
}
.cc-toggle__slider::before {
    content: "";
    position: absolute;
    width: 22px;
    height: 22px;
    top: 3px;
    left: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18);
}
.cc-toggle input:checked + .cc-toggle__slider {
    background: linear-gradient(135deg, #3a78a0 0%, #2f6685 100%);
}
.cc-toggle input:checked + .cc-toggle__slider::before { transform: translateX(20px); }
.cc-toggle input:focus-visible + .cc-toggle__slider { outline: 3px solid #ffb74d; outline-offset: 2px; }
.cc-toggle--disabled .cc-toggle__slider {
    background: #b3bdc7;
    cursor: not-allowed;
    opacity: 0.7;
}

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
    .cc-banner__inner {
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        gap: 14px 16px;
    }
    .cc-banner__icon { grid-row: 1; grid-column: 1; width: 48px; height: 48px; }
    .cc-banner__icon svg { width: 26px; height: 26px; }
    .cc-banner__body { grid-row: 1; grid-column: 2; }
    .cc-banner__buttons {
        grid-row: 2;
        grid-column: 1 / -1;
        flex-direction: column-reverse; /* primary вверху на мобиле */
        gap: 8px;
    }
    .cc-btn { width: 100%; min-width: 0; }
}

@media (max-width: 720px) {
    .cc-banner {
        left: 12px;
        right: 12px;
        bottom: 12px;
        padding: 18px 18px;
        font-size: 14px;
        border-radius: 14px;
    }
    .cc-banner__title { font-size: 16px; }
    .cc-banner__text { font-size: 14px; }
    .cc-modal__inner { max-height: calc(100vh - 24px); border-radius: 16px; }
    .cc-modal__header { padding: 20px 20px 10px; }
    .cc-modal__body { padding: 16px 20px; }
    .cc-modal__footer {
        padding: 14px 20px 20px;
        flex-direction: column-reverse;
    }
    .cc-modal__footer .cc-btn { width: 100%; }
}

@media (max-width: 380px) {
    .cc-banner { padding: 16px 14px; }
    .cc-banner__icon { width: 40px; height: 40px; }
    .cc-banner__icon svg { width: 22px; height: 22px; }
    .cc-banner__title { font-size: 15px; }
    .cc-banner__text { font-size: 13.5px; }
    .cc-banner__text-link { font-size: 13px; }
}

/* ---------- Reduce-motion safety ---------- */
@media (prefers-reduced-motion: reduce) {
    .cc-banner, .cc-overlay, .cc-modal, .cc-modal__inner,
    .cc-toggle__slider, .cc-toggle__slider::before, .cc-btn {
        transition: none !important;
    }
}
