:root {
    --thryve-consent-dark: #3f2a1e;
    --thryve-consent-primary: #ac8d78;
    --thryve-consent-light: #fdf9f2;
    --thryve-consent-secondary: #f5f0e6;
    --thryve-consent-border: rgba(63, 42, 30, 0.18);
}

.thryve-consent-open {
    overflow: hidden;
}

.thryve-consent-modal .screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.thryve-consent-banner[hidden],
.thryve-consent-modal[hidden],
.thryve-consent-category iframe[hidden],
[data-thryve-consent-placeholder][hidden] {
    display: none !important;
}

.thryve-consent-banner {
    position: fixed;
    inset: auto 0 0;
    z-index: 10050;
    padding: 1rem;
    background: rgba(63, 42, 30, 0.98);
    color: #fff;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 -18px 45px rgba(39, 23, 15, 0.2);
}

.thryve-consent-banner__inner {
    width: min(1180px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1.5rem;
}

.thryve-consent-banner__copy h2,
.thryve-consent-dialog h2,
.thryve-consent-category h3 {
    margin: 0;
    font-family: Cormorant, Georgia, serif;
    font-weight: 400;
    letter-spacing: 0;
}

.thryve-consent-banner__copy h2 {
    color: #fff;
    font-size: 1.75rem;
    line-height: 1.1;
}

.thryve-consent-banner__copy p {
    max-width: 720px;
    margin: 0.4rem 0;
    color: rgba(255, 255, 255, 0.84);
    font-size: 0.95rem;
    line-height: 1.55;
}

.thryve-consent-banner__copy a {
    color: #fff;
    font-size: 0.875rem;
    text-underline-offset: 3px;
}

.thryve-consent-banner__actions,
.thryve-consent-dialog__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.thryve-consent-button {
    min-height: 46px;
    padding: 0.78rem 1rem;
    border: 1px solid transparent;
    border-radius: 0;
    font: 500 0.75rem/1.2 "Gill Sans Custom", system-ui, sans-serif;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.thryve-consent-button--primary {
    background: var(--thryve-consent-light);
    border-color: var(--thryve-consent-light);
    color: var(--thryve-consent-dark);
}

.thryve-consent-button--secondary {
    background: transparent;
    border-color: currentColor;
    color: inherit;
}

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

.thryve-consent-button:focus-visible,
.thryve-consent-settings-link:focus-visible,
.thryve-consent-floating-link:focus-visible,
.thryve-consent-dialog__close:focus-visible,
.thryve-consent-toggle input:focus-visible + span {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

.thryve-consent-modal {
    position: fixed;
    inset: 0;
    z-index: 10060;
    display: grid;
    place-items: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 180ms ease, visibility 180ms ease;
}

.thryve-consent-modal.is-visible {
    opacity: 1;
    visibility: visible;
}

.thryve-consent-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(39, 25, 18, 0.74);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.thryve-consent-dialog {
    position: relative;
    width: min(760px, 100%);
    max-height: min(88vh, 760px);
    overflow-y: auto;
    padding: clamp(1.35rem, 4vw, 2.6rem);
    background: var(--thryve-consent-light);
    border: 1px solid var(--thryve-consent-border);
    color: var(--thryve-consent-dark);
    box-shadow: 0 24px 70px rgba(39, 25, 18, 0.3);
}

.thryve-consent-dialog__close {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    width: 44px;
    height: 44px;
    border: 1px solid var(--thryve-consent-border);
    background: transparent;
    color: var(--thryve-consent-dark);
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
}

.thryve-consent-dialog__eyebrow {
    margin: 0 3.5rem 0.65rem 0;
    color: var(--thryve-consent-primary);
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.thryve-consent-dialog h2 {
    margin-right: 3rem;
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1;
}

#thryve-consent-description {
    margin: 0.85rem 0 1.5rem;
    color: rgba(63, 42, 30, 0.78);
    font-size: 1rem;
    line-height: 1.65;
}

.thryve-consent-categories {
    display: grid;
    gap: 0.75rem;
}

.thryve-consent-category {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #fff;
    border: 1px solid var(--thryve-consent-border);
}

.thryve-consent-category h3 {
    font-size: 1.35rem;
}

.thryve-consent-category p {
    margin: 0.25rem 0 0;
    color: rgba(63, 42, 30, 0.72);
    font-size: 0.9rem;
    line-height: 1.5;
}

.thryve-consent-toggle {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
}

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

.thryve-consent-toggle > span:last-child {
    position: relative;
    display: block;
    width: 48px;
    height: 27px;
    background: #d7d0ca;
    border: 1px solid rgba(63, 42, 30, 0.18);
    cursor: pointer;
    transition: background-color 160ms ease;
}

.thryve-consent-toggle > span:last-child::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 19px;
    height: 19px;
    background: #fff;
    transition: transform 160ms ease;
}

.thryve-consent-toggle input:checked + span {
    background: var(--thryve-consent-dark);
}

.thryve-consent-toggle input:checked + span::after {
    transform: translateX(21px);
}

.thryve-consent-toggle--locked > span:last-child {
    cursor: not-allowed;
    opacity: 0.72;
}

.thryve-consent-dialog__actions {
    justify-content: flex-end;
    margin-top: 1.5rem;
    color: var(--thryve-consent-dark);
}

.thryve-consent-dialog__actions .thryve-consent-button--primary {
    background: var(--thryve-consent-dark);
    border-color: var(--thryve-consent-dark);
    color: #fff;
}

.thryve-consent-settings-link,
.thryve-consent-floating-link {
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.thryve-consent-floating-link {
    position: fixed;
    right: 0;
    bottom: 0;
    z-index: 10040;
    padding: 0.65rem 0.85rem;
    background: var(--thryve-consent-dark);
    color: #fff;
    font: 500 0.72rem/1.2 "Gill Sans Custom", system-ui, sans-serif;
    letter-spacing: 0.08em;
}

@media (max-width: 900px) {
    .thryve-consent-banner__inner {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 640px) {
    .thryve-consent-banner {
        padding: 0.85rem;
    }

    .thryve-consent-banner__copy h2 {
        font-size: 1.45rem;
    }

    .thryve-consent-banner__copy p {
        font-size: 0.875rem;
    }

    .thryve-consent-banner__actions,
    .thryve-consent-dialog__actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .thryve-consent-button {
        width: 100%;
    }

    .thryve-consent-modal {
        padding: 0;
        align-items: end;
    }

    .thryve-consent-dialog {
        width: 100%;
        max-height: 92vh;
        padding: 1.25rem;
        border-left: 0;
        border-right: 0;
        border-bottom: 0;
    }

    .thryve-consent-category {
        padding: 0.9rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .thryve-consent-modal,
    .thryve-consent-button,
    .thryve-consent-toggle > span:last-child,
    .thryve-consent-toggle > span:last-child::after {
        transition: none;
    }
}
