/* KURS SKRACZA — Cookie consent */

.cookie-banner[hidden],
.cookie-settings-overlay[hidden] {
    display: none !important;
}

.cookie-banner,
.cookie-settings-dialog {
    box-sizing: border-box;
    background: var(--ks-surface, #ffffff);
    color: var(--ks-ink, #222337);
    border: 1px solid var(--ks-border, #e5e2de);
    border-radius: 14px;
    font-family: inherit;
    box-shadow: 0 8px 35px rgba(0, 0, 0, 0.12);
}

/* Baner */

.cookie-banner {
    position: fixed;
    z-index: 99999;
    left: 20px;
    right: 20px;
    bottom: 20px;
    max-width: 660px;
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    margin: 0 auto;
    padding: 26px;
    animation: cookie-appear 0.25s ease-out;
}

.cookie-banner h2,
.cookie-settings-dialog h2 {
    margin: 0 0 14px;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
}

.cookie-banner p,
.cookie-settings-dialog p {
    margin: 0 0 12px;
    color: var(--ks-muted, #585b6b);
    font-size: 14px;
    line-height: 1.65;
}

.cookie-banner p:last-child,
.cookie-settings-dialog p:last-child {
    margin-bottom: 0;
}

/* Linki */

.cookie-link {
    color: var(--ks-primary-ink, #a84505);
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 600;
}

.cookie-link:hover {
    text-decoration-thickness: 2px;
}

/* Przyciski */

.cookie-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 20px;
}

.cookie-button {
    min-height: 44px;
    padding: 11px 16px;
    border: 1px solid var(--ks-border, #e5e2de);
    border-radius: 8px;
    background: var(--ks-surface, #ffffff);
    color: var(--ks-ink, #222337);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition:
        background 0.15s ease,
        border-color 0.15s ease;
}

.cookie-button:hover {
    background: var(--ks-bg, #faf9f7);
}

/* Akceptacja i odrzucenie mają identyczny wygląd */

.cookie-button-primary {
    background: var(--ks-primary, #f9943b);
    border-color: var(--ks-primary, #f9943b);
    color: #1f1f1f;
}

.cookie-button-primary:hover {
    background: var(--ks-primary-hover, #ffab63);
    border-color: var(--ks-primary-hover, #ffab63);
}

.cookie-button-settings {
    grid-column: 1 / -1;
}

.cookie-button:focus-visible,
.cookie-link:focus-visible,
.footer-cookie-settings:focus-visible {
    outline: 2px solid var(--ks-primary-ink, #a84505);
    outline-offset: 3px;
}

/* Modal ustawień */

.cookie-settings-overlay {
    position: fixed;
    z-index: 100000;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(20, 20, 30, 0.5);
}

.cookie-settings-dialog {
    width: 100%;
    max-width: 540px;
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    padding: 28px;
    animation: cookie-appear 0.2s ease-out;
}

/* Kategorie cookies */

.cookie-category {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 0;
    border-bottom: 1px solid var(--ks-border, #e5e2de);
}

.cookie-category strong {
    display: block;
    margin-bottom: 5px;
    font-size: 15px;
    font-weight: 600;
}

.cookie-category p {
    margin: 0;
    font-size: 13px;
}

.cookie-always-active {
    flex-shrink: 0;
    color: var(--ks-muted, #585b6b);
    background: var(--ks-bg, #faf9f7);
    border: 1px solid var(--ks-border, #e5e2de);
    padding: 6px 9px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.cookie-settings-info {
    margin-top: 18px !important;
}

/* Przełącznik */

.cookie-switch {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
    width: 48px;
    height: 28px;
}

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

.cookie-slider {
    position: absolute;
    inset: 0;
    background: #a1a1aa;
    border-radius: 20px;
    pointer-events: none;
    transition: background 0.2s ease;
}

.cookie-slider::before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    left: 4px;
    bottom: 4px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.cookie-switch input:checked + .cookie-slider {
    background: var(--ks-primary, #f9943b);
}

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

.cookie-switch input:focus-visible + .cookie-slider {
    outline: 2px solid var(--ks-primary-ink, #a84505);
    outline-offset: 3px;
}

/* Ustawienia cookies w stopce */

.footer-cookie-settings {
    display: block;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.footer-cookie-settings:hover {
    text-decoration: underline;
}

/* Animacje */

@keyframes cookie-appear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .cookie-banner,
    .cookie-settings-dialog {
        animation: none;
    }

    .cookie-button,
    .cookie-slider,
    .cookie-slider::before {
        transition: none;
    }
}

/* Responsywność */

@media (max-width: 520px) {
    .cookie-banner {
        left: 10px;
        right: 10px;
        bottom: 10px;
        max-height: calc(100dvh - 20px);
        padding: 20px;
    }

    .cookie-buttons {
        grid-template-columns: 1fr;
    }

    .cookie-button {
        width: 100%;
    }

    .cookie-settings-overlay {
        padding: 10px;
    }

    .cookie-settings-dialog {
        padding: 20px;
        max-height: calc(100dvh - 20px);
    }

    .cookie-category {
        gap: 12px;
    }

    .cookie-always-active {
        max-width: 85px;
        white-space: normal;
        text-align: center;
    }
}