/*
 * Cookie consent widget.
 *
 * New component, built from the site's own design tokens: the white card with
 * the 16px radius the other sections use, Satoshi, the green accent, and the
 * dark button styling of the rest of the site.
 */

.cookie-widget {
    position: fixed;
    left: 24px;
    bottom: 24px;
    z-index: 80; /* above the WhatsApp bubble (60) and the concept banner (70) */
    width: 100%;
    max-width: 460px;
    animation: cookie-in 0.45s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

@keyframes cookie-in {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

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

.cookie-widget__inner {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 24px 24px 20px;
    border-radius: 16px;
    background-color: var(--_variable-collection---white);
    box-shadow: 0 24px 50px -22px rgba(0, 0, 0, 0.45);
}

.cookie-widget__close {
    position: absolute;
    top: 12px;
    right: 12px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background-color: transparent;
    color: var(--_variable-collection---grey--700);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.cookie-widget__close:hover {
    background-color: var(--_variable-collection---grey--100);
    color: var(--_variable-collection---black--900);
}

.cookie-widget__close svg {
    width: 16px;
    height: 16px;
    display: block;
}

.cookie-widget__title {
    margin: 0;
    padding-right: 32px;
    color: var(--_variable-collection---black--900);
    font-family: Satoshi, Impact, sans-serif;
    font-size: 19px;
    font-weight: 900;
    line-height: 130%;
}

.cookie-widget__text {
    margin: 0;
    color: var(--_variable-collection---black--600);
    font-size: 14px;
    line-height: 158%;
}

.cookie-widget__text a {
    color: var(--_variable-collection---green--700);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cookie-widget__categories {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
    border: 1px solid var(--_variable-collection---grey--200);
    border-radius: 12px;
    overflow: hidden;
}

.cookie-widget__category {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
    background-color: var(--_variable-collection---grey--50);
}

.cookie-widget__category:nth-child(even) {
    background-color: var(--_variable-collection---white);
}

.cookie-widget__category-label {
    margin: 0;
    color: var(--_variable-collection---black--900);
    font-size: 14px;
    font-weight: 700;
}

.cookie-widget__category-text {
    margin: 2px 0 0;
    color: var(--_variable-collection---grey--700);
    font-size: 12px;
    line-height: 145%;
}

/* A small, on-brand toggle. */
.cookie-switch {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    flex: 0 0 auto;
    width: 42px;
    height: 24px;
    margin: 0;
    border: 0;
    border-radius: 999px;
    background-color: var(--_variable-collection---grey--300);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cookie-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background-color: var(--_variable-collection---white);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease;
}

.cookie-switch:checked {
    background-color: var(--_variable-collection---green--500);
}

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

.cookie-switch:disabled {
    background-color: var(--_variable-collection---green--500);
    cursor: default;
}

.cookie-switch:focus-visible {
    outline: 2px solid var(--_variable-collection---green--700);
    outline-offset: 3px;
}

.cookie-widget__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.cookie-button {
    padding: 11px 18px;
    border: 1px solid var(--_variable-collection---grey--300);
    border-radius: 999px;
    background-color: var(--_variable-collection---white);
    color: var(--_variable-collection---black--800);
    font-family: Satoshi, Impact, sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.cookie-button:hover {
    border-color: var(--_variable-collection---green--300);
    background-color: var(--_variable-collection---green--50);
}

.cookie-button--primary {
    border-color: transparent;
    background-color: var(--_variable-collection---green--500);
    color: var(--_variable-collection---white);
}

.cookie-button--primary:hover {
    border-color: transparent;
    background-color: var(--_variable-collection---green--600);
}

.cookie-button--ghost {
    border-color: transparent;
    padding-left: 8px;
    padding-right: 8px;
    color: var(--_variable-collection---green--700);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cookie-button--ghost:hover {
    background-color: transparent;
    color: var(--_variable-collection---green--900);
}

@media screen and (max-width: 767px) {
    .cookie-widget {
        left: 12px;
        right: 12px;
        /* Let the insets decide the width instead of width: 100%. */
        width: auto;
        /* Above the WhatsApp bubble, so that stays clickable. */
        bottom: 80px;
        max-width: none;
    }

    .cookie-widget__inner {
        padding: 20px 18px 18px;
    }

    /* On a landing page it also has to clear the sticky action bar. */
    body.is-landing .cookie-widget {
        bottom: 148px;
    }

    .cookie-widget__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .cookie-button {
        width: 100%;
        text-align: center;
    }
}

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