/* BP Tool Cookie Consent — front end. --bpt-cc-primary comes from the settings. */

#bpt-cc {
    --bpt-cc-primary: #111827;
    --bpt-cc-text: #111827;
    --bpt-cc-muted: #4b5563;
    --bpt-cc-border: #e5e7eb;
    --bpt-cc-surface: #ffffff;
    --bpt-cc-soft: #f9fafb;
    font-size: 15px;
    line-height: 1.6;
    color: var(--bpt-cc-text);
}

#bpt-cc *,
#bpt-cc *::before,
#bpt-cc *::after {
    box-sizing: border-box;
}

#bpt-cc [hidden] {
    display: none !important;
}

#bpt-cc p {
    margin: 0;
}

/* ── Buttons ─────────────────────────────────────── */

#bpt-cc .bpt-cc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    margin: 0;
    padding: 0 18px;
    border: 1px solid var(--bpt-cc-primary);
    border-radius: 8px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-transform: none;
    letter-spacing: 0;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: none;
    transition: opacity 0.15s ease, background-color 0.15s ease;
}

#bpt-cc .bpt-cc-btn-primary {
    background: var(--bpt-cc-primary);
    color: #fff;
}

#bpt-cc .bpt-cc-btn-primary:hover {
    opacity: 0.88;
}

#bpt-cc .bpt-cc-btn-outline {
    background: var(--bpt-cc-surface);
    color: var(--bpt-cc-primary);
}

#bpt-cc .bpt-cc-btn-outline:hover {
    background: var(--bpt-cc-soft);
}

#bpt-cc .bpt-cc-btn-text {
    border-color: transparent;
    background: transparent;
    color: var(--bpt-cc-text);
    text-decoration: underline;
    text-underline-offset: 3px;
}

#bpt-cc .bpt-cc-btn:focus-visible,
#bpt-cc .bpt-cc-close:focus-visible,
#bpt-cc .bpt-cc-fab:focus-visible,
#bpt-cc summary:focus-visible,
#bpt-cc .bpt-cc-switch input:focus-visible + .bpt-cc-switch-track {
    outline: 2px solid var(--bpt-cc-primary);
    outline-offset: 2px;
}

#bpt-cc .bpt-cc-link {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ── Banner ──────────────────────────────────────── */

#bpt-cc .bpt-cc-banner {
    position: fixed;
    z-index: 999998;
    background: var(--bpt-cc-surface);
    box-shadow: 0 -4px 24px rgba(16, 24, 40, 0.12);
    animation: bpt-cc-up 0.25s ease-out;
}

#bpt-cc.bpt-cc-bar .bpt-cc-banner {
    left: 0;
    right: 0;
    bottom: 0;
    border-top: 1px solid var(--bpt-cc-border);
}

#bpt-cc.bpt-cc-bar .bpt-cc-banner-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 24px;
}

#bpt-cc.bpt-cc-box-left .bpt-cc-banner,
#bpt-cc.bpt-cc-box-right .bpt-cc-banner {
    bottom: 20px;
    width: 400px;
    max-width: calc(100vw - 32px);
    border: 1px solid var(--bpt-cc-border);
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(16, 24, 40, 0.16);
}

#bpt-cc.bpt-cc-box-left .bpt-cc-banner  { left: 20px; }
#bpt-cc.bpt-cc-box-right .bpt-cc-banner { right: 20px; }

#bpt-cc.bpt-cc-box-left .bpt-cc-banner-inner,
#bpt-cc.bpt-cc-box-right .bpt-cc-banner-inner {
    padding: 20px;
}

#bpt-cc .bpt-cc-text {
    flex: 1;
    min-width: 0;
}

#bpt-cc .bpt-cc-title {
    margin-bottom: 4px;
    font-size: 16px;
    font-weight: 700;
}

#bpt-cc .bpt-cc-message {
    font-size: 14px;
    color: var(--bpt-cc-muted);
}

#bpt-cc .bpt-cc-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

#bpt-cc.bpt-cc-box-left .bpt-cc-actions,
#bpt-cc.bpt-cc-box-right .bpt-cc-actions {
    margin-top: 16px;
}

#bpt-cc.bpt-cc-box-left .bpt-cc-actions .bpt-cc-btn-outline,
#bpt-cc.bpt-cc-box-left .bpt-cc-actions .bpt-cc-btn-primary,
#bpt-cc.bpt-cc-box-right .bpt-cc-actions .bpt-cc-btn-outline,
#bpt-cc.bpt-cc-box-right .bpt-cc-actions .bpt-cc-btn-primary {
    flex: 1;
}

#bpt-cc.bpt-cc-box-left .bpt-cc-btn-text,
#bpt-cc.bpt-cc-box-right .bpt-cc-btn-text {
    order: 3;
    width: 100%;
}

@keyframes bpt-cc-up {
    from { transform: translateY(16px); opacity: 0; }
    to   { transform: none; opacity: 1; }
}

/* ── Settings dialog ─────────────────────────────── */

html.bpt-cc-locked {
    overflow: hidden;
}

#bpt-cc .bpt-cc-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(17, 24, 39, 0.5);
}

#bpt-cc .bpt-cc-dialog {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 580px;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    background: var(--bpt-cc-surface);
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(16, 24, 40, 0.24);
    outline: none;
}

#bpt-cc .bpt-cc-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 24px;
    border-bottom: 1px solid var(--bpt-cc-border);
}

#bpt-cc .bpt-cc-dialog-title {
    font-size: 18px;
    font-weight: 700;
}

#bpt-cc .bpt-cc-close {
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--bpt-cc-muted);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

#bpt-cc .bpt-cc-close:hover {
    background: var(--bpt-cc-soft);
}

#bpt-cc .bpt-cc-dialog-body {
    overflow-y: auto;
    padding: 20px 24px;
}

#bpt-cc .bpt-cc-intro {
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--bpt-cc-muted);
}

#bpt-cc .bpt-cc-category {
    padding: 16px 0;
    border-top: 1px solid var(--bpt-cc-border);
}

#bpt-cc .bpt-cc-category-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

#bpt-cc .bpt-cc-category-name {
    font-size: 15px;
    font-weight: 700;
}

#bpt-cc .bpt-cc-always {
    font-size: 13px;
    font-weight: 600;
    color: #027a48;
    white-space: nowrap;
}

#bpt-cc .bpt-cc-category-desc {
    margin-top: 4px;
    font-size: 14px;
    color: var(--bpt-cc-muted);
}

/* Toggle switch */
#bpt-cc .bpt-cc-switch {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
    margin: 0;
    cursor: pointer;
}

#bpt-cc .bpt-cc-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
}

#bpt-cc .bpt-cc-switch-track {
    position: relative;
    width: 44px;
    height: 24px;
    border-radius: 999px;
    background: #d0d5dd;
    transition: background-color 0.2s ease;
}

#bpt-cc .bpt-cc-switch-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.2);
    transition: transform 0.2s ease;
}

#bpt-cc .bpt-cc-switch input:checked + .bpt-cc-switch-track {
    background: var(--bpt-cc-primary);
}

#bpt-cc .bpt-cc-switch input:checked + .bpt-cc-switch-track::after {
    transform: translateX(20px);
}

/* Cookie list */
#bpt-cc .bpt-cc-cookies {
    margin-top: 10px;
    font-size: 13px;
}

#bpt-cc .bpt-cc-cookies summary {
    display: inline-block;
    font-weight: 600;
    color: var(--bpt-cc-primary);
    cursor: pointer;
}

#bpt-cc .bpt-cc-cookies ul {
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
    border: 1px solid var(--bpt-cc-border);
    border-radius: 10px;
}

#bpt-cc .bpt-cc-cookies li {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 10px 12px;
    border-top: 1px solid var(--bpt-cc-border);
}

#bpt-cc .bpt-cc-cookies li:first-child {
    border-top: 0;
}

#bpt-cc .bpt-cc-cookies code {
    padding: 0;
    background: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--bpt-cc-text);
    word-break: break-all;
}

#bpt-cc .bpt-cc-cookie-meta {
    font-size: 12px;
    color: var(--bpt-cc-muted);
}

#bpt-cc .bpt-cc-cookie-desc {
    color: var(--bpt-cc-muted);
}

#bpt-cc .bpt-cc-dialog-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid var(--bpt-cc-border);
}

/* ── Floating button ─────────────────────────────── */

#bpt-cc .bpt-cc-fab {
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 999997;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--bpt-cc-border);
    border-radius: 50%;
    background: var(--bpt-cc-surface);
    color: var(--bpt-cc-primary);
    box-shadow: 0 4px 12px rgba(16, 24, 40, 0.15);
    cursor: pointer;
}

#bpt-cc.bpt-cc-box-left .bpt-cc-fab {
    left: 20px;
    bottom: 20px;
}

/* ── Small screens ───────────────────────────────── */

@media (max-width: 782px) {
    #bpt-cc.bpt-cc-bar .bpt-cc-banner-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        padding: 16px;
    }

    #bpt-cc .bpt-cc-actions .bpt-cc-btn-outline,
    #bpt-cc .bpt-cc-actions .bpt-cc-btn-primary {
        flex: 1;
    }

    #bpt-cc .bpt-cc-actions .bpt-cc-btn-text {
        order: 3;
        width: 100%;
    }

    #bpt-cc.bpt-cc-box-left .bpt-cc-banner,
    #bpt-cc.bpt-cc-box-right .bpt-cc-banner {
        left: 16px;
        right: 16px;
        bottom: 16px;
        width: auto;
        max-width: none;
    }

    #bpt-cc .bpt-cc-overlay {
        align-items: flex-end;
        padding: 0;
    }

    #bpt-cc .bpt-cc-dialog {
        max-height: 92vh;
        max-height: 92dvh;
        border-radius: 16px 16px 0 0;
    }

    #bpt-cc .bpt-cc-dialog-head,
    #bpt-cc .bpt-cc-dialog-body,
    #bpt-cc .bpt-cc-dialog-foot {
        padding-left: 16px;
        padding-right: 16px;
    }

    #bpt-cc .bpt-cc-dialog-foot .bpt-cc-btn {
        flex: 1 1 auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    #bpt-cc .bpt-cc-banner {
        animation: none;
    }
}
