/**
 * Баннер согласия на cookie.
 *
 * Цвета и скругления — как у карточек темы (зелёный #0F6E56). Баннер —
 * небольшая карточка в углу, а не полоса во весь экран: страница остаётся
 * видна и работает, пока человек не выбрал.
 */

.gw-consent {
    position: fixed;
    z-index: 99990;
    left: 20px;
    bottom: 20px;
    box-sizing: border-box;
    width: min(420px, calc(100vw - 40px));
    padding: 20px 20px 14px;
    color: #1a1a1a;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    background: #fff;
    border: 1px solid #e3e8e5;
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(16, 40, 32, 0.18);
    animation: gw-consent-in 0.25s ease-out;
}

.gw-consent[hidden] {
    display: none;
}

.gw-consent__title {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
}

.gw-consent__text {
    margin: 0 0 14px;
    color: #4a524f;
}

/* Короткий вариант текста — только на узком экране. */
.gw-consent__short {
    display: none;
}

.gw-consent__text a {
    color: #0F6E56;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.gw-consent__actions,
.gw-consent-dialog__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* «Принять» и «только необходимые» — один и тот же вид: отказ не должен
   выглядеть второстепенным. */
.gw-consent__btn {
    flex: 1 1 auto;
    min-height: 42px;
    padding: 9px 16px;
    color: #fff;
    font: inherit;
    font-weight: 600;
    background: #0F6E56;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.gw-consent__btn:hover {
    background: #0a5a45;
}

.gw-consent__link {
    flex-basis: 100%;
    padding: 6px 0 2px;
    color: #0F6E56;
    font: inherit;
    text-align: left;
    text-decoration: underline;
    text-underline-offset: 2px;
    background: none;
    border: 0;
    cursor: pointer;
}

.gw-consent__btn:focus-visible,
.gw-consent__link:focus-visible,
.gw-consent-dialog__close:focus-visible,
.gw-consent-switch:focus-visible {
    outline: 3px solid #9FE1CB;
    outline-offset: 2px;
}

/* --- окно настроек --------------------------------------------------------- */

.gw-consent-dialog {
    box-sizing: border-box;
    /* По центру окно ставит браузер — отступами auto. Тема сайта обнуляет
       отступы у всех элементов сразу, и без этой строки окно прилипало к
       левому верхнему углу. */
    margin: auto;
    width: min(520px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    padding: 20px 22px;
    color: #1a1a1a;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    background: #fff;
    border: 0;
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(16, 40, 32, 0.28);
}

.gw-consent-dialog::backdrop {
    background: rgba(10, 30, 24, 0.45);
}

.gw-consent-dialog__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.gw-consent-dialog__title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.gw-consent-dialog__close {
    flex: none;
    width: 36px;
    height: 36px;
    padding: 0;
    color: #1a1a1a;
    font-size: 22px;
    line-height: 1;
    background: #f1f4f2;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}

.gw-consent-category {
    padding: 14px 0;
    border-top: 1px solid #e8ece9;
}

.gw-consent-category__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

label.gw-consent-category__head {
    cursor: pointer;
}

.gw-consent-category__name {
    font-weight: 600;
}

.gw-consent-category__always {
    color: #0F6E56;
    font-size: 13px;
    font-weight: 600;
}

.gw-consent-category__text {
    margin: 6px 0 0;
    color: #4a524f;
}

/* Переключатель — тот же флажок, только нарисованный иначе: для экранного
   диктора он по-прежнему checkbox с подписью. */
.gw-consent-switch {
    position: relative;
    flex: none;
    width: 44px;
    height: 26px;
    margin: 0;
    background: #cfd6d2;
    border-radius: 13px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.gw-consent-switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

.gw-consent-switch:checked {
    background: #0F6E56;
}

.gw-consent-switch:checked::after {
    transform: translateX(18px);
}

.gw-consent-dialog__actions {
    padding-top: 14px;
    border-top: 1px solid #e8ece9;
}

@media (max-width: 600px) {
    /* Экран маленький, и баннер закрывает то, зачем человек пришёл.
       Поэтому плотнее: короткий текст, меньше полей, кнопки в одну строку. */
    .gw-consent {
        left: 12px;
        right: 12px;
        bottom: 12px;
        width: auto;
        padding: 13px 14px 10px;
        font-size: 13px;
        line-height: 1.45;
        border-radius: 14px;
    }

    .gw-consent__title {
        margin-bottom: 4px;
        font-size: 15px;
    }

    .gw-consent__text {
        margin-bottom: 10px;
    }

    .gw-consent__long {
        display: none;
    }

    .gw-consent__short {
        display: inline;
    }

    .gw-consent__btn {
        flex: 1 1 calc(50% - 4px);
        min-height: 40px;
        padding: 8px 10px;
        font-size: 13px;
    }

    .gw-consent__link {
        padding: 5px 0 1px;
        font-size: 13px;
    }

    .gw-consent-dialog {
        padding: 18px 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gw-consent {
        animation: none;
    }

    .gw-consent__btn,
    .gw-consent-switch,
    .gw-consent-switch::after {
        transition: none;
    }
}

@keyframes gw-consent-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}
