/* Zgoda na pliki cookies - baner i ustawienia.
   Kolory z brandbooka (narzedzia/styl/tailwind.config.js, klucz "brand").
   Osobny plik, a nie klasy Tailwinda: arkusz zasoby/styl.css jest budowany
   z szablonow i nowych klas by w nim nie bylo bez przebudowy. */

.zgoda[hidden],
.zgoda [hidden] { display: none !important; }

/* Ten sam pierscien fokusu co na nautil.pl (zrodlo.css). Powtorzony tutaj, bo
   baner stoi tez w aplikacjach poza CMS-em (generator deklaracji). */
.zgoda *:focus-visible {
    outline: none !important;
    box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 5px #1E1E1E !important;
}

.zgoda {
    position: fixed;
    left: 24px;
    bottom: 24px;
    z-index: 2147483000; /* nad przyklejonym naglowkiem i czatem Odoo */
    width: min(560px, calc(100vw - 48px));
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    background: #FFFFFF;
    color: #1E1E1E;
    border: 1px solid rgba(30, 30, 30, .10);
    border-radius: 24px;
    box-shadow: 0 18px 50px -12px rgba(30, 30, 30, .28), 0 2px 6px rgba(30, 30, 30, .06);
    padding: 28px;
    font-family: inherit;
    line-height: 1.55;
    animation: zgoda-wjazd .35s ease-out;
}

@keyframes zgoda-wjazd {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: none; }
}

.zgoda__naglowek {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.zgoda__ikona {
    flex: none;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #F6D59F;
}
.zgoda__ikona svg { width: 28px; height: 28px; }

.zgoda__tytul {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
}
.zgoda__tytul:focus { outline: none; }
.zgoda__tytul:focus-visible { border-radius: 6px; }

.zgoda__opis {
    margin: 0 0 20px;
    font-size: 15px;
}
.zgoda__opis a {
    color: #1E1E1E;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.zgoda__opis a:hover { text-decoration-thickness: 2px; }

/* --- kategorie --- */
.zgoda__ustawienia {
    margin: 0 0 20px;
    padding: 0;
    border: 0;
    display: grid;
    gap: 10px;
}
.zgoda__legenda {
    float: none;        /* Bootstrap (generator deklaracji) daje legend float:left */
    width: 100%;
    line-height: 1.4;
    padding: 0;
    margin-bottom: 4px;
    font-size: 15px;
    font-weight: 700;
}
.zgoda__kategoria {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    background: #F7F5F2;
    border: 1px solid rgba(30, 30, 30, .06);
    border-radius: 16px;
}
.zgoda__kategoria-nazwa {
    display: block;
    font-weight: 700;
    font-size: 15px;
}
.zgoda__kategoria-opis {
    display: block;
    margin-top: 2px;
    font-size: 14px;
    color: #4A4A4A; /* 8.9:1 na #F7F5F2 */
}
.zgoda__zawsze {
    flex: none;
    align-self: center;
    padding: 4px 12px;
    border-radius: 999px;
    background: #C0CAB7;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

/* Przelacznik: natywny checkbox z role="switch". Obwodka #707070 ma 4.6:1
   na tle kategorii (WCAG 1.4.11 wymaga 3:1). */
.zgoda__przelacznik {
    flex: none;
    align-self: center;
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    width: 48px;
    height: 28px;
    margin: 0;
    border: 2px solid #707070;
    border-radius: 999px;
    background: #FFFFFF;
    cursor: pointer;
    transition: background-color .2s, border-color .2s;
}
.zgoda__przelacznik::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #707070;
    transition: transform .2s, background-color .2s;
}
.zgoda__przelacznik:checked {
    background: #1E1E1E;
    border-color: #1E1E1E;
}
.zgoda__przelacznik:checked::after {
    transform: translateX(20px);
    background: #FFFFFF;
}

/* --- przyciski --- */
.zgoda__przyciski {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.zgoda__btn {
    flex: 1 1 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 20px;
    border-radius: 12px;
    border: 2px solid #1E1E1E;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color .2s, color .2s, border-color .2s;
}
.zgoda__btn--glowny {
    background: #1E1E1E;
    color: #FFFFFF;
}
.zgoda__btn--glowny:hover { background: #000000; border-color: #000000; }
.zgoda__btn--drugi {
    background: transparent;
    color: #1E1E1E;
}
.zgoda__btn--drugi:hover { background: #E7DED3; }

/* Odpornosc na cudze arkusze. Baner stoi tez w WordPressie (motyw Hello
   Elementor stylizuje [type=button] na rozowo i laduje sie PO tym pliku) oraz
   w generatorze na Bootstrapie. Identyfikator przebija ich selektory. */
#zgoda-cookies .zgoda__btn,
#zgoda-cookies .zgoda__btn:focus {
    border: 2px solid #1E1E1E;
    border-radius: 12px;
    padding: 12px 20px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    text-transform: none;
    letter-spacing: normal;
    text-decoration: none;
    white-space: normal;
}
#zgoda-cookies .zgoda__btn--glowny,
#zgoda-cookies .zgoda__btn--glowny:focus { background: #1E1E1E; color: #FFFFFF; }
#zgoda-cookies .zgoda__btn--glowny:hover { background: #000000; border-color: #000000; color: #FFFFFF; }
#zgoda-cookies .zgoda__btn--drugi,
#zgoda-cookies .zgoda__btn--drugi:focus { background: transparent; color: #1E1E1E; }
#zgoda-cookies .zgoda__btn--drugi:hover { background: #E7DED3; color: #1E1E1E; }
#zgoda-cookies .zgoda__tytul { color: #1E1E1E; font-size: 1.25rem; font-weight: 700; line-height: 1.3; margin: 0; }
#zgoda-cookies .zgoda__opis,
#zgoda-cookies .zgoda__kategoria-nazwa { color: #1E1E1E; }
#zgoda-cookies .zgoda__opis a { color: #1E1E1E; }
#zgoda-cookies label { margin: 0; font-weight: inherit; }

/* Baner nie moze zaslaniac elementu z fokusem (WCAG 2.2, 2.4.11):
   gdy jest widoczny, strona dostaje odstep na jego wysokosc. */
html.zgoda-otwarta { scroll-padding-bottom: calc(var(--zgoda-wysokosc, 0px) + 48px); }
html.zgoda-otwarta body { padding-bottom: calc(var(--zgoda-wysokosc, 0px) + 24px); }

@media (max-width: 640px) {
    .zgoda {
        left: 12px;
        right: 12px;
        bottom: 12px;
        width: auto;
        max-height: calc(100vh - 24px);
        padding: 20px;
        border-radius: 20px;
    }
    .zgoda__przyciski { flex-direction: column; }
    .zgoda__btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .zgoda { animation: none; }
    .zgoda__przelacznik,
    .zgoda__przelacznik::after,
    .zgoda__btn { transition: none; }
}

@media (forced-colors: active) {
    .zgoda { border: 2px solid CanvasText; }
    .zgoda__przelacznik { border-color: CanvasText; }
    .zgoda__przelacznik::after { background: CanvasText; }
    .zgoda__przelacznik:checked { background: Highlight; }
}

@media print {
    .zgoda { display: none !important; }
}
