/* === Cookie consent banner — Bcm (ported from foxlp) === */

:root {
    --foxlp-orange: var(--wg-accent, #1D4ED8);
    --foxlp-orange-hover: var(--wg-accent-hover, #1E40AF);
    --foxlp-text: var(--wg-text, #0F172A);
    --foxlp-text-muted: var(--wg-text-muted, #475569);
    --foxlp-text-light: #64748B;
    --foxlp-border: var(--wg-border, #E2E8F0);
    --foxlp-bg-alt: var(--wg-bg-elevated, #F8FAFC);
    --foxlp-green: var(--wg-evergreen, #047857);
}

.wg-consent {
    font-family: inherit;
    color: var(--foxlp-text);
}

.wg-consent[hidden] { display: none; }

body.wg-consent-open { overflow: hidden; }

/* === Bottom bar (initial prompt) — centered card === */
.wg-consent__bar {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 16px;
    width: calc(100vw - 32px);
    max-width: 880px;
    z-index: 9999;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22), 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--foxlp-border);
}

.wg-consent__bar[hidden] { display: none; }

.wg-consent__bar-inner {
    padding: 20px 24px;
}

@media (min-width: 900px) {
    .wg-consent__bar { bottom: 24px; }
    .wg-consent__bar-inner {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 28px;
        align-items: center;
        padding: 22px 28px;
    }
}

.wg-consent__content h3 {
    margin: 0 0 6px;
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--foxlp-text);
}

.wg-consent__content p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--foxlp-text-muted);
}

.wg-consent__buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

@media (min-width: 900px) {
    .wg-consent__buttons {
        margin-top: 0;
        flex-wrap: nowrap;
    }
}

/* === Buttons (shared) === */
.wg-consent__btn {
    appearance: none;
    border: 1.5px solid var(--foxlp-orange);
    background: transparent;
    color: var(--foxlp-orange);
    padding: 11px 20px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.92rem;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease, transform 0.05s ease;
    line-height: 1.2;
}

.wg-consent__btn:hover {
    background: var(--foxlp-orange);
    color: #fff;
}

.wg-consent__btn:active { transform: scale(0.98); }

.wg-consent__btn--primary {
    background: var(--foxlp-orange);
    color: #fff;
}

.wg-consent__btn--primary:hover {
    background: var(--foxlp-orange-hover);
    color: #fff;
}

.wg-consent__btn:focus-visible {
    outline: 2px solid var(--foxlp-orange);
    outline-offset: 3px;
}

@media (max-width: 899px) {
    .wg-consent__bar .wg-consent__buttons {
        flex-direction: column;
        gap: 8px;
    }
    .wg-consent__bar .wg-consent__buttons .wg-consent__btn {
        width: 100%;
        padding: 12px 16px;
        font-size: 0.9rem;
        white-space: normal;
    }
    /* Akceptuj na górze — najważniejszy CTA */
    .wg-consent__bar .wg-consent__buttons .wg-consent__btn--primary {
        order: -1;
    }
}

/* === Backdrop (dim za detail modalem) === */
.wg-consent__backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9999;
    animation: foxlp-fade-in 0.18s ease;
}

.wg-consent__backdrop[hidden] { display: none; }

@keyframes foxlp-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes foxlp-modal-in {
    from { opacity: 0; transform: translate(-50%, -45%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

/* === Detail modal === */
.wg-consent__detail {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(760px, calc(100vw - 24px));
    max-height: calc(100vh - 32px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 10000;
    animation: foxlp-modal-in 0.22s ease;
}

.wg-consent__detail[hidden] { display: none; }

@media (max-width: 599px) {
    .wg-consent__detail {
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        top: 0;
        left: 0;
        transform: none;
        border-radius: 0;
        animation: none;
    }
}

.wg-consent__detail-header {
    padding: 22px 28px 18px;
    border-bottom: 1px solid var(--foxlp-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    gap: 16px;
}

.wg-consent__detail-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
}

@media (max-width: 599px) {
    .wg-consent__detail-header { padding: 18px 20px 14px; }
    .wg-consent__detail-header h3 { font-size: 1.1rem; }
}

.wg-consent__close {
    appearance: none;
    background: none;
    border: 0;
    cursor: pointer;
    color: var(--foxlp-text-light);
    padding: 4px;
    flex-shrink: 0;
    border-radius: 8px;
    display: flex;
    transition: background 0.15s, color 0.15s;
}

.wg-consent__close:hover {
    color: var(--foxlp-text);
    background: var(--foxlp-bg-alt);
}

.wg-consent__close:focus-visible {
    outline: 2px solid var(--foxlp-orange);
    outline-offset: 2px;
}

/* === Body === */
.wg-consent__detail-body {
    padding: 4px 28px 4px;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 599px) {
    .wg-consent__detail-body { padding: 4px 20px; }
}

.wg-consent__intro {
    padding: 20px 0;
    border-bottom: 1px solid var(--foxlp-border);
}

.wg-consent__intro p {
    font-size: 0.92rem;
    color: var(--foxlp-text-muted);
    line-height: 1.6;
    margin: 0 0 10px;
}

.wg-consent__intro p:last-child { margin-bottom: 0; }

/* === Category block === */
.wg-consent__category {
    padding: 18px 0;
    border-bottom: 1px solid var(--foxlp-border);
}

.wg-consent__category:last-child { border-bottom: 0; }

.wg-consent__cat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}

.wg-consent__cat-toggle {
    appearance: none;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: inherit;
    color: var(--foxlp-text);
    text-align: left;
    flex: 1;
    min-width: 0;
}

.wg-consent__cat-chevron {
    display: inline-block;
    font-size: 1.5rem;
    color: var(--foxlp-text-light);
    line-height: 1;
    transition: transform 0.18s ease;
    flex-shrink: 0;
    width: 14px;
    text-align: center;
}

.wg-consent__cat-toggle[aria-expanded="true"] .wg-consent__cat-chevron {
    transform: rotate(90deg);
}

.wg-consent__cat-name {
    font-weight: 700;
    font-size: 1.05rem;
}

.wg-consent__always-active {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--foxlp-green);
    flex-shrink: 0;
    white-space: nowrap;
}

.wg-consent__cat-desc {
    font-size: 0.9rem;
    color: var(--foxlp-text-muted);
    line-height: 1.6;
    margin-left: 24px;
}

@media (max-width: 599px) {
    .wg-consent__cat-name { font-size: 1rem; }
    .wg-consent__cat-desc { font-size: 0.88rem; margin-left: 0; }
}

.wg-consent__cookies {
    margin: 14px 0 0 24px;
}

.wg-consent__cookies[hidden] { display: none; }

@media (max-width: 599px) {
    .wg-consent__cookies { margin-left: 0; }
}

/* === Toggle switch === */
.wg-consent__toggle {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    flex-shrink: 0;
    cursor: pointer;
}

.wg-consent__toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.wg-consent__toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #cfd5d2;
    border-radius: 26px;
    transition: background 0.2s ease;
}

.wg-consent__toggle-slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.wg-consent__toggle input:checked + .wg-consent__toggle-slider {
    background: var(--foxlp-orange);
}

.wg-consent__toggle input:checked + .wg-consent__toggle-slider::before {
    transform: translateX(20px);
}

.wg-consent__toggle input:focus-visible + .wg-consent__toggle-slider {
    outline: 2px solid var(--foxlp-orange);
    outline-offset: 2px;
}

/* === Cookie table === */
.wg-consent__cookie-table {
    list-style: none;
    padding: 0;
    margin: 0;
    background: var(--foxlp-bg-alt);
    border: 1px solid var(--foxlp-border);
    border-radius: 10px;
    overflow: hidden;
}

.wg-consent__cookie-table li {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--foxlp-border);
    font-size: 0.82rem;
}

.wg-consent__cookie-table li:last-child { border-bottom: 0; }

.wg-consent__cookie-name {
    font-family: 'SFMono-Regular', Menlo, Monaco, Consolas, monospace;
    font-weight: 600;
    color: var(--foxlp-text);
    font-size: 0.86rem;
}

.wg-consent__cookie-duration {
    color: var(--foxlp-text-light);
    font-size: 0.78rem;
}

.wg-consent__cookie-duration::before {
    content: 'Czas: ';
    color: var(--foxlp-text-light);
    opacity: 0.7;
}

.wg-consent__cookie-desc {
    color: var(--foxlp-text-muted);
    line-height: 1.5;
    margin-top: 2px;
}

.wg-consent__empty {
    font-style: italic;
    color: var(--foxlp-text-light);
    font-size: 0.88rem;
    margin: 0;
    padding: 12px 14px;
    background: var(--foxlp-bg-alt);
    border: 1px solid var(--foxlp-border);
    border-radius: 10px;
}

/* === Detail footer buttons === */
.wg-consent__detail-buttons {
    padding: 18px 28px;
    border-top: 1px solid var(--foxlp-border);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    flex-shrink: 0;
    background: #fff;
}

@media (max-width: 599px) {
    .wg-consent__detail-buttons {
        padding: 14px 20px;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .wg-consent__detail-buttons .wg-consent__btn--primary { order: -1; }
}

.wg-consent__detail-buttons .wg-consent__btn {
    padding: 13px 16px;
    font-size: 0.92rem;
    width: 100%;
}

/* === Trustindex placeholder (gdy brak zgody functional) === */
.trustindex-placeholder {
    background: #fff;
    border: 1px solid var(--foxlp-border);
    border-radius: 16px;
    padding: 32px 28px;
    text-align: center;
    max-width: 640px;
    margin: 0 auto;
}

.trustindex-placeholder p {
    margin: 0 0 18px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--foxlp-text-muted);
}

@media (max-width: 599px) {
    .trustindex-placeholder { padding: 24px 18px; }
}

/* === Reopen floating button === */
.wg-consent-reopen {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 0;
    background: #fff;
    color: var(--foxlp-orange);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.wg-consent-reopen[hidden] { display: none; }

.wg-consent-reopen:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.22);
}

.wg-consent-reopen:focus-visible {
    outline: 2px solid var(--foxlp-orange);
    outline-offset: 3px;
}

@media (max-width: 599px) {
    .wg-consent-reopen { bottom: 16px; left: 16px; }
}
