/**
 * BCC Cookie Consent — Frontend Styles
 *
 * Uses CSS custom properties (--bcc-*) injected from PHP settings.
 * Fallback values match bcc_default_settings().
 */

/* ── Overlay ───────────────────────────────────────────── */
.bcc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999998;
}

/* ── Banner (base) ────────────────────────────────────── */
.bcc-banner {
    position: fixed;
    z-index: 999999;
    background: var(--bcc-bg, #fff);
    color: var(--bcc-text, #1e293b);
    border-radius: var(--bcc-banner-radius, 0px);
    border: var(--bcc-banner-border, none);
    box-shadow: var(--bcc-banner-shadow, 0 -2px 16px rgba(0, 0, 0, 0.12));
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

/* ── Position variants ────────────────────────────────── */
.bcc-banner--bottom {
    bottom: 0;
    left: 0;
    right: 0;
}

.bcc-banner--top {
    top: 0;
    left: 0;
    right: 0;
}

.bcc-banner--center {
    top: 50%;
    left: 50%;
    right: auto;
    transform: translate(-50%, -50%);
    max-width: 540px;
    width: 90%;
    border-radius: var(--bcc-banner-radius, 12px);
}

.bcc-banner--bottom-left {
    bottom: 20px;
    left: 20px;
    right: auto;
    max-width: 420px;
}

.bcc-banner--bottom-right {
    bottom: 20px;
    right: 20px;
    left: auto;
    max-width: 420px;
}

/* ── Layout: bar (default — horizontal) ───────────────── */
.bcc-banner--bar .bcc-banner__inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

/* Narrow width variant for bar */
.bcc-banner--bar.bcc-banner--narrow .bcc-banner__inner {
    max-width: 540px;
}

/* ── Layout: box (compact, vertical) ──────────────────── */
.bcc-banner--box .bcc-banner__inner {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    text-align: center;
    gap: 16px;
}

/* ── Layout: popup (modal centrat) ────────────────────── */
.bcc-banner--popup .bcc-banner__inner {
    padding: 24px;
    display: flex;
    flex-direction: column;
    text-align: center;
    gap: 16px;
}

/* ── Banner text ──────────────────────────────────────── */
.bcc-banner__text {
    flex: 1;
    min-width: 280px;
}

.bcc-banner__text strong {
    display: block;
    font-size: 16px;
    margin-bottom: 4px;
}

.bcc-banner__text p {
    margin: 0;
    color: var(--bcc-text-sec, #475569);
}

.bcc-banner__text a {
    color: var(--bcc-primary, #2563eb);
    text-decoration: underline;
}

/* ── Banner logo ──────────────────────────────────────── */
.bcc-banner__logo {
    width: 100%;
    flex-shrink: 0;
    text-align: var(--bcc-logo-align, center);
    margin-bottom: var(--bcc-logo-margin, 12px);
}

.bcc-banner__logo img,
.bcc-prefs__logo img {
    display: inline-block;
    height: auto;
}

.bcc-banner__logo a,
.bcc-prefs__logo a {
    display: inline-block;
}

.bcc-prefs__logo {
    padding: 12px 24px 0;
    text-align: var(--bcc-logo-align, center);
    margin-bottom: var(--bcc-logo-margin, 12px);
}

/* ── Banner actions ───────────────────────────────────── */
.bcc-banner__actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

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

/* Center actions for box, popup, center, corner layouts */
.bcc-banner--box .bcc-banner__actions,
.bcc-banner--popup .bcc-banner__actions,
.bcc-banner--center .bcc-banner__actions {
    justify-content: center;
    width: 100%;
}

/* ── Buttons ──────────────────────────────────────────── */
.bcc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: var(--bcc-btn-height, 44px);
    padding: 0 20px;
    border-radius: var(--bcc-btn-radius, 6px);
    font-size: var(--bcc-btn-font-size, 14px);
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.2s, color 0.2s, opacity 0.2s;
    white-space: nowrap;
    font-family: inherit;
}

.bcc-btn:hover {
    opacity: 0.85;
}

.bcc-btn--primary {
    background: var(--bcc-btn-accept-bg, #2563eb);
    color: var(--bcc-btn-accept-text, #fff);
    border: 2px solid var(--bcc-btn-accept-border, #2563eb);
}

.bcc-btn--secondary {
    background: var(--bcc-btn-reject-bg, #fff);
    color: var(--bcc-btn-reject-text, #2563eb);
    border: 2px solid var(--bcc-btn-reject-border, #2563eb);
}

.bcc-btn--link {
    background: var(--bcc-btn-prefs-bg, transparent);
    color: var(--bcc-btn-prefs-text, #2563eb);
    border: 2px solid var(--bcc-btn-prefs-border, transparent);
}

/* ── Preferences Panel ────────────────────────────────── */
.bcc-prefs {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 999999;
    width: 90%;
    max-width: var(--bcc-prefs-width, 520px);
    max-height: 85vh;
    background: var(--bcc-bg, #fff);
    border-radius: var(--bcc-prefs-radius, 12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    color: var(--bcc-text, #1e293b);
    line-height: 1.5;
    overflow: hidden;
}

.bcc-prefs__inner {
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}

.bcc-prefs__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 12px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.bcc-prefs__header strong {
    font-size: 18px;
}

.bcc-prefs__close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #94a3b8;
    padding: 0 4px;
    line-height: 1;
}

.bcc-prefs__close:hover {
    color: #334155;
}

.bcc-prefs__body {
    padding: 16px 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.bcc-prefs__body > p {
    margin: 0 0 16px;
    color: var(--bcc-text-sec, #475569);
}

.bcc-prefs__footer {
    display: flex;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    justify-content: flex-end;
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* ── Category ─────────────────────────────────────────── */
.bcc-category {
    padding: 14px 0;
    border-bottom: 1px solid #f1f5f9;
}

.bcc-category:last-child {
    border-bottom: none;
}

.bcc-category__header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bcc-category__title {
    font-weight: 600;
    font-size: 15px;
}

.bcc-category__desc {
    margin: 6px 0 0;
    padding-left: 52px;
    color: var(--bcc-text-sec, #64748b);
    font-size: 13px;
}

/* ── Badge ────────────────────────────────────────────── */
.bcc-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.bcc-badge--always {
    background: #dcfce7;
    color: #166534;
}

/* ── Toggle switch ────────────────────────────────────── */
.bcc-toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}

.bcc-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.bcc-toggle__slider {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 22px;
    cursor: pointer;
    transition: background 0.2s;
}

.bcc-toggle__slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.bcc-toggle input:checked + .bcc-toggle__slider {
    background: var(--bcc-primary, #2563eb);
}

.bcc-toggle input:checked + .bcc-toggle__slider::before {
    transform: translateX(18px);
}

.bcc-toggle input:disabled + .bcc-toggle__slider {
    background: #94a3b8;
    cursor: not-allowed;
}

.bcc-toggle input:disabled:checked + .bcc-toggle__slider {
    background: #60a5fa;
}

/* ── Floating button ──────────────────────────────────── */
.bcc-float {
    position: fixed;
    bottom: 12px;
    z-index: 999997;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--bcc-float-bg, #1e3a5f);
    border: none;
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.bcc-float--left {
    left: 24px;
}

.bcc-float--right {
    right: 24px;
}

.bcc-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(30, 58, 95, 0.5);
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 640px) {
    /* Bar layout becomes stacked on mobile */
    .bcc-banner--bar .bcc-banner__inner {
        flex-direction: column;
        padding: 16px;
        gap: 12px;
    }

    .bcc-banner__actions {
        width: 100%;
        flex-direction: column;
    }

    .bcc-banner__actions .bcc-btn {
        flex: none;
        width: 100%;
        height: var(--bcc-btn-height-mobile, 48px);
        font-size: var(--bcc-btn-font-size-mobile, 14px);
    }

    /* Corner layouts become full-width bottom bar on mobile */
    .bcc-banner--bottom-left,
    .bcc-banner--bottom-right {
        left: 0;
        right: 0;
        bottom: 0;
        max-width: none;
        border-radius: 0;
    }

    /* Popup / center on mobile */
    .bcc-banner--center,
    .bcc-banner--popup {
        width: 95%;
        max-height: 90vh;
    }

    .bcc-prefs {
        width: 95%;
        max-height: 90vh;
    }

    .bcc-prefs__footer {
        flex-direction: column;
    }

    .bcc-category__desc {
        padding-left: 0;
        margin-top: 8px;
    }
}
