/* Layout only — colors/font-size come from CSS custom properties emitted inline by the plugin
   (see COOKIE_CONSENT::emit_appearance_style()). No font-family is set here at all, so the banner
   inherits the theme's body font by normal CSS cascade unless an override variable is present. */

.cc-banner {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    width: 66.6667%;
    max-width: 900px;
    height: auto;
    background: var(--cc-bg, #1f1f1f);
    color: var(--cc-text, #fff);
    font-size: var(--cc-font-size, 15px);
    border-radius: 6px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.25);
    z-index: 999999;
    box-sizing: border-box;
    font-family: var(--cc-font-family, inherit);
    transition: opacity 0.18s ease;
}

.cc-banner.cc-fade-out {
    opacity: 0;
}

/* Used on .cc-banner__inner / .cc-panel to crossfade between "main" and "settings" views, and
   applied briefly to #cc-banner itself on open/close. Kept fast and simple — a fade + tiny slide,
   not a full slide-in/bounce production. */
.cc-banner__inner,
.cc-panel {
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.cc-banner__inner.cc-fade-out,
.cc-panel.cc-fade-out {
    opacity: 0;
    transform: translateY(6px);
    pointer-events: none;
}

/* .cc-banner__inner and .cc-panel both set an explicit `display` below, which — because author
   stylesheet rules always beat the browser's built-in `[hidden] { display: none }` default
   regardless of selector specificity — silently defeats the `hidden` attribute entirely unless
   overridden explicitly here. Without this, JS setting `.hidden = true` has no visual effect at
   all on either element. */
.cc-banner__inner[hidden],
.cc-panel[hidden] {
    display: none;
}

.cc-banner__inner {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px 24px;
}

.cc-banner__text {
    margin: 0;
    line-height: 1.5;
}

.cc-banner__text a {
    color: inherit;
    text-decoration: underline;
}

.cc-banner__actions {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
}

.cc-banner__actions .cc-btn {
    flex: 1 1 0;
    text-align: center;
}

.cc-btn {
    border: 1px solid currentColor;
    border-radius: 4px;
    padding: 10px 20px;
    font-size: inherit;
    font-family: inherit;
    cursor: pointer;
    background: transparent;
    color: inherit;
    white-space: nowrap;
}

.cc-btn--accept {
    background: var(--cc-accept-bg, #3fae4a);
    color: var(--cc-accept-text, #fff);
    border-color: transparent;
}

.cc-btn--configure {
    background: var(--cc-configure-bg, transparent);
    color: var(--cc-configure-text, #fff);
}

.cc-panel {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding: 20px 24px;
}

.cc-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.cc-panel__title {
    margin: 0;
    font-size: 1.1em;
    line-height: 1.2;
}

.cc-panel__close {
    background: transparent;
    border: none;
    color: inherit;
    font-size: 1.4em;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    flex: 0 0 auto;
}

.cc-panel__intro {
    margin: 0 0 16px;
    line-height: 1.5;
}

.cc-panel__list {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
}

.cc-panel__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.cc-panel__item:last-child {
    border-bottom: none;
}

.cc-panel__item-text {
    flex: 1 1 auto;
}

.cc-panel__item-desc {
    margin: 4px 0 0;
}

/* Basic toggle switch — flat, no shadows or animation, just a clear on/off state. */
.cc-toggle {
    position: relative;
    display: inline-block;
    flex: 0 0 auto;
    width: 36px;
    height: 20px;
}

.cc-toggle input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.cc-toggle-track {
    position: absolute;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    pointer-events: none;
    transition: background-color 0.12s ease;
}

.cc-toggle-track::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background-color: #fff;
    border-radius: 50%;
    transition: left 0.12s ease;
}

.cc-toggle input:checked + .cc-toggle-track {
    background-color: var(--cc-accept-bg, #3fae4a);
}

.cc-toggle input:checked + .cc-toggle-track::before {
    left: 18px;
}

.cc-toggle input:focus-visible + .cc-toggle-track {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* No floating/fixed positioning at all — this is only ever placed inline via the [cookie_settings]
   shortcode (e.g. on the Datenschutz page), so it should just inherit the surrounding content's
   link styling rather than fight it. */
.cc-reopen-trigger {
    cursor: pointer;
}

/* Salient's own documented breakpoints, reused here for grid consistency: Phone <690px,
   Tablet 690–1000px, Small/Large desktop >1000px (the default 66.6% rule above already covers
   desktop). Tablet gets its own step in between — 66.6% reads as cramped in that range, but full
   mobile-width isn't warranted either. */
@media (min-width: 690px) and (max-width: 1000px) {
    .cc-banner {
        width: 85%;
        max-width: 640px;
    }
}

@media (max-width: 689px) {
    .cc-banner {
        width: 100%;
        max-width: none;
        left: 0;
        right: 0;
        bottom: 0;
        transform: none;
        border-radius: 0;
        /* The banner + open settings panel can together exceed a small phone's viewport height
           (text + 2 buttons + panel title/intro + 2 toggle rows + save button) — cap and scroll
           rather than letting content run off-screen with no way to reach the Save button. */
        max-height: 85vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .cc-banner__inner {
        padding: 16px;
        gap: 12px;
    }

    .cc-banner__actions {
        flex-direction: column;
        gap: 8px;
    }

    .cc-btn {
        width: 100%;
        text-align: center;
        padding: 12px 16px;
    }

    .cc-panel {
        padding: 16px;
    }

    .cc-panel__item {
        padding: 12px 0;
    }
}
