.cookie-consent[hidden],
.cookie-preferences[hidden] {
    display: none;
}

body.cookie-preferences-open {
    overflow: hidden;
}

.cookie-consent {
    position: fixed;
    z-index: 1000;
    left: 18px;
    bottom: 18px;
    width: min(640px, calc(100% - 36px));
    color: var(--green-dark);
}

.cookie-consent__inner {
    padding: 30px 32px 27px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 38px;
    gap: 22px 18px;
    align-items: center;
    background: #fbfaf4;
    border: 1px solid rgba(45, 81, 51, .2);
    border-radius: 8px;
    box-shadow: 0 18px 58px rgba(25, 45, 31, .28);
}

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

.cookie-consent__copy p {
    max-width: 560px;
    margin: 0;
    color: #435548;
    font-size: 15px;
    line-height: 1.65;
}

.cookie-consent__copy a,
.cookie-preferences__footer > a {
    color: var(--green);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cookie-consent__actions,
.cookie-preferences__actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.cookie-consent__button,
.cookie-consent__settings {
    min-height: 48px;
    padding: 12px 18px;
    border-radius: 5px;
    font: 750 11px/1.25 var(--sans);
    text-transform: uppercase;
    transition: transform .18s ease, background-color .18s ease, color .18s ease;
}

.cookie-consent__button {
    border: 1px solid var(--green);
}

.cookie-consent__button:hover,
.cookie-consent__settings:hover {
    transform: translateY(-1px);
}

.cookie-consent__button--primary,
.cookie-consent__button--save {
    color: #fff;
    background: var(--green);
}

.cookie-consent__button--primary:hover,
.cookie-consent__button--save:hover {
    background: var(--green-dark);
}

.cookie-consent__button--secondary {
    color: var(--green);
    background: transparent;
}

.cookie-consent__button--secondary:hover {
    color: #fff;
    background: var(--green);
}

.cookie-consent__settings {
    padding-inline: 5px;
    color: var(--green);
    background: transparent;
    border: 0;
}

.cookie-consent__settings span {
    display: inline-block;
    margin-left: 3px;
    font-size: 18px;
    line-height: 0;
    transform: translateY(2px);
}

.cookie-consent__mark {
    width: 30px;
    height: 48px;
    display: grid;
    place-items: center;
    color: var(--green);
}

.cookie-consent__mark .brand-mark {
    width: 25px;
    height: 48px;
}

.cookie-preferences {
    position: fixed;
    z-index: 1100;
    inset: 0;
    padding: 24px;
    display: grid;
    place-items: center;
    background: rgba(25, 39, 29, .55);
    backdrop-filter: blur(2px);
}

.cookie-preferences__dialog {
    position: relative;
    width: min(820px, 100%);
    max-height: min(760px, calc(100vh - 48px));
    overflow: auto;
    padding: 38px 38px 30px;
    color: var(--green-dark);
    background: #fbfaf4;
    border: 1px solid rgba(45, 81, 51, .2);
    border-radius: 9px;
    box-shadow: 0 22px 70px rgba(18, 34, 23, .32);
}

.cookie-preferences__close {
    position: absolute;
    top: 17px;
    right: 19px;
    width: 40px;
    height: 40px;
    padding: 0;
    color: var(--green);
    background: transparent;
    border: 0;
    font: 400 37px/1 var(--sans);
}

.cookie-preferences__dialog > h2 {
    padding-right: 55px;
    margin: 0 0 20px;
    font: 700 clamp(24px, 3vw, 32px)/1.25 var(--sans);
    letter-spacing: -.025em;
}

.cookie-preferences__intro {
    max-width: 690px;
    margin-bottom: 28px;
    color: #526153;
    font-size: 14px;
    line-height: 1.7;
}

.cookie-preferences__categories {
    border-top: 1px solid var(--line);
}

.cookie-category {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 25px;
    align-items: center;
    padding: 22px 0;
    border-bottom: 1px solid var(--line);
}

.cookie-category h3 {
    margin: 0 0 7px;
    font: 750 15px/1.35 var(--sans);
    letter-spacing: 0;
}

.cookie-category p {
    max-width: 620px;
    margin: 0;
    color: #59685b;
    font-size: 13px;
    line-height: 1.65;
}

.cookie-switch {
    position: relative;
    flex: 0 0 auto;
}

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

.cookie-switch > span:last-child {
    position: relative;
    width: 58px;
    height: 32px;
    display: block;
    background: #777f78;
    border-radius: 999px;
    transition: background-color .2s ease;
}

.cookie-switch > span:last-child::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 26px;
    height: 26px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
    transition: transform .2s ease;
}

.cookie-switch input:checked + span {
    background: var(--green);
}

.cookie-switch input:checked + span::before {
    transform: translateX(26px);
}

.cookie-switch input:focus-visible + span {
    outline: 3px solid #a8b58e;
    outline-offset: 3px;
}

.cookie-switch--locked > span:last-child {
    opacity: .72;
}

.cookie-preferences__footer {
    padding-top: 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.cookie-preferences__footer > a {
    flex: 0 0 auto;
    font-size: 12px;
}

.footer-cookie-settings {
    padding: 0;
    color: inherit;
    background: transparent;
    border: 0;
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.footer-cookie-settings:hover {
    color: #fff;
}

@media (max-width: 720px) {
    .cookie-consent {
        left: 10px;
        bottom: max(10px, env(safe-area-inset-bottom));
        width: calc(100% - 20px);
    }

    .cookie-consent__inner {
        padding: 22px 20px;
        gap: 17px 12px;
    }

    .cookie-consent__copy p {
        font-size: 13px;
    }

    .cookie-consent__actions {
        gap: 9px;
    }

    .cookie-consent__button,
    .cookie-consent__settings {
        min-height: 43px;
        padding: 10px 13px;
        font-size: 10px;
    }

    .cookie-preferences {
        padding: 10px;
        align-items: end;
    }

    .cookie-preferences__dialog {
        max-height: calc(100vh - 20px);
        padding: 29px 20px 22px;
        border-radius: 9px 9px 0 0;
    }

    .cookie-preferences__dialog > h2 {
        font-size: 23px;
    }

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

    .cookie-category {
        gap: 14px;
        padding-block: 18px;
    }

    .cookie-category p {
        font-size: 12px;
    }

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

    .cookie-preferences__actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .cookie-preferences__footer > a {
        align-self: flex-start;
    }
}

@media (max-width: 430px) {
    .cookie-consent__inner {
        grid-template-columns: 1fr;
    }

    .cookie-consent__actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .cookie-consent__mark {
        display: none;
    }

    .cookie-category {
        grid-template-columns: 1fr;
    }
}
