.sf-consent-banner,
.sf-consent-dialog {
    --sf-consent-bg: var(--wp--preset--color--background, #fff);
    --sf-consent-surface: var(--wp--preset--color--background-alt, #f6f7f4);
    --sf-consent-text: var(--wp--preset--color--text-primary, #17211b);
    --sf-consent-muted: var(--wp--preset--color--text-muted, #5f6a63);
    --sf-consent-accent: var(--wp--preset--color--primary, #1f6b45);
    --sf-consent-border: rgb(23 33 27 / 14%);
    color: var(--sf-consent-text);
    font-family: inherit;
}

.sf-consent-banner[hidden] {
    display: none !important;
}

.sf-consent-banner {
    position: fixed;
    z-index: 99998;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    left: 16px;
    max-width: 1180px;
    margin-inline: auto;
    padding: clamp(18px, 3vw, 28px);
    background: var(--sf-consent-bg);
    border: 1px solid var(--sf-consent-border);
    border-radius: 18px;
    box-shadow: 0 18px 60px rgb(16 30 22 / 18%);
}

.sf-consent-banner__content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: center;
}

.sf-consent-banner__copy h2,
.sf-consent-dialog h2,
.sf-consent-dialog h3,
.sf-consent-dialog strong {
    color: var(--sf-consent-text);
}

.sf-consent-banner__copy h2,
.sf-consent-dialog h2 {
    margin: 0;
    font-size: clamp(1.25rem, 3vw, 1.65rem);
    line-height: 1.15;
}

.sf-consent-banner__copy p:not(.sf-consent-banner__eyebrow) {
    max-width: 720px;
    margin: 10px 0 0;
    color: var(--sf-consent-muted);
    font-size: .94rem;
    line-height: 1.55;
}

.sf-consent-banner a,
.sf-consent-dialog a {
    color: var(--sf-consent-accent);
    text-underline-offset: 3px;
}

.sf-consent-banner__eyebrow,
.sf-consent-dialog__eyebrow {
    margin: 0 0 6px;
    color: var(--sf-consent-accent);
    font-size: .72rem;
    font-weight: 750;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.sf-consent-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    max-width: 420px;
}

.sf-consent-button,
.sf-privacy-settings-link {
    min-height: 44px;
    padding: 10px 16px;
    color: var(--sf-consent-text);
    font: inherit;
    font-size: .9rem;
    font-weight: 650;
    line-height: 1.2;
    background: transparent;
    border: 1px solid var(--sf-consent-border);
    border-radius: 999px;
    cursor: pointer;
}

.sf-consent-button:hover {
    background: var(--sf-consent-surface);
}

.sf-consent-button--primary {
    color: #fff;
    background: var(--sf-consent-accent);
    border-color: var(--sf-consent-accent);
}

.sf-consent-button--primary:hover {
    color: #fff;
    filter: brightness(.94);
}

.sf-consent-button--text {
    border-color: transparent;
}

.sf-consent-button:focus-visible,
.sf-privacy-settings-link:focus-visible,
.sf-consent-dialog__close:focus-visible,
.sf-consent-switch input:focus-visible + span {
    outline: 3px solid color-mix(in srgb, var(--sf-consent-accent) 35%, transparent);
    outline-offset: 3px;
}

.sf-consent-dialog {
    box-sizing: border-box;
    inset: 0;
    width: min(680px, calc(100vw - 32px));
    max-height: min(760px, calc(100dvh - 32px));
    margin: auto;
    padding: 0;
    overflow: auto;
    background: var(--sf-consent-bg);
    border: 1px solid var(--sf-consent-border);
    border-radius: 20px;
    box-shadow: 0 24px 90px rgb(16 30 22 / 25%);
}

.sf-consent-dialog::backdrop {
    background: rgb(12 20 16 / 55%);
    backdrop-filter: blur(4px);
}

.sf-consent-dialog__header,
.sf-consent-dialog__footer {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    padding: 22px 24px;
}

.sf-consent-dialog__header {
    border-bottom: 1px solid var(--sf-consent-border);
}

.sf-consent-dialog__footer {
    border-top: 1px solid var(--sf-consent-border);
}

.sf-consent-dialog__close {
    display: grid;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    padding: 0;
    color: var(--sf-consent-text);
    font: inherit;
    font-size: 1.7rem;
    line-height: 1;
    place-items: center;
    background: var(--sf-consent-surface);
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}

.sf-consent-dialog__body {
    display: grid;
    gap: 12px;
    padding: 20px 24px;
}

.sf-consent-category {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--sf-consent-surface);
    border: 1px solid var(--sf-consent-border);
    border-radius: 14px;
}

.sf-consent-category h3,
.sf-consent-category p,
.sf-consent-category strong,
.sf-consent-category small {
    display: block;
    margin: 0;
}

.sf-consent-category h3,
.sf-consent-category strong {
    font-size: .98rem;
}

.sf-consent-category p,
.sf-consent-category small {
    margin-top: 5px;
    color: var(--sf-consent-muted);
    font-size: .85rem;
    line-height: 1.45;
}

.sf-consent-category__status {
    flex: 0 0 auto;
    color: var(--sf-consent-accent);
    font-size: .78rem;
    font-weight: 700;
}

.sf-consent-category--toggle {
    cursor: pointer;
}

.sf-consent-switch {
    position: relative;
    flex: 0 0 48px;
    width: 48px;
    height: 28px;
}

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

.sf-consent-switch span {
    position: absolute;
    inset: 0;
    background: #c8ceca;
    border-radius: 999px;
    transition: background-color .18s ease;
}

.sf-consent-switch span::after {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 20px;
    height: 20px;
    content: '';
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgb(0 0 0 / 20%);
    transition: transform .18s ease;
}

.sf-consent-switch input:checked + span {
    background: var(--sf-consent-accent);
}

.sf-consent-switch input:checked + span::after {
    transform: translateX(20px);
}

.sf-consent-dialog__policy {
    font-size: .85rem;
}

.sf-privacy-settings-link {
    min-height: auto;
    padding: 0;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
    border: 0;
    border-radius: 0;
}

@media (max-width: 820px) {
    .sf-consent-banner__content {
        grid-template-columns: 1fr;
    }

    .sf-consent-banner__actions {
        justify-content: flex-start;
        max-width: none;
    }
}

@media (max-width: 520px) {
    .sf-consent-banner {
        right: 8px;
        bottom: calc(8px + env(safe-area-inset-bottom, 0px));
        left: 8px;
        padding: 18px;
        border-radius: 15px;
    }

    .sf-consent-banner__actions,
    .sf-consent-dialog__footer {
        flex-direction: column;
        align-items: stretch;
    }

    .sf-consent-banner__actions .sf-consent-button,
    .sf-consent-dialog__footer .sf-consent-button {
        width: 100%;
    }

    .sf-consent-dialog__header,
    .sf-consent-dialog__body,
    .sf-consent-dialog__footer {
        padding-right: 18px;
        padding-left: 18px;
    }

    .sf-consent-category {
        gap: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sf-consent-switch span,
    .sf-consent-switch span::after {
        transition: none;
    }
}
