/*
 * Baner zgód cookies. Kolory biorą się ze zmiennych motywu, więc przyciski są zawsze
 * w tym samym kolorze co przyciski na stronie (components/button.php, wariant primary).
 */
.rc-root {
    --rc-accent: var(--color-blue-600, #155dfc);
    --rc-accent-hover: var(--color-blue-700, #1447e6);
    --rc-accent-soft: var(--color-blue-50, #eff6ff);
    --rc-accent-line: var(--color-blue-200, #bedbff);
    --rc-focus: var(--color-blue-500, #2b7fff);
    --rc-heading: var(--color-gray-900, #101828);
    --rc-body: var(--color-gray-600, #4a5565);
    --rc-muted: var(--color-gray-500, #6a7282);
    --rc-line: var(--color-gray-200, #e5e7eb);
    --rc-line-soft: var(--color-gray-100, #f3f4f6);
    --rc-indent: 30px;
    color: var(--rc-body);
    font-size: 14px;
    line-height: 1.5;
}

.rc-root [hidden] {
    display: none !important;
}

.rc-root p {
    margin: 0;
    color: inherit;
}

.rc-root a {
    color: var(--rc-accent);
    text-decoration: none;
    border-bottom: 1px solid var(--rc-accent-line);
}

.rc-root a:hover {
    border-bottom-color: var(--rc-accent);
}

.rc-root :focus-visible {
    outline: 2px solid var(--rc-focus);
    outline-offset: 2px;
}

/* Pasek na dole strony */
.rc-banner {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 999998;
    max-height: 100vh;
    overflow-y: auto;
    background: #fff;
    border-top: 1px solid var(--rc-line);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
}

.rc-banner-inner {
    display: flex;
    align-items: center;
    gap: 32px;
    box-sizing: border-box;
    max-width: 72rem;
    margin: 0 auto;
    padding: 16px;
}

.rc-banner-copy {
    flex: 1;
    min-width: 0;
}

.rc-root .rc-title {
    margin-bottom: 4px;
    color: var(--rc-heading);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;
}

.rc-buttons {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 8px;
}

.rc-btn {
    box-sizing: border-box;
    min-height: 40px;
    margin: 0;
    padding: 8px 20px;
    border: 2px solid var(--rc-accent);
    border-radius: 6px;
    background: var(--rc-accent);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    text-align: center;
    text-transform: none;
    white-space: nowrap;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.rc-btn:hover {
    border-color: var(--rc-accent-hover);
    background: var(--rc-accent-hover);
}

.rc-btn-outline {
    background: transparent;
    color: var(--rc-accent);
    box-shadow: none;
}

.rc-btn-outline:hover {
    border-color: var(--rc-accent);
    background: var(--rc-accent-soft);
}

/* Okno ustawień */
.rc-overlay {
    position: fixed;
    inset: 0;
    z-index: 999998;
    background: rgba(0, 0, 0, 0.6);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.rc-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    width: 42rem;
    max-width: calc(100% - 32px);
    max-height: 85vh;
    overflow: hidden;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: translate(-50%, -50%);
}

.rc-modal:focus {
    outline: 0;
}

.rc-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--rc-line-soft);
}

.rc-root .rc-modal-title {
    color: var(--rc-heading);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.5;
}

.rc-close {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    min-height: 0;
    margin: 0;
    padding: 6px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--color-gray-400, #99a1af);
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.rc-close:hover {
    background: var(--rc-line-soft);
    color: var(--rc-body);
}

.rc-modal-body {
    flex: 1;
    box-sizing: border-box;
    padding: 20px 24px 8px;
    overflow: auto;
}

.rc-modal-intro {
    padding-bottom: 20px;
}

.rc-modal-footer {
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: 1px solid var(--rc-line-soft);
}

/* Kategorie */
.rc-category {
    padding: 16px 0;
    border-top: 1px solid var(--rc-line-soft);
}

.rc-option {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.rc-check {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--rc-accent);
    cursor: pointer;
}

.rc-check:disabled {
    cursor: default;
}

.rc-option:has(.rc-check:disabled) {
    cursor: default;
}

.rc-option-title {
    color: var(--rc-heading);
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
}

.rc-always {
    margin-left: auto;
    color: var(--rc-muted);
    font-size: 13px;
}

.rc-root .rc-category-text {
    margin: 4px 0 0 var(--rc-indent);
}

.rc-details {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 0;
    margin: 8px 0 0 var(--rc-indent);
    padding: 0;
    border: 0;
    background: none;
    color: var(--rc-accent);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    text-transform: none;
    cursor: pointer;
}

.rc-details:hover {
    color: var(--rc-accent-hover);
}

.rc-chevron {
    flex-shrink: 0;
    transition: transform 0.2s;
}

.rc-details[aria-expanded="true"] .rc-chevron {
    transform: rotate(180deg);
}

.rc-cookies {
    margin: 8px 0 0 var(--rc-indent);
    padding: 0;
    list-style: none;
}

.rc-cookie {
    margin: 0;
    padding: 10px 0;
    border-top: 1px solid var(--rc-line-soft);
    font-size: 13px;
}

.rc-cookie:last-child {
    padding-bottom: 0;
}

.rc-cookie-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0 16px;
}

.rc-cookie-name {
    min-width: 0;
    color: var(--rc-heading);
    font-weight: 600;
    overflow-wrap: anywhere;
}

.rc-cookie-time {
    color: var(--rc-muted);
}

/* Przycisk ponownego otwarcia ustawień */
.rc-revisit {
    position: fixed;
    bottom: 16px;
    left: 16px;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: var(--rc-accent);
    color: #fff;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: background-color 0.2s;
}

.rc-revisit:hover {
    background: var(--rc-accent-hover);
}

@media (max-width: 1023px) {
    .rc-banner-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .rc-banner .rc-buttons {
        justify-content: flex-end;
    }

    /* Na stronach z dolnym paskiem telefon/formularz przycisk siedzi nad paskiem. */
    body:has(.sticky-cta) .rc-revisit {
        bottom: 84px;
    }
}

@media (max-width: 639px) {
    /* Odrzucenie i akceptacja obok siebie, tej samej wielkości, ustawienia pod nimi. */
    .rc-root .rc-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: stretch;
        gap: 8px;
    }

    .rc-btn {
        min-width: 0;
        min-height: 44px;
        padding: 10px 4px;
        white-space: normal;
    }

    .rc-btn-outline {
        grid-column: 1 / -1;
        order: 1;
    }

    .rc-modal {
        width: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .rc-modal-header {
        padding: 16px;
    }

    .rc-modal-body {
        padding: 16px 16px 8px;
    }

    .rc-modal-footer {
        padding: 12px 16px;
    }

    .rc-root {
        --rc-indent: 0;
    }
}

@media print {
    .rc-root {
        display: none;
    }
}
