/* Wewnętrzny system zgód cookie (CMP). Style oparte o zmienne CSS projektu
   (--color-*) z fallbackami, więc działają nawet bez nich. */
#cookie-consent { position: fixed; inset: 0; z-index: 9999; display: flex;
    align-items: flex-end; justify-content: center; pointer-events: none; }

/* Overlay zaciemniający — blokuje interakcję z tłem, wymusza świadomy wybór.
   To NIE jest cookie wall: treść pozostaje widoczna pod przyciemnieniem. */
#cookie-consent .cc-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.65);
    pointer-events: auto; animation: cc-fade-in .3s ease; }
@keyframes cc-fade-in { from { opacity: 0; } to { opacity: 1; } }

/* Blokada przewijania, dopóki baner jest otwarty (klasa cc-open dodawana przez JS) */
html.cc-open, html.cc-open body { overflow: hidden !important; }

#cookie-consent .cc-box { position: relative; width: 100%; max-width: 1080px; margin: 1rem;
    background: var(--color-bg,#fff); color: var(--color-text,#333);
    border-radius: var(--border-radius-lg,8px);
    border-top: 5px solid var(--color-accent,#ff5722);
    box-shadow: 0 0 0 3px rgba(255,87,34,.25), 0 12px 40px rgba(0,0,0,.45);
    pointer-events: auto; font-family: var(--font-family,sans-serif); font-size: .875rem;
    line-height: 1.6; animation: cc-slide-up .3s ease, cc-attention .6s ease .35s 2; }
#cookie-consent:has(.cc-settings:not([hidden])) { align-items: center; }
#cookie-consent:has(.cc-settings:not([hidden])) .cc-box { max-width: 560px;
    max-height: calc(100vh - 4rem); overflow-y: auto; }
@keyframes cc-slide-up { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes cc-attention { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.015); } }

#cookie-consent .cc-title { font-size: 1.125rem; margin: 0 0 .25rem; color: var(--color-secondary,#212121); }
#cookie-consent .cc-banner { display: flex; align-items: center; gap: 2rem; padding: 1.5rem; }
#cookie-consent .cc-banner__text p { margin: 0; color: var(--color-text-light,#666); }
#cookie-consent .cc-banner__text a { color: var(--color-primary,#c62828); text-decoration: underline; }
#cookie-consent .cc-banner__actions { display: flex; flex-shrink: 0; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; }
#cookie-consent .cc-settings { padding: 1.5rem; }
#cookie-consent .cc-cat { padding: 1rem 0; border-bottom: 1px solid var(--color-border-light,#eee); }
#cookie-consent .cc-cat__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
#cookie-consent .cc-cat__name { font-weight: 600; color: var(--color-secondary,#212121); }
#cookie-consent .cc-cat__badge { font-size: .75rem; color: var(--color-success,#2e7d32); font-weight: 600; }
#cookie-consent .cc-cat__desc { margin: .25rem 0 0; color: var(--color-text-light,#666); }
#cookie-consent .cc-settings__actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; margin-top: 1.5rem; }
#cookie-consent .cc-btn { font-family: inherit; font-size: .875rem; font-weight: 600; padding: .6rem 1.1rem;
    border-radius: var(--border-radius,4px); border: 1px solid transparent; cursor: pointer;
    transition: background .2s ease, color .2s ease; white-space: nowrap; }
#cookie-consent .cc-btn--primary { background: var(--color-primary,#c62828); color: #fff;
    animation: cc-pulse 1.8s ease-in-out infinite; }
#cookie-consent .cc-btn--primary:hover { background: var(--color-primary-dark,#a31f1f); animation: none; }
@keyframes cc-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(198,40,40,.55); }
    70%  { box-shadow: 0 0 0 12px rgba(198,40,40,0); }
    100% { box-shadow: 0 0 0 0 rgba(198,40,40,0); }
}
#cookie-consent .cc-btn--secondary { background: var(--color-bg-light,#f5f5f5); color: var(--color-secondary,#212121); border-color: var(--color-border,#e0e0e0); }
#cookie-consent .cc-btn--secondary:hover { background: var(--color-border-light,#eee); }
#cookie-consent .cc-btn--ghost { background: transparent; color: var(--color-text-light,#666); text-decoration: underline; }
#cookie-consent .cc-btn--ghost:hover { color: var(--color-secondary,#212121); }
#cookie-consent .cc-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
#cookie-consent .cc-switch input { opacity: 0; width: 0; height: 0; }
#cookie-consent .cc-switch__slider { position: absolute; inset: 0; background: var(--color-text-muted,#999); border-radius: 24px; transition: background .2s ease; }
#cookie-consent .cc-switch__slider::before { content: ''; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .2s ease; }
#cookie-consent .cc-switch input:checked + .cc-switch__slider { background: var(--color-success,#2e7d32); }
#cookie-consent .cc-switch input:checked + .cc-switch__slider::before { transform: translateX(20px); }
#cookie-consent .cc-switch input:focus-visible + .cc-switch__slider { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--color-primary,#c62828); }
@media (max-width: 768px) {
    #cookie-consent .cc-banner { flex-direction: column; align-items: stretch; gap: 1rem; }
    #cookie-consent .cc-banner__actions { justify-content: stretch; }
    #cookie-consent .cc-banner__actions .cc-btn { flex: 1 1 auto; }
}
/* Dostępność: wyłącz animacje dla użytkowników z ograniczonym ruchem */
@media (prefers-reduced-motion: reduce) {
    #cookie-consent .cc-box,
    #cookie-consent .cc-btn--primary { animation: none; }
}
