/* =========================================================
   BANER COOKIES
   Korzysta ze zmiennych i przyciskow motywu (.btn), zeby wygladal
   jak czesc serwisu, a nie doklejona wtyczka.
   ========================================================= */

.cc[hidden] { display: none; }

/* ---------- Pasek na dole ---------- */
.cc__bar {
    position: fixed;
    left: 16px; right: 16px; bottom: 16px;
    z-index: 9000;
    display: flex;
    align-items: center;
    gap: clamp(16px, 3vw, 40px);
    /* min() zamiast samego 1100px — przy left+right+margin:auto przegladarka
       potrafi rozwiazac szerokosc z tresci i pasek wystaje poza ekran.
       Procent liczy sie tu od bloku zawierajacego, czyli od okna. */
    max-width: min(1100px, calc(100% - 32px));
    margin: 0 auto;
    padding: clamp(18px, 2.4vw, 26px) clamp(20px, 2.6vw, 30px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 60px -24px rgba(26, 26, 46, 0.45);
    animation: cc-in 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}
.cc__bar[hidden] { display: none; }

@keyframes cc-in {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.cc__title {
    margin: 0 0 6px;
    font-size: 1rem;
    letter-spacing: -0.015em;
}
.cc__text p {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.65;
    color: var(--text-secondary);
    max-width: 68ch;
}
.cc__text a { color: var(--accent); }

.cc__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: none;
    flex-wrap: wrap;
}
/* Przyciski banera sa wezsze niz domyslne .btn — pasek ma nie przytlaczac. */
.cc__btn {
    padding: 11px 20px;
    font-size: 0.875rem;
    white-space: normal;
}
.cc__link {
    background: none;
    border: 0;
    padding: 6px 2px;
    font-family: var(--font);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-tertiary);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
.cc__link:hover { color: var(--accent); }

/* ---------- Panel ustawien ---------- */
.cc__overlay {
    position: fixed;
    inset: 0;
    z-index: 9100;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(26, 26, 46, 0.5);
    backdrop-filter: blur(3px);
}
.cc__overlay[hidden] { display: none; }

.cc__panel {
    width: min(620px, 100%);
    max-height: min(86vh, 760px);
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: 0 32px 80px -30px rgba(26, 26, 46, 0.6);
    animation: cc-in 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.cc__panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px;
    border-bottom: 1px solid var(--border);
}
.cc__panel-head h2 { margin: 0; font-size: 1.125rem; letter-spacing: -0.02em; }
.cc__close {
    flex: none;
    width: 36px; height: 36px;
    display: grid;
    place-items: center;
    background: none;
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: color var(--transition), border-color var(--transition);
}
.cc__close:hover { color: var(--text); border-color: var(--border-hover); }

.cc__panel-body {
    padding: 22px 24px;
    overflow-y: auto;
}
.cc__intro {
    margin: 0 0 20px;
    font-size: 0.875rem;
    line-height: 1.65;
    color: var(--text-secondary);
}

.cc__cat {
    padding: 16px 0;
    border-top: 1px solid var(--border);
}
.cc__cat p {
    margin: 10px 0 0;
    font-size: 0.8125rem;
    line-height: 1.68;
    color: var(--text-secondary);
}
.cc__cat code {
    font-family: var(--mono);
    font-size: 0.75rem;
    padding: 1px 5px;
    border-radius: 4px;
    background: var(--bg-soft);
}
.cc__cat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}
.cc__cat-name { font-size: 0.9375rem; font-weight: 600; color: var(--text); }
.cc__always {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
    padding: 3px 10px;
    border-radius: 100px;
}

/* ---------- Przelacznik ---------- */
.cc__switch {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    width: 100%;
}
.cc__switch input {
    position: absolute;
    opacity: 0;
    width: 44px; height: 24px;
    margin: 0;
    cursor: pointer;
}
.cc__slider {
    position: relative;
    flex: none;
    width: 44px; height: 24px;
    border-radius: 100px;
    background: var(--border-hover);
    transition: background var(--transition);
    order: 2;
    margin-left: auto;
}
.cc__slider::after {
    content: "";
    position: absolute;
    top: 3px; left: 3px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: transform var(--transition);
}
.cc__switch input:checked ~ .cc__slider { background: var(--accent); }
.cc__switch input:checked ~ .cc__slider::after { transform: translateX(20px); }
/* Widoczny fokus klawiatury — input jest przezroczysty, wiec sygnal
   musi dac element graficzny. */
.cc__switch input:focus-visible ~ .cc__slider {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.cc__note {
    margin: 20px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 0.8125rem;
    line-height: 1.65;
    color: var(--text-tertiary);
}

.cc__panel-foot {
    display: flex;
    gap: 10px;
    padding: 18px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-soft);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.cc__panel-foot .cc__btn { flex: 1; justify-content: center; }

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
    .cc__bar {
        left: 10px; right: 10px; bottom: 10px;
        max-width: calc(100% - 20px);
        flex-direction: column;
        align-items: stretch;
        gap: 18px;
    }
    .cc__actions { flex-direction: column; align-items: stretch; }
    .cc__actions .cc__btn { width: 100%; justify-content: center; }
    .cc__link { align-self: center; }
    .cc__panel-foot { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    .cc__bar, .cc__panel { animation: none; }
}

/* Link „Ustawienia cookies” w stopce — to <button>, bo nie prowadzi nigdzie,
   tylko otwiera panel. Musi wygladac jak sasiednie linki. */
.footer__cc-link,
.lp-footer__legal .footer__cc-link {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    text-decoration: none;
}
.footer__cc-link:hover { color: var(--accent); }
