/* Cookie consent: the banner keeps the look of .uk-card-cookie from style.css (white card, shadow,
   bottom-left on desktop, full width on phones); here only the three-button layout and the settings window. */

.uk-card-cookie.uk-card-cookie-consent {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding: 14px 15px calc(14px + env(safe-area-inset-bottom, 0px));
}

.uk-card-cookie-consent .uk-card-cookie-text {
    color: #161616;
    line-height: 1.4;
}

.uk-card-cookie-actions {
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr 1fr;
}

.uk-card-cookie-actions .uk-button-cookie {
    font-size: 14px;
    height: 44px;
    padding: 0 10px;
    white-space: nowrap;
    width: auto;
}

/* phone: «Разрешить все» on its own row, the two others share the second one */
.uk-card-cookie-actions .uk-button-cookie-accept {
    grid-column: 1 / -1;
}

@media (min-width: 640px) {
    .uk-card-cookie.uk-card-cookie-consent {
        gap: 16px;
        padding: clamp(20px, 2vw, 26px) 30px;
    }

    .uk-card-cookie-actions {
        display: flex;
        flex-wrap: wrap;
    }

    .uk-card-cookie-actions .uk-button-cookie {
        flex: 1 1 auto;
        height: 46px;
        padding: 0 18px;
    }

    .uk-card-cookie-actions .uk-button-cookie-accept {
        flex-grow: 1.4;
    }
}

/* content stays reachable above the fixed banner while it is shown */
html.cookie-banner-open body {
    padding-bottom: var(--cookie-banner-height, 0px);
}

/* settings window */
.uk-modal-cookie.uk-modal-dialog {
    min-height: 0;
    width: 480px;
}

.uk-modal-cookie.uk-modal-body {
    justify-content: flex-start;
    padding: 34px 20px 24px;
}

@media (min-width: 640px) {
    .uk-modal-cookie.uk-modal-body {
        padding: 40px 36px 32px;
    }
}

.uk-modal-cookie-title {
    color: #363636;
    font-size: clamp(18px, 2vw - 1px, 22px);
    line-height: 1.25;
    margin: 0 30px 18px 0;
    text-transform: uppercase;
}

.uk-cookie-category {
    border-top: 1px solid #e8e8e8;
    padding: 14px 0;
}

.uk-cookie-category:last-of-type {
    border-bottom: 1px solid #e8e8e8;
}

.uk-cookie-category-head {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
}

.uk-cookie-category-name {
    color: #161616;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
}

.uk-cookie-category-state {
    color: #178050;
    font-size: 13px;
    margin-top: 2px;
}

/* switch: native checkbox, so the label, keyboard and screen readers keep working */
.uk-cookie-switch {
    -webkit-appearance: none;
    appearance: none;
    background: #c9c9c9;
    border-radius: 14px;
    cursor: pointer;
    flex: 0 0 auto;
    height: 28px;
    margin: 0;
    position: relative;
    transition: background-color .2s;
    width: 48px;
}

.uk-cookie-switch::after {
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
    content: "";
    height: 22px;
    left: 3px;
    position: absolute;
    top: 3px;
    transition: transform .2s;
    width: 22px;
}

.uk-cookie-switch:checked {
    background: #28b274;
}

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

.uk-cookie-switch:disabled {
    cursor: default;
    opacity: .55;
}

.uk-cookie-details {
    margin-top: 6px;
}

.uk-cookie-details summary {
    color: #178050;
    cursor: pointer;
    display: inline-block;
    font-size: 13px;
    list-style: none;
    padding: 4px 0;
}

.uk-cookie-details summary::-webkit-details-marker {
    display: none;
}

.uk-cookie-details summary::after {
    border-bottom: 1.5px solid currentColor;
    border-right: 1.5px solid currentColor;
    content: "";
    display: inline-block;
    height: 6px;
    margin: 0 0 3px 8px;
    transform: rotate(45deg);
    transition: transform .2s;
    width: 6px;
}

.uk-cookie-details[open] summary::after {
    margin-bottom: 0;
    transform: rotate(-135deg);
}

.uk-cookie-details p {
    color: #363636;
    font-size: 13px;
    line-height: 1.45;
    margin: 4px 0 0;
}

.uk-cookie-note {
    color: #363636;
    font-size: 13px;
    line-height: 1.45;
    margin: 14px 0 16px;
}

/* brand green #28b274 is 2.7:1 on white; small text in the window takes a darker green of the same hue (4.95:1) */
.uk-card-cookie-consent .uk-card-cookie-text a,
.uk-card-cookie-consent .uk-card-cookie-text a:hover,
.uk-modal-cookie .uk-cookie-note a,
.uk-modal-cookie .uk-cookie-note a:hover {
    color: #178050;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.uk-modal-cookie .uk-button-cookie-save {
    height: 50px;
    width: 100%;
}

/* the template switches focus outlines off globally; keyboard users still need to see where they are */
.uk-card-cookie-consent .uk-button:focus-visible,
.uk-card-cookie-consent .uk-card-cookie-text a:focus-visible,
.uk-modal-cookie .uk-button:focus-visible,
.uk-cookie-switch:focus-visible,
.uk-cookie-details summary:focus-visible,
.uk-modal-cookie a:focus-visible,
[data-cookie-settings]:focus-visible {
    outline: 2px solid #1c935d;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .uk-cookie-switch,
    .uk-cookie-switch::after,
    .uk-cookie-details summary::after {
        transition: none;
    }
}
