/* Keep the last page controls reachable while the fixed banner is visible. */
body:has(> [data-cookie-consent]) {
    padding-bottom: var(--cookie-consent-height, 0px);
}

body.service-page__shell:has(> [data-cookie-consent]) {
    min-height: calc(100svh + var(--cookie-consent-height, 0px));
    padding-bottom: calc(1.5rem + var(--cookie-consent-height, 0px));
    overflow-y: auto;
}

@media (max-width: 520px) {
    body.service-page__shell:has(> [data-cookie-consent]) {
        padding-bottom: calc(1rem + var(--cookie-consent-height, 0px));
    }
}

.cookie-consent {
    position: fixed;
    left: 0;
    bottom: 0;
    z-index: 1000;
    width: 100%;
    padding: .75rem;
    padding-bottom: max(.75rem, env(safe-area-inset-bottom));
    color: var(--text-color, hsl(212, 12%, 44%));
    font-family: var(--body-font, system-ui, sans-serif);
    line-height: 1.4;
    animation: cookie-consent-enter .35s cubic-bezier(.22, .75, .25, 1) both;
}

.cookie-consent,
.cookie-consent * {
    box-sizing: border-box;
}

.cookie-consent__container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: .75rem 1rem;
    width: min(100%, 48rem);
    margin-inline: auto;
    padding: .875rem 1rem;
    border: 1px solid hsla(var(--hue, 212), 12%, 44%, .2);
    border-radius: 1.15rem;
    background: var(--container-color, #fff);
    box-shadow: 0 1rem 3rem hsla(var(--hue, 212), 40%, 8%, .18);
}

.cookie-consent__content {
    max-width: 32rem;
}

.cookie-consent__title {
    margin-bottom: .35rem;
    color: var(--title-color, hsl(212, 12%, 15%));
    font-size: var(--h3-font-size, 1rem);
    line-height: 1.3;
}

.cookie-consent__description {
    color: var(--text-color, hsl(212, 12%, 44%));
    font-size: .875rem;
    line-height: 1.55;
}

.cookie-consent__policy {
    display: inline-flex;
    margin-top: .4rem;
    color: var(--link-color, hsl(212, 100%, 46%));
    font-size: var(--small-font-size, .815rem);
    text-decoration: none;
}

.cookie-consent__policy-label {
    position: relative;
    display: inline-block;
}

.cookie-consent__policy-label::after {
    position: absolute;
    right: 0;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: currentColor;
    content: '';
    transform: scaleX(0);
    transform-origin: center;
    transition: transform .3s ease-in-out;
}

.cookie-consent__policy:hover .cookie-consent__policy-label::after,
.cookie-consent__policy:focus-visible .cookie-consent__policy-label::after {
    transform: scaleX(1);
}

.cookie-consent__actions {
    display: flex;
    gap: .5rem;
}

.cookie-consent__button {
    min-width: 7.25rem;
    min-height: 2.75rem;
    padding: .7rem 1rem;
    border: 1px solid transparent;
    border-radius: .75rem;
    appearance: none;
    font: inherit;
    font-size: var(--small-font-size, .815rem);
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: color .2s ease, background-color .2s ease, border-color .2s ease, transform .15s ease;
}

.cookie-consent__button--primary {
    background: var(--action-primary-bg, hsl(212, 100%, 42%));
    color: #fff;
}

.cookie-consent__button--secondary {
    border-color: hsla(var(--hue, 212), 12%, 44%, .35);
    background: transparent;
    color: var(--title-color, hsl(212, 12%, 15%));
}

.cookie-consent__button:focus-visible,
.cookie-consent__policy:focus-visible {
    outline: 2px solid var(--first-color, hsl(212, 100%, 50%));
    outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
    .cookie-consent__button--primary:hover {
        background: var(--action-primary-bg-hover, hsl(212, 100%, 39%));
    }

    .cookie-consent__button--secondary:hover {
        border-color: var(--action-primary-bg, hsl(212, 100%, 42%));
        color: var(--title-color, hsl(212, 12%, 15%));
    }
}

@media (max-width: 640px) {
    .cookie-consent {
        padding: .5rem;
        padding-bottom: max(.5rem, env(safe-area-inset-bottom));
    }

    .cookie-consent__container {
        grid-template-columns: 1fr;
        gap: .625rem;
        padding: .75rem;
        border-radius: .875rem;
    }

    .cookie-consent__actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .5rem;
    }

    .cookie-consent__button {
        min-width: 0;
    }
}

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

    .cookie-consent__button,
    .cookie-consent__policy-label::after {
        transition: none;
    }
}

@keyframes cookie-consent-enter {
    from {
        opacity: 0;
        transform: translateY(1rem);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
