/* Motyw przez zmienne CSS (ustaw na :root w aplikacji), np.:
   :root { --cc-primary: var(--mud-palette-primary); }
   Dostępne: --cc-primary, --cc-banner-bg, --cc-banner-fg, --cc-link, --cc-modal-bg, --cc-modal-fg,
             --cc-radius, --cc-z-index */

#cookie-consent-root [hidden] {
    display: none !important;
}

.cc-banner {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: var(--cc-z-index, 1200);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: 720px;
    margin: 0 auto;
    padding: 1rem 1.25rem;
    background: var(--cc-banner-bg, #1c1c1e);
    color: var(--cc-banner-fg, #f2f2f2);
    border-radius: var(--cc-radius, 10px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
    font-family: inherit;
}

.cc-banner__text {
    flex: 1 1 320px;
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
}

.cc-banner__text a {
    color: var(--cc-link, #9dc4ff);
    text-decoration: underline;
}

.cc-banner__actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.cc-btn {
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.cc-btn--primary {
    background: var(--cc-primary, #1976d2);
    color: #fff;
}

.cc-btn--ghost {
    background: transparent;
    color: inherit;
    border-color: currentColor;
}

.cc-btn--outline {
    background: transparent;
    color: var(--cc-primary, #1976d2);
    border-color: var(--cc-primary, #1976d2);
}

/* w banerze (ciemne tło) przycisk "Odrzuć" ma być czytelny jak pozostałe */
.cc-banner .cc-btn--outline {
    color: inherit;
    border-color: currentColor;
}

.cc-overlay {
    position: fixed;
    inset: 0;
    z-index: calc(var(--cc-z-index, 1200) + 100);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.5);
    font-family: inherit;
}

.cc-modal {
    width: 100%;
    max-width: 480px;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    background: var(--cc-modal-bg, #fff);
    color: var(--cc-modal-fg, #1c1c1e);
    border-radius: var(--cc-radius, 10px);
    padding: 1.5rem;
    outline: none;
}

.cc-modal h2 {
    margin: 0 0 0.5rem;
    font-size: 1.125rem;
}

.cc-modal__intro {
    margin: 0 0 1.25rem;
    font-size: 0.875rem;
    opacity: 0.75;
}

.cc-category {
    padding: 0.75rem 0;
    border-top: 1px solid rgba(128, 128, 128, 0.25);
}

.cc-category__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.cc-category__name {
    font-weight: 600;
    font-size: 0.9375rem;
}

.cc-category__desc {
    margin: 0.375rem 0 0;
    font-size: 0.8125rem;
    line-height: 1.4;
    opacity: 0.7;
}

.cc-switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 22px;
    flex-shrink: 0;
}

.cc-switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.cc-switch__track {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 999px;
    transition: background 0.15s ease;
    pointer-events: none;
}

.cc-switch__track::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.15s ease;
}

.cc-switch input:checked + .cc-switch__track {
    background: var(--cc-primary, #1976d2);
}

.cc-switch input:checked + .cc-switch__track::before {
    transform: translateX(16px);
}

.cc-switch input:focus-visible + .cc-switch__track,
.cc-btn:focus-visible {
    outline: 2px solid var(--cc-primary, #1976d2);
    outline-offset: 2px;
}

.cc-switch--disabled {
    opacity: 0.6;
}

.cc-modal__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(128, 128, 128, 0.25);
}

@media (max-width: 480px) {
    .cc-banner__actions {
        width: 100%;
    }

    .cc-btn {
        flex: 1;
    }

    .cc-modal__actions {
        flex-direction: column-reverse;
    }

    .cc-modal__actions .cc-btn {
        width: 100%;
    }
}
