.cookie-banner {
    --cb-white: #ffffff;
    --cb-black: #121212;
    --cb-gray-100: #f5f5f5;
    --cb-gray-200: #f1f1f1;
    --cb-gray-250: #d9d9d9;
    --cb-gray-300: #b2b2b2;
    --cb-gray-400: #757575;
    --cb-gray-700: #383838;
    --cb-blue-100: #eaf2fd;
    --cb-blue-600: #0058d2;
    --cb-blue-700: #0047ab;

    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1060;
    width: 792px;
    max-width: calc(100vw - 16px);
    min-width: 280px;
    background: var(--cb-white);
    border: 1.5px solid var(--cb-gray-250);
    border-radius: 16px;
    box-shadow: 0 0 0.5px 0 rgba(0, 0, 0, 0.15),
    0 5px 12px 0 rgba(0, 0, 0, 0.08),
    0 1px 3px 0 rgba(0, 0, 0, 0.08);
    font-family: 'Onest', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', sans-serif;
    box-sizing: border-box;
    transition: opacity 0.3s ease-out;
}

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

.cookie-banner[hidden] {
    display: none !important;
}

.cookie-banner.is-visible {
    animation: cookie-banner-in 0.32s ease-out both;
}

@keyframes cookie-banner-in {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.cookie-banner.fade-out {
    opacity: 0 !important;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    .cookie-banner,
    .cookie-banner.is-visible {
        animation: none;
        transition: none;
    }
}

.cookie-banner:not(.is-extended) .cookie-only-extended {
    display: none !important;
}

.cookie-banner.is-extended .cookie-only-default {
    display: none !important;
}

.cookie-banner__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 20px 0 40px;
}

.cookie-banner__title {
    margin: 0;
    font-weight: 600;
    font-size: 20px;
    line-height: 28px;
    letter-spacing: -0.2px;
    color: var(--cb-black);
    overflow-wrap: break-word;
}

.cookie-banner__collapse {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 8px;
    border: 0;
    border-radius: 999px;
    background: var(--cb-gray-200);
    color: var(--cb-black);
    cursor: pointer;
}

.cookie-banner__collapse:hover {
    background: var(--cb-gray-250);
}

.cookie-banner__collapse:focus-visible {
    outline: 2px solid var(--cb-blue-600);
    outline-offset: 2px;
}

.cookie-banner__collapse .icon {
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cookie-banner__content {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 8px 40px 0 40px;
}

.cookie-banner.is-extended .cookie-banner__content {
    max-height: calc(100vh - 260px);
    overflow-y: auto;
}

.cookie-banner__desc {
    margin: 0;
    font-size: 14px;
    line-height: 20px;
    font-weight: 400;
    color: var(--cb-gray-700);
    overflow-wrap: break-word;
}

.cookie-banner__groups {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--cb-gray-100);
    border-radius: 12px;
    padding: 8px 20px 12px 20px;
}

.cookie-group {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 40px;
    row-gap: 8px;
    align-items: center;
    padding: 12px 0;
}

.cookie-group__titleRow {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    align-items: center;
    gap: 16px;
}

.cookie-group__title {
    font-size: 18px;
    line-height: 28px;
    font-weight: 500;
    color: var(--cb-black);
}

.cookie-group__tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 20px;
    padding: 0 8px;
    border: 1.5px solid var(--cb-blue-600);
    border-radius: 4px;
    font-size: 12px;
    line-height: 16px;
    font-weight: 500;
    color: var(--cb-blue-600);
    white-space: nowrap;
}

.cookie-group__desc {
    grid-column: 1;
    grid-row: 2;
    margin: 0;
    font-size: 14px;
    line-height: 20px;
    font-weight: 400;
    color: var(--cb-gray-400);
    overflow-wrap: break-word;
}

.cookie-group__control {
    grid-column: 2;
    grid-row: 1 / span 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
}

.cookie-group__check {
    width: 24px;
    height: 24px;
    display: block;
    color: var(--cb-blue-600);
}

.cookie-banner__separator {
    margin: 2px 0;
    border: 0;
    border-top: 1px solid var(--cb-gray-250);
}

.cookie-switch {
    display: inline-flex;
    cursor: pointer;
    margin: 0;
}

.cookie-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-switch__track {
    display: inline-block;
    width: 48px;
    height: 28px;
    border-radius: 999px;
    background: var(--cb-gray-300);
    position: relative;
    transition: background-color 0.2s ease-in-out;
}

.cookie-switch__thumb {
    position: absolute;
    top: 50%;
    left: 2px;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: var(--cb-white);
    box-shadow: 0 0 0.5px 0 rgba(0, 0, 0, 0.3),
    0 1px 3px 0 rgba(0, 0, 0, 0.16);
    transition: left 0.2s ease-in-out;
}

.cookie-switch input:checked + .cookie-switch__track {
    background: var(--cb-blue-600);
}

.cookie-switch input:checked + .cookie-switch__track .cookie-switch__thumb {
    left: 22px;
}

.cookie-switch input:focus-visible + .cookie-switch__track {
    outline: 2px solid var(--cb-blue-600);
    outline-offset: 2px;
}

.cookie-banner__footer {
    padding: 12px 40px 20px 40px;
}

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

.cookie-banner__footerActions {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 414px;
    max-width: 100%;
}

.cookie-banner__footerActions .cookie-btn {
    flex: 1 1 0;
}

.cookie-banner__footerExtended {
    display: flex;
    justify-content: flex-end;
}

.cookie-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    min-width: 56px;
    padding: 0 16px;
    border-radius: 6px;
    border: 1.5px solid transparent;
    font-family: inherit;
    font-size: 14px;
    line-height: 20px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.2s ease-in-out;
    background: transparent;
}

.cookie-btn:focus-visible {
    outline: 2px solid var(--cb-blue-600);
    outline-offset: 2px;
}

.cookie-btn--primary {
    background: var(--cb-blue-600);
    color: var(--cb-white);
}

.cookie-btn--primary:hover {
    background: var(--cb-blue-700);
}

.cookie-btn--outline {
    border-color: var(--cb-blue-600);
    color: var(--cb-blue-600);
    background: var(--cb-white);
}

.cookie-btn--outline:hover {
    background: var(--cb-blue-100);
}

.cookie-btn--neutral {
    border-color: var(--cb-black);
    color: var(--cb-black);
    background: var(--cb-white);
}

.cookie-btn--neutral:hover {
    background: var(--cb-gray-100);
}

.cookie-btn--confirm {
    width: 201px;
}

@media (max-width: 767px) {
    .cookie-banner {
        width: 359px;
        max-width: calc(100vw - 16px);
    }

    .cookie-banner__header {
        padding: 24px 12px 0 16px;
    }

    .cookie-banner__title {
        font-size: 22px;
        line-height: 30px;
        letter-spacing: -0.22px;
    }

    .cookie-banner__content,
    .cookie-banner.is-extended .cookie-banner__content {
        padding: 16px;
        gap: 20px;
        max-height: calc(100vh - 240px);
        max-height: calc(100dvh - 240px);
        overflow-y: auto;
    }

    .cookie-banner__groups {
        border-radius: 8px;
        padding: 16px 20px;
        gap: 8px;
    }

    .cookie-group {
        column-gap: 16px;
        row-gap: 12px;
        padding: 12px 0;
    }

    .cookie-group__control {
        grid-row: 1;
        width: auto;
    }

    .cookie-group__desc {
        grid-column: 1 / -1;
    }

    .cookie-group__title {
        flex: 1 1 0;
        min-width: 0;
    }

    .cookie-group__control--check {
        display: none;
    }

    .cookie-group__titleRow {
        justify-content: space-between;
    }

    .cookie-banner__footer {
        padding: 12px 16px 24px 16px;
    }

    .cookie-banner__footerDefault {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .cookie-banner__footerActions {
        width: 100%;
        flex-direction: column;
        gap: 8px;
        order: -1;
    }

    .cookie-banner__footerActions .cookie-btn {
        flex: initial;
    }

    #btnAll {
        order: -1;
    }

    .cookie-btn {
        width: 100%;
        height: 48px;
        min-width: 72px;
        padding: 0 20px;
        border-radius: 8px;
        font-size: 16px;
        line-height: 24px;
    }

    .cookie-btn--confirm {
        width: 100%;
    }
}
