/* Complianz Québec – Cookie Banner */
:root {
    --cmpq-primary: #003DA5;
    --cmpq-bg: #ffffff;
    --cmpq-text: #1a1a1a;
    --cmpq-radius: 6px;
    --cmpq-shadow: 0 4px 24px rgba(0,0,0,.14);
    --cmpq-z: 999999;
}

#cmpq-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.45);
    z-index: calc(var(--cmpq-z) - 1);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

#cmpq-root {
    position: fixed;
    z-index: var(--cmpq-z);
    font-family: system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--cmpq-text);
    box-sizing: border-box;
}
#cmpq-root *, #cmpq-root *::before, #cmpq-root *::after { box-sizing: inherit; }

/* ── Layout variants ── */
#cmpq-root.cmpq-pos-bottom { bottom: 0; left: 0; right: 0; }
#cmpq-root.cmpq-pos-top    { top: 0;    left: 0; right: 0; }
#cmpq-root.cmpq-pos-center {
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: min(560px, 96vw);
}

/* ── Banner card ── */
.cmpq-banner {
    background: var(--cmpq-bg);
    box-shadow: var(--cmpq-shadow);
    animation: cmpqSlideIn .3s cubic-bezier(.22,1,.36,1) both;
}

/* Bar layout */
.cmpq-layout-bar .cmpq-banner {
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.cmpq-layout-bar .cmpq-body { flex: 1; min-width: 200px; }
.cmpq-layout-bar .cmpq-actions { display: flex; gap: 8px; flex-wrap: wrap; flex-shrink: 0; }

/* Box layout */
.cmpq-layout-box .cmpq-banner,
.cmpq-layout-floating .cmpq-banner {
    max-width: 520px;
    margin: 0 auto;
    border-radius: var(--cmpq-radius);
    padding: 28px 28px 22px;
}
.cmpq-layout-floating { margin: 16px; }
.cmpq-layout-floating.cmpq-pos-bottom { left: auto; right: 16px; bottom: 16px; width: min(420px, 96vw); }

/* Box title */
.cmpq-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--cmpq-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.cmpq-law-badge {
    font-size: 10px;
    font-weight: 600;
    background: var(--cmpq-primary);
    color: #fff;
    padding: 2px 7px;
    border-radius: 20px;
    letter-spacing: .3px;
}
.cmpq-body-text { color: var(--cmpq-text); margin: 0 0 14px; }
.cmpq-body-text strong { color: var(--cmpq-primary); }

.cmpq-privacy-link { font-size: 12px; color: var(--cmpq-primary); text-decoration: underline; }
.cmpq-withdraw { font-size: 11px; color: #888; margin-top: 6px; }

/* ── Actions ── */
.cmpq-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
}
.cmpq-btn {
    padding: 9px 18px;
    border-radius: var(--cmpq-radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid var(--cmpq-primary);
    transition: all .15s;
    white-space: nowrap;
    line-height: 1;
}
.cmpq-btn-primary {
    background: var(--cmpq-primary);
    color: #fff;
}
.cmpq-btn-primary:hover { filter: brightness(1.12); }
.cmpq-btn-secondary {
    background: transparent;
    color: var(--cmpq-primary);
}
.cmpq-btn-secondary:hover { background: color-mix(in srgb, var(--cmpq-primary) 8%, transparent); }
.cmpq-btn-text {
    background: none;
    border-color: transparent;
    color: #888;
    font-weight: 400;
}
.cmpq-btn-text:hover { color: var(--cmpq-primary); }

/* ── Preferences panel ── */
.cmpq-panel {
    max-width: 520px;
    margin: 0 auto;
    padding: 28px;
    background: var(--cmpq-bg);
    border-radius: var(--cmpq-radius);
    box-shadow: var(--cmpq-shadow);
    max-height: 80vh;
    overflow-y: auto;
}
.cmpq-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.cmpq-panel-title { font-size: 16px; font-weight: 700; color: var(--cmpq-primary); margin: 0; }
.cmpq-close-btn {
    background: none; border: none; font-size: 20px; cursor: pointer;
    color: #888; padding: 2px 6px; border-radius: 4px; line-height: 1;
}
.cmpq-close-btn:hover { background: #f0f0f0; color: #333; }

/* Category rows */
.cmpq-cat {
    border: 1px solid #e8e8e8;
    border-radius: var(--cmpq-radius);
    padding: 12px 14px;
    margin-bottom: 10px;
}
.cmpq-cat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.cmpq-cat-name { font-weight: 600; font-size: 13px; }
.cmpq-cat-desc { font-size: 12px; color: #777; margin-top: 4px; }

/* Category toggle */
.cmpq-cat-toggle {
    position: relative;
    display: inline-block;
    width: 38px; height: 20px;
    flex-shrink: 0;
}
.cmpq-cat-toggle input { opacity: 0; width: 0; height: 0; }
.cmpq-cat-toggle span {
    position: absolute; inset: 0;
    background: #ccc; border-radius: 20px; cursor: pointer; transition: .25s;
}
.cmpq-cat-toggle span::before {
    content: ''; position: absolute;
    width: 14px; height: 14px; left: 3px; bottom: 3px;
    background: #fff; border-radius: 50%; transition: .25s;
}
.cmpq-cat-toggle input:checked + span { background: var(--cmpq-primary); }
.cmpq-cat-toggle input:checked + span::before { transform: translateX(18px); }
.cmpq-cat-toggle input:disabled + span { opacity: .5; cursor: not-allowed; }
.cmpq-always-on { font-size: 11px; color: #4CAF50; font-weight: 600; }

/* ── Animations ── */
@keyframes cmpqSlideIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.cmpq-pos-top .cmpq-banner { animation-name: cmpqSlideDown; }
@keyframes cmpqSlideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Reopen button (shortcode) ── */
.cmpq-reopen-btn {
    padding: 8px 18px;
    border: 2px solid var(--cmpq-primary);
    border-radius: var(--cmpq-radius);
    color: var(--cmpq-primary);
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all .15s;
}
.cmpq-reopen-btn:hover { background: var(--cmpq-primary); color: #fff; }

/* ── Responsive ── */
@media (max-width: 600px) {
    .cmpq-layout-bar .cmpq-banner { flex-direction: column; align-items: stretch; }
    .cmpq-actions { flex-direction: column; }
    .cmpq-btn { text-align: center; }
}
