/* JITS Complianz: cookie banner (bottom right) and the “Privacy & Cookies”
   tab shown once the visitor has chosen. Colors: Settings > JITS Complianz
   (--jits-cmplz-* set on the root element). */

.jits-cmplz {
    --jits-cmplz-radius: 16px;

    color: var(--jits-cmplz-text);
    font-family: inherit;
}

.jits-cmplz [hidden] {
    display: none !important;
}

.jits-cmplz__banner {
    position: fixed;
    right: 0.75rem;
    bottom: 0.75rem;
    z-index: 100000;
    box-sizing: border-box;
    width: min(36rem, calc(100vw - 1rem));
    max-height: calc(100vh - 1.5rem);
    overflow-y: auto;
    padding: 1.125rem 1.125rem 0.75rem;
    border-radius: var(--jits-cmplz-radius);
    background: var(--jits-cmplz-bg);
    color: var(--jits-cmplz-text);
    box-shadow: 0 0.75rem 2.5rem rgba(0, 0, 0, 0.3);
    animation: jits-cmplz-in 300ms ease-out;
}

@keyframes jits-cmplz-in {
    from {
        opacity: 0;
        transform: translateY(1rem);
    }
}

.jits-cmplz__message {
    margin: 0 0 1.25rem;
    font-size: 1rem;
    line-height: 1.5;
}

/* Categories (View preferences). */
.jits-cmplz__categories {
    display: grid;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}

.jits-cmplz__category {
    background: var(--jits-cmplz-panel);
}

.jits-cmplz__category-head {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 2.75rem;
    padding: 0.5rem 3.25rem 0.5rem 1rem;
}

/* The toggle covers the whole head (click anywhere), its chevron on the right. */
.jits-cmplz__category-toggle {
    flex: 1;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.jits-cmplz__category-toggle::after {
    content: "";
    position: absolute;
    inset: 0;
}

.jits-cmplz__category-toggle:focus-visible {
    outline: none;
}

.jits-cmplz__category-toggle:focus-visible::after {
    outline: 2px solid var(--jits-cmplz-text);
    outline-offset: -2px;
}

.jits-cmplz__chevron {
    position: absolute;
    top: 50%;
    right: 1rem;
    width: 1.4rem;
    height: 1.4rem;
    color: currentColor;
    transform: translateY(-50%);
    transition: transform 200ms ease;
}

.jits-cmplz__category-toggle[aria-expanded="true"] .jits-cmplz__chevron {
    transform: translateY(-50%) rotate(180deg);
}

.jits-cmplz__always {
    color: var(--jits-cmplz-active);
    font-size: 0.95rem;
}

/* Statistics switch, above the toggle. */
.jits-cmplz__switch {
    position: relative;
    z-index: 1;
    display: inline-flex;
    cursor: pointer;
}

.jits-cmplz__switch input {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.jits-cmplz__switch-track {
    position: relative;
    width: 2.6rem;
    height: 1.4rem;
    border-radius: 999px;
    background: #555555;
    transition: background-color 200ms ease;
}

.jits-cmplz__switch-track::after {
    content: "";
    position: absolute;
    top: 0.2rem;
    left: 0.2rem;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: #ffffff;
    transition: transform 200ms ease;
}

.jits-cmplz__switch input:checked + .jits-cmplz__switch-track {
    background: var(--jits-cmplz-switch);
}

.jits-cmplz__switch input:checked + .jits-cmplz__switch-track::after {
    transform: translateX(1.2rem);
}

.jits-cmplz__switch input:focus-visible + .jits-cmplz__switch-track {
    outline: 2px solid var(--jits-cmplz-text);
    outline-offset: 2px;
}

.jits-cmplz__category-text {
    margin: 0;
    padding: 0 1rem 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.jits-cmplz__sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* Buttons: three outlined buttons side by side. */
.jits-cmplz__buttons {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.jits-cmplz__button {
    min-height: 2.75rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--jits-cmplz-button);
    border-radius: 8px;
    background: transparent;
    color: var(--jits-cmplz-button);
    font: inherit;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color 200ms ease, color 200ms ease;
}

.jits-cmplz__button:hover,
.jits-cmplz__button:focus-visible {
    background: var(--jits-cmplz-button);
    color: var(--jits-cmplz-bg);
    outline: none;
}

.jits-cmplz__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem 1.25rem;
    margin: 1.25rem 0 0;
    font-size: 1rem;
}

.jits-cmplz__links a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Tab once the visitor has chosen: barely visible at the bottom right, rises on hover / focus. */
.jits-cmplz__tab {
    position: fixed;
    right: 0.75rem;
    bottom: 0;
    z-index: 100000;
    padding: 0.85rem 1.75rem 1.25rem;
    border: 0;
    border-radius: 14px 14px 0 0;
    background: var(--jits-cmplz-bg);
    color: var(--jits-cmplz-text);
    font: inherit;
    font-size: 1rem;
    line-height: 1.2;
    cursor: pointer;
    /* At rest: only the top 18px show. */
    transform: translateY(calc(100% - 1.125rem));
    transition: transform 250ms ease;
}

.jits-cmplz__tab:hover,
.jits-cmplz__tab:focus-visible {
    transform: translateY(0.45rem);
    outline: none;
}

@media (max-width: 600px) {
    .jits-cmplz__banner {
        right: 0.5rem;
        bottom: 0.5rem;
        padding: 0.75rem 0.625rem 0.625rem;
    }

    .jits-cmplz__buttons {
        grid-template-columns: minmax(0, 1fr);
    }

    .jits-cmplz__tab {
        right: 0.5rem;
    }
}

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

    .jits-cmplz__tab,
    .jits-cmplz__chevron,
    .jits-cmplz__switch-track,
    .jits-cmplz__switch-track::after {
        transition: none;
    }
}
