/* BW Cookie Consent — Frontend */

#bwcc-root * { box-sizing:border-box; }
#bwcc-root a { color:inherit; text-decoration:underline; }

/* ── Overlay ──────────────────────────────────────────────────────────────── */
#bwcc-overlay {
    position:fixed; inset:0; background:rgba(0,0,0,.5);
    z-index:999998; opacity:0; transition:opacity .25s;
}
#bwcc-overlay.bwcc-visible { opacity:1; }

/* ── Base consent element ─────────────────────────────────────────────────── */
#bwcc-consent {
    position:fixed; z-index:999999;
    font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
    font-size:14px; line-height:1.5;
    opacity:0;
    transition:opacity .28s ease;
    max-height:90vh; overflow-y:auto;
}
#bwcc-consent.bwcc-visible { opacity:1; }

/* ── Banner base ──────────────────────────────────────────────────────────── */
#bwcc-consent.bwcc-banner {
    padding:16px 24px;
    display:flex; align-items:center; gap:20px; flex-wrap:wrap;
    border-radius:0 !important;
}

/* ── Popup base ───────────────────────────────────────────────────────────── */
#bwcc-consent.bwcc-popup {
    width:min(520px, 94vw);
    padding:28px 28px 24px;
    box-shadow:0 20px 60px rgba(0,0,0,.18);
    max-height:85vh;
}

/* ── Box base ─────────────────────────────────────────────────────────────── */
#bwcc-consent.bwcc-box {
    width:min(340px, 92vw);
    padding:20px;
    box-shadow:0 8px 32px rgba(0,0,0,.14);
}

/* ── Unified 9-position system ────────────────────────────────────────────── */

/* Top row */
#bwcc-consent.bwcc-pos-top-left   { top:20px; left:20px; }
#bwcc-consent.bwcc-pos-top-center { top:20px; left:50%; transform:translateX(-50%); }
#bwcc-consent.bwcc-pos-top-right  { top:20px; right:20px; }

/* Center row */
#bwcc-consent.bwcc-pos-center-left   { top:50%; left:20px;  transform:translateY(-50%); }
#bwcc-consent.bwcc-pos-center-center { top:50%; left:50%;   transform:translate(-50%,-50%); }
#bwcc-consent.bwcc-pos-center-right  { top:50%; right:20px; transform:translateY(-50%); }

/* Bottom row */
#bwcc-consent.bwcc-pos-bottom-left   { bottom:20px; left:20px; }
#bwcc-consent.bwcc-pos-bottom-center { bottom:20px; left:50%; transform:translateX(-50%); }
#bwcc-consent.bwcc-pos-bottom-right  { bottom:20px; right:20px; }

/* ── Banner overrides: full-width for top / bottom rows ───────────────────── */
#bwcc-consent.bwcc-banner.bwcc-pos-top-left,
#bwcc-consent.bwcc-banner.bwcc-pos-top-center,
#bwcc-consent.bwcc-banner.bwcc-pos-top-right {
    top:0; left:0; right:0; transform:none;
    border-bottom:1px solid rgba(0,0,0,.08);
    box-shadow:0 4px 20px rgba(0,0,0,.08);
}
#bwcc-consent.bwcc-banner.bwcc-pos-bottom-left,
#bwcc-consent.bwcc-banner.bwcc-pos-bottom-center,
#bwcc-consent.bwcc-banner.bwcc-pos-bottom-right {
    bottom:0; left:0; right:0; transform:none;
    border-top:1px solid rgba(0,0,0,.08);
    box-shadow:0 -4px 20px rgba(0,0,0,.08);
}
/* Banner center row = floating centered bar */
#bwcc-consent.bwcc-banner.bwcc-pos-center-left,
#bwcc-consent.bwcc-banner.bwcc-pos-center-center,
#bwcc-consent.bwcc-banner.bwcc-pos-center-right {
    top:50%; left:50%; right:auto; transform:translate(-50%,-50%);
    width:min(700px, 94vw);
    box-shadow:0 8px 32px rgba(0,0,0,.14);
}

/* ── Content ──────────────────────────────────────────────────────────────── */
#bwcc-consent .bwcc-body { flex:1; min-width:0; }

#bwcc-consent .bwcc-title {
    font-weight:700; font-size:16px; margin:0 0 6px;
}

#bwcc-consent .bwcc-desc {
    margin:0 0 10px; opacity:.85; font-size:13px;
}

#bwcc-consent .bwcc-policy-links {
    font-size:12px; margin-bottom:10px; opacity:.7;
}
#bwcc-consent .bwcc-policy-links a { margin:0 4px; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.bwcc-buttons {
    display:flex; gap:8px; flex-wrap:wrap; align-items:center; flex-shrink:0;
}

.bwcc-btn {
    display:inline-flex; align-items:center; justify-content:center;
    padding:9px 18px; font-size:13px; font-weight:600;
    border:none; cursor:pointer; white-space:nowrap;
    text-decoration:none; transition:filter .15s, transform .1s;
    font-family:inherit; line-height:1;
}
.bwcc-btn:hover { filter:brightness(92%); }
.bwcc-btn:active { transform:scale(.98); }

.bwcc-btn-primary   { }
.bwcc-btn-secondary { }
.bwcc-btn-outline   { background:transparent !important; border:1.5px solid currentColor; }

/* Banner layout: buttons inline */
#bwcc-consent.bwcc-banner .bwcc-buttons { flex-direction:row; }

/* Popup/box: stack or row */
#bwcc-consent.bwcc-popup .bwcc-buttons,
#bwcc-consent.bwcc-box   .bwcc-buttons {
    flex-direction:column; width:100%; margin-top:14px;
}
#bwcc-consent.bwcc-popup .bwcc-btn,
#bwcc-consent.bwcc-box   .bwcc-btn { width:100%; justify-content:center; }

/* ── Preferences Panel ───────────────────────────────────────────────────── */
#bwcc-preferences {
    position:fixed; inset:0; z-index:1000000;
    display:flex; align-items:center; justify-content:center;
    padding:16px;
    opacity:0; pointer-events:none; transition:opacity .25s;
}
#bwcc-preferences.bwcc-open {
    opacity:1; pointer-events:all;
}
#bwcc-preferences-overlay {
    position:absolute; inset:0; background:rgba(0,0,0,.5);
}
#bwcc-preferences-modal {
    position:relative; z-index:1;
    background:#fff; border-radius:12px;
    width:min(560px, 96vw); max-height:90vh;
    overflow-y:auto;
    box-shadow:0 24px 64px rgba(0,0,0,.2);
    transform:scale(.95); transition:transform .25s;
}
#bwcc-preferences.bwcc-open #bwcc-preferences-modal { transform:scale(1); }

.bwcc-pref-header {
    padding:20px 24px 16px;
    border-bottom:1px solid #e5e7eb;
    display:flex; align-items:center; justify-content:space-between;
}
.bwcc-pref-header h2 { margin:0; font-size:18px; font-weight:700; }
.bwcc-pref-close {
    background:none; border:none; cursor:pointer;
    font-size:20px; line-height:1; color:#6b7280; padding:4px;
}
.bwcc-pref-close:hover { color:#111; }

.bwcc-pref-body { padding:16px 24px; }

.bwcc-category-item {
    padding:14px 0;
    border-bottom:1px solid #f3f4f6;
}
.bwcc-category-item:last-child { border-bottom:none; }
.bwcc-category-item-head {
    display:flex; align-items:center; justify-content:space-between; gap:12px;
}
.bwcc-category-item-title {
    font-weight:600; font-size:14px; color:#111827;
}
.bwcc-category-item-desc {
    font-size:12px; color:#6b7280; margin-top:4px; margin-right:60px;
}

/* Toggle in preferences */
.bwcc-toggle {
    position:relative; display:inline-block;
    width:44px; height:24px; flex-shrink:0;
}
.bwcc-toggle input { opacity:0; width:0; height:0; position:absolute; }
.bwcc-toggle-slider {
    position:absolute; cursor:pointer; inset:0;
    background:#d1d5db; border-radius:24px; transition:.2s;
}
.bwcc-toggle-slider:before {
    content:""; position:absolute;
    width:18px; height:18px; left:3px; bottom:3px;
    background:#fff; border-radius:50%; transition:.2s;
    box-shadow:0 1px 3px rgba(0,0,0,.2);
}
.bwcc-toggle input:checked + .bwcc-toggle-slider { background:#1d4ed8; }
.bwcc-toggle input:checked + .bwcc-toggle-slider:before { transform:translateX(20px); }
.bwcc-toggle.bwcc-locked .bwcc-toggle-slider { cursor:not-allowed; opacity:.7; background:#6ee7b7; }
.bwcc-toggle.bwcc-locked input:checked + .bwcc-toggle-slider { background:#6ee7b7; }
.bwcc-always-on { font-size:11px; font-weight:600; color:#059669; }

.bwcc-pref-footer {
    padding:16px 24px;
    border-top:1px solid #e5e7eb;
    display:flex; gap:10px; justify-content:flex-end;
}
.bwcc-pref-footer .bwcc-btn { width:auto; }

/* ── Floating button ─────────────────────────────────────────────────────── */
#bwcc-floating-btn {
    position:fixed; bottom:20px;
    z-index:999990;
    background:#1d4ed8; color:#fff;
    border:none; border-radius:50%;
    width:44px; height:44px;
    cursor:pointer; box-shadow:0 4px 14px rgba(29,78,216,.4);
    display:flex; align-items:center; justify-content:center;
    transition:transform .15s, box-shadow .15s;
    opacity:0; pointer-events:none; transform:scale(0);
}
#bwcc-floating-btn.bwcc-visible {
    opacity:1; pointer-events:all; transform:scale(1);
}
#bwcc-floating-btn.bwcc-left  { left:20px; }
#bwcc-floating-btn.bwcc-right { right:20px; }
#bwcc-floating-btn:hover {
    transform:scale(1.1);
    box-shadow:0 6px 20px rgba(29,78,216,.5);
}
#bwcc-floating-btn svg { width:22px; height:22px; fill:currentColor; }

/* ── Animations ─────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion:reduce) {
    #bwcc-consent, #bwcc-overlay, #bwcc-preferences, #bwcc-floating-btn {
        transition:none !important;
    }
}
