/* CD Cookie Consent - front-end styles
 *
 * Themes can restyle the banner by overriding these variables, e.g.
 * :root { --cd-cc-accent: #ff9600; --cd-cc-accent-text: #000; }
 */
:root {
    --cd-cc-bg: #ffffff;
    --cd-cc-text: #1d2327;
    --cd-cc-accent: #1d2327;
    --cd-cc-accent-text: #ffffff;
    --cd-cc-border: #c3c4c7;
    --cd-cc-radius: 6px;
}

.cd-cc-banner[hidden],
.cd-cc-reopen[hidden] {
    display: none !important;
}

/* Banner */
.cd-cc-banner {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 99999;
    padding: 1.25rem 1rem;
    background: var(--cd-cc-bg);
    color: var(--cd-cc-text);
    box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.15);
    font-size: 1rem;
    line-height: 1.5;
}

.cd-cc-banner__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 2rem;
    max-width: 1100px;
    margin: 0 auto;
}

.cd-cc-banner__text {
    flex: 1 1 28rem;
}

.cd-cc-banner p,
.cd-cc-dialog p {
    margin: 0 0 0.5em;
}

.cd-cc-banner a,
.cd-cc-dialog a {
    color: inherit;
    text-decoration: underline;
}

.cd-cc-title {
    margin: 0 0 0.4em;
    color: inherit;
    font-size: 1.15rem;
    line-height: 1.3;
}

/* Buttons - Accept and Reject share one style, so neither is more prominent */
.cd-cc-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cd-cc-button {
    flex: 1 1 auto;
    min-width: 8em;
    margin: 0;
    padding: 0.65em 1.25em;
    border: 2px solid var(--cd-cc-accent);
    border-radius: var(--cd-cc-radius);
    background: var(--cd-cc-accent);
    color: var(--cd-cc-accent-text);
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
}

.cd-cc-button--secondary {
    background: transparent;
    color: var(--cd-cc-accent);
}

.cd-cc-button:hover {
    opacity: 0.9;
}

.cd-cc-button:focus-visible,
.cd-cc-close:focus-visible,
.cd-cc-switch:focus-visible,
.cd-cc-reopen:focus-visible {
    outline: 3px solid var(--cd-cc-accent);
    outline-offset: 2px;
}

/* Preferences panel */
.cd-cc-dialog {
    width: calc(100% - 2rem);
    max-width: 34rem;
    max-height: 85vh;
    overflow: auto;
    padding: 1.5rem;
    border: 0;
    border-radius: var(--cd-cc-radius);
    background: var(--cd-cc-bg);
    color: var(--cd-cc-text);
    font-size: 1rem;
    line-height: 1.5;
}

.cd-cc-dialog::backdrop {
    background: rgba(0, 0, 0, 0.5);
}

.cd-cc-dialog__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.cd-cc-close {
    padding: 0 0.25em;
    border: 0;
    background: none;
    color: inherit;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
}

.cd-cc-category {
    padding: 0.85rem 0;
    border-top: 1px solid var(--cd-cc-border);
}

.cd-cc-category__head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
}

.cd-cc-category__head label {
    flex: 1;
}

.cd-cc-category__description {
    font-size: 0.9rem;
}

.cd-cc-always {
    font-size: 0.85rem;
    font-weight: normal;
}

.cd-cc-dialog .cd-cc-buttons {
    padding-top: 1rem;
    border-top: 1px solid var(--cd-cc-border);
}

.cd-cc-dialog__policy {
    margin-top: 1rem !important;
    font-size: 0.9rem;
}

/* Checkboxes drawn as on/off switches */
.cd-cc-switch {
    position: relative;
    flex: none;
    width: 2.75rem;
    height: 1.5rem;
    margin: 0;
    border: 2px solid var(--cd-cc-accent);
    border-radius: 1rem;
    background: var(--cd-cc-bg);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.cd-cc-switch::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: calc(1.5rem - 8px);
    height: calc(1.5rem - 8px);
    border-radius: 50%;
    background: var(--cd-cc-accent);
}

.cd-cc-switch:checked {
    background: var(--cd-cc-accent);
}

.cd-cc-switch:checked::before {
    left: auto;
    right: 2px;
    background: var(--cd-cc-accent-text);
}

.cd-cc-switch:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Floating button to change the choice later */
.cd-cc-reopen {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--cd-cc-accent);
    color: var(--cd-cc-accent-text);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    cursor: pointer;
}

.cd-cc-screen-reader {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

@media (max-width: 600px) {
    .cd-cc-banner {
        max-height: 70vh;
        overflow: auto;
    }

    .cd-cc-button {
        flex-basis: 100%;
    }
}
