:root {
    --cookie-color-primary: #1c83e8;
    --cookie-color-primary-hover: #166fc6;
    --cookie-color-primary-active: #125ca3;
    --cookie-color-primary-light: #e8f3ff;

    --cookie-color-white: #ffffff;
    --cookie-color-text: #333333;
    --cookie-color-title: #1a1a1a;
    --cookie-color-muted: #666666;

    --cookie-color-border: #d9d9d9;
    --cookie-color-border-light: #e6e6e6;
    --cookie-color-bg-muted: #f7f7f7;

    --cookie-shadow-window: 0 8px 32px rgba(0, 0, 0, 0.12);

    --cookie-radius-window: 8px;
    --cookie-radius-card: 6px;
    --cookie-radius-button: 4px;

    --cookie-transition-fast: .15s ease;
    --cookie-transition-base: .25s ease;
}

.cookie-consent {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 9999;
    width: calc(100% - 48px);
    max-width: 900px;
    font-family: inherit;
    transition:
            transform var(--cookie-transition-base),
            opacity var(--cookie-transition-base);
}

.cookie-consent--hidden {
    transform: translateX(-50%) translateY(calc(100% + 40px));
    opacity: 0;
    pointer-events: none;
}

.cookie-consent__window {
    background: var(--cookie-color-white);
    border: 1px solid var(--cookie-color-border-light);
    border-radius: var(--cookie-radius-window);
    box-shadow: var(--cookie-shadow-window);
    overflow: hidden;
}

.cookie-consent__view {
    display: none;
}

.cookie-consent:not(.cookie-consent--settings) .cookie-consent__view--banner {
    display: block;
    padding: 20px 24px;
}

.cookie-consent--settings .cookie-consent__view--settings {
    display: block;
    padding: 20px 24px;
}

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

.cookie-consent__body--note {
    margin-top: 14px;
}

.cookie-consent__header {
    margin-bottom: 14px;
}

.cookie-consent__title {
    margin: 0 0 6px;
    color: var(--cookie-color-title);
    font-size: 16px;
    font-weight: 600;
}

h2.cookie-consent__title {
    font-size: 17px;
}

.cookie-consent__text {
    color: var(--cookie-color-text);
    font-size: 14px;
    line-height: 1.5;
}

.cookie-consent__link {
    background: none;
    border: 0;
    padding: 0;
    color: var(--cookie-color-primary);
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color var(--cookie-transition-fast);
}

.cookie-consent__link:hover {
    color: var(--cookie-color-primary-hover);
}

.cookie-consent__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
}

.cookie-consent__actions-spacer {
    flex: 1;
}

.cookie-consent__view--settings .cookie-consent__actions {
    justify-content: flex-end;
}

.cookie-consent__link--action {
    align-self: center;
    padding: 0;
    font-size: 14px;
    font-weight: 400;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cookie-btn {
    flex-shrink: 0;
    border: 0;
    border-radius: var(--cookie-radius-button);
    padding: 10px 28px;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition:
            background var(--cookie-transition-fast),
            border-color var(--cookie-transition-fast),
            color var(--cookie-transition-fast);
}

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

.cookie-btn--primary:hover {
    background: var(--cookie-color-primary-hover);
}

.cookie-btn--primary:active {
    background: var(--cookie-color-primary-active);
}

.cookie-btn--ghost {
    background: var(--cookie-color-white);
    color: var(--cookie-color-text);
    border: 1px solid var(--cookie-color-border);
    padding: 9px 22px;
}

.cookie-btn--ghost:hover {
    border-color: var(--cookie-color-primary);
    color: var(--cookie-color-primary-hover);
}

.cookie-consent__categories {
    max-height: 50vh;
    overflow-y: auto;
    margin: 0 -4px;
    padding: 0 4px;
}

.cookie-category {
    background: var(--cookie-color-bg-muted);
    border-radius: var(--cookie-radius-card);
    padding: 14px 16px;
    margin-bottom: 10px;
}

.cookie-category:last-child {
    margin-bottom: 0;
}

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

.cookie-category__title {
    color: var(--cookie-color-title);
    font-size: 14px;
    font-weight: 600;
}

.cookie-category__desc {
    color: var(--cookie-color-muted);
    font-size: 13px;
    line-height: 1.5;
}

.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}

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

.cookie-toggle__slider {
    position: absolute;
    inset: 0;
    background: var(--cookie-color-border);
    border-radius: 22px;
    cursor: pointer;
    transition: background .2s ease;
}

.cookie-toggle__slider::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: var(--cookie-color-white);
    border-radius: 50%;
    transition: transform .2s ease;
}

.cookie-toggle__input:checked + .cookie-toggle__slider {
    background: var(--cookie-color-primary);
}

.cookie-toggle__input:checked + .cookie-toggle__slider::before {
    transform: translateX(18px);
}

.cookie-toggle__input:focus-visible + .cookie-toggle__slider {
    outline: 2px solid var(--cookie-color-primary);
    outline-offset: 2px;
}

.cookie-toggle--disabled .cookie-toggle__slider {
    cursor: not-allowed;
    opacity: .9;
}

@media (max-width: 640px) {
    .cookie-consent {
        left: 12px;
        right: 12px;
        bottom: 12px;
        width: auto;
        transform: none;
    }

    .cookie-consent--hidden {
        transform: translateY(calc(100% + 24px));
    }

    .cookie-consent:not(.cookie-consent--settings) .cookie-consent__view--banner,
    .cookie-consent--settings .cookie-consent__view--settings {
        padding: 16px;
    }

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

    .cookie-consent__actions-spacer {
        display: none;
    }

    .cookie-consent__actions .cookie-btn {
        width: 100%;
        padding: 12px;
    }

    .cookie-consent__link--action {
        align-self: center;
    }

    .cookie-consent__text {
        font-size: 13px;
    }

    .cookie-consent__categories {
        max-height: 60vh;
    }
}
