/* Zgody na cookies (js/consent.js): baner na dole strony i okno „Ustawienia cookies”.
   Kolory, przyciski i linki jak na stronie głównej (home.css); klasy z prefiksem h24c-, żeby nie mieszać się z WordPressem. */

.h24c-banner, .h24c-overlay, .h24c-banner *, .h24c-overlay * { box-sizing: border-box; }

.h24c-banner, .h24c-dialog {
    font-family: 'Comfortaa', Arial, Helvetica, sans-serif;
    color: #545874;
    background: #fff;
    box-shadow: 0 16px 48px rgba(46, 48, 73, .18);
}

/* ---------- baner ---------- */
.h24c-banner {
    position: fixed;
    z-index: 2147483600;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    width: min(860px, calc(100% - 40px));
    padding: 30px; /* jak duże karty (.home-package) */
    border-radius: 16px;
    animation: h24c-in .35s ease both;
}
.h24c-banner:focus { outline: none; }

.h24c-head, .h24c-dialog__head { display: flex; align-items: center; gap: 14px; }

.h24c-icon {
    flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px;
    border-radius: 12px;
    background: #e0ddfa;
    color: #6556e7;
    font-size: 20px;
    line-height: 1;
}
.h24c-icon i, .h24c-close i { margin: 0 !important; line-height: 1; }

.h24c-title {
    margin: 0;
    font-family: inherit;
    font-size: 19px;
    line-height: 1.3;
    font-weight: 700;
    color: #2e3049;
    letter-spacing: 0;
    text-transform: none;
}
.h24c-title--dialog { font-size: 22px; }

.h24c-text {
    margin: 14px 0 0;
    font-size: 14px;
    line-height: 1.65;
    color: #545874;
}
.h24c-text--second { margin-top: 8px; }

/* link jak w tekstach strony głównej: bez podkreślenia, linia wysuwa się od lewej po najechaniu */
.h24c-link {
    color: #6556e7;
    font-weight: 600;
    text-decoration: none;
    padding-bottom: 2px;
    background: linear-gradient(currentColor, currentColor) left bottom / 0 1px no-repeat;
    transition: background-size .35s ease;
}
.h24c-link:hover { color: #6556e7; text-decoration: none; background-size: 100% 1px; }

.h24c-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 22px;
}

/* przyciski jak .home-btn: 50 px, zaokrąglenie 10 px, 15 px / 700 */
.h24c-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 50px;
    margin: 0;
    padding: 2px 26px 0;
    border-radius: 10px;
    border: 2px solid transparent;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .22s ease, color .22s ease, border-color .22s ease, box-shadow .22s ease;
}
/* ikona w przycisku: portal (buttons.css) daje każdej ikonie w <button> margin-right 12px */
.h24c-btn i { margin: 0 !important; font-size: 16px; position: relative; top: -1px; }

/* portal: components/buttons.css nadaje każdemu <button> font-weight 400, border-radius 5px i własne przejścia z !important */
.h24c-btn, .h24c-close {
    border-radius: 10px !important;
    transition: background-color .22s ease, color .22s ease, border-color .22s ease, box-shadow .22s ease !important;
}
.h24c-btn { font-weight: 700 !important; }

.h24c-btn--primary { background: #6556e7; color: #fff; box-shadow: 5px 5px 5px rgba(101, 86, 231, .4); }
.h24c-btn--primary:hover { background: #6556e7; color: #fff; box-shadow: none; }

/* „Odrzuć opcjonalne”: jasny fiolet jak tło ikony, fioletowy tekst (#efedfc: kontrast 4,5:1); po najechaniu pełny kolor */
.h24c-btn--light { background: #efedfc; color: #6556e7; }
.h24c-btn--light:hover { background: #6556e7; color: #fff; }

/* „Dostosuj” i „Zapisz wybór” jak „Pełny cennik domen” (.home-btn--outline): biały, ramka #d9d4f8, po najechaniu fiolet */
.h24c-btn--ghost { background: #fff; color: #2e3049; border: 1px solid #d9d4f8; }
.h24c-btn--ghost:hover { background: #fff; color: #6556e7; border-color: #6556e7; }

.h24c-btn:focus-visible, .h24c-link:focus-visible, .h24c-close:focus-visible, .h24c-switch:focus-visible, .h24c-details summary:focus-visible {
    outline: 3px solid #2e3049;
    outline-offset: 2px;
}

/* ---------- okno ustawień ---------- */
html.h24c-lock, html.h24c-lock body { overflow: hidden; }

.h24c-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483601;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(46, 48, 73, .55);
    animation: h24c-fade .25s ease both;
}

.h24c-dialog {
    display: flex;
    flex-direction: column;
    width: min(720px, 100%);
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    overflow: hidden;
    border-radius: 20px;
    background: #fff;
}
.h24c-dialog:focus { outline: none; }
.h24c-dialog { animation: h24c-dialog-in .3s ease both; }
.h24c-dialog__head { padding: 30px 30px 6px; }
.h24c-dialog__head .h24c-icon { width: 48px; height: 48px; }
.h24c-dialog__head .h24c-title { flex: 1 1 auto; }
.h24c-dialog__body { padding: 0 30px 4px; overflow-y: auto; }
.h24c-dialog__body > .h24c-text:first-child { margin: 12px 0 18px; }
.h24c-dialog__foot { margin: 0 30px; padding: 20px 0 30px; border-top: 1px solid #eeedf6; }

.h24c-close {
    flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px;
    border: 0;
    border-radius: 10px;
    background: #f3f2fd;
    font-size: 18px;
    color: #2e3049;
    cursor: pointer;
    transition: background-color .22s ease, color .22s ease;
}
.h24c-close:hover { background: #6556e7; color: #fff; }

/* karty kategorii: kolorowe tło, ikona w kwadracie, przełącznik po prawej */
.h24c-cat {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
    padding: 18px 20px;
    border-radius: 14px;
    background: #f6f5fe;
}
.h24c-cat--necessary { background: #f2fbfc; }
.h24c-cat--marketing { background: #fef4fc; }

.h24c-cat .h24c-icon { width: 52px; height: 52px; }
.h24c-cat .h24c-icon { font-size: 23px; }
/* kolory ikon jak .home-icon--turquoise / --violet / --pink na stronie głównej */
.h24c-icon--necessary { background: #e0f5f7; color: #36beca; }
.h24c-icon--statistics { background: #e0ddfa; color: #6556e7; }
.h24c-icon--marketing { background: #fbe1f6; color: #e65dd1; }

.h24c-cat__body { flex: 1 1 auto; min-width: 0; }
.h24c-cat__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 26px; }
.h24c-cat__name { margin: 0; font-family: inherit; font-size: 16px; line-height: 1.3; font-weight: 700; color: #2e3049; letter-spacing: 0; text-transform: none; }
.h24c-cat__name label { cursor: pointer; }
/* opis kończy się przed kolumną przełącznika (48 px + odstęp), we wszystkich kartach ta sama szerokość */
.h24c-cat__desc { margin: 6px 0 0; padding-right: 72px; font-size: 13px; line-height: 1.6; color: #545874; }

/* „Zawsze aktywne” przyklejone do prawego górnego rogu karty, jak „Twój pakiet” (.home-package__current) */
.h24c-always {
    position: absolute;
    top: 0;
    right: 0;
    padding: 7px 14px;
    border-radius: 0 14px 0 12px;
    background: #e0f5f7;
    color: #177f89;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
}

/* przełącznik */
.h24c-switch {
    appearance: none;
    -webkit-appearance: none;
    flex: 0 0 auto;
    position: relative;
    width: 48px; height: 28px;
    margin: 0;
    border-radius: 999px;
    background: #8d90a8;
    cursor: pointer;
    transition: background-color .22s ease;
}
.h24c-switch::after {
    content: '';
    position: absolute;
    top: 4px; left: 4px;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(46, 48, 73, .3);
    transition: transform .22s ease;
}
.h24c-switch:checked { background: #6556e7; }
.h24c-switch:checked::after { transform: translateX(20px); }

.h24c-details { margin-top: 8px; }
.h24c-details summary {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    color: #6556e7;
    cursor: pointer;
    list-style: none;
}
.h24c-details summary::-webkit-details-marker { display: none; }
/* strzałka jak przy „Więcej” na stronie głównej; obrót wg .is-open (płynne rozwijanie w consent.js), bez JS wg [open] */
.h24c-details summary i { margin-left: 8px; font-size: 11px; transition: transform .22s ease; }
.h24c-details[open]:not([data-smooth]) summary i,
.h24c-details.is-open summary i { transform: rotate(180deg); }

.h24c-table-wrap { margin-top: 10px; overflow-x: auto; border-radius: 10px; background: #fff; }
.h24c-table { width: 100%; border-collapse: collapse; font-size: 12px; line-height: 1.5; }
.h24c-table th, .h24c-table td { padding: 8px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid #eeedf6; }
.h24c-table tr:last-child td { border-bottom: 0; }
.h24c-table th { color: #2e3049; font-weight: 700; }
.h24c-table td { overflow-wrap: anywhere; hyphens: auto; }
.h24c-table td:first-child { color: #2e3049; }

.h24c-text--policy { margin: 4px 0 18px; font-size: 14px; }

.h24c-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }

@keyframes h24c-in { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes h24c-fade { from { opacity: 0; } to { opacity: 1; } }

/* wyjście: odwrotność wejścia */
.h24c-banner--out { animation: h24c-out .3s ease forwards; pointer-events: none; }
.h24c-overlay--out { animation: h24c-fade-out .25s ease forwards; pointer-events: none; }
.h24c-overlay--out .h24c-dialog { animation: h24c-dialog-out .25s ease forwards; }
@keyframes h24c-out { from { opacity: 1; transform: translate(-50%, 0); } to { opacity: 0; transform: translate(-50%, 16px); } }
@keyframes h24c-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes h24c-dialog-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes h24c-dialog-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(16px); } }

/* ---------- tablet: przyciski w kolumnie, gdy się nie mieszczą ---------- */
@media (max-width: 760px) {
    .h24c-dialog__foot .h24c-btn { flex: 1 1 auto; }
}

/* ---------- telefon ---------- */
@media (max-width: 640px) {
    .h24c-banner {
        left: 0; right: 0; bottom: 0;
        width: 100%;
        transform: none;
        padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); /* jak karty na telefonie */
        border-radius: 16px 16px 0 0;
        max-height: 85vh;
        overflow-y: auto;
        animation-name: h24c-in-mobile;
    }
    .h24c-icon { width: 40px; height: 40px; border-radius: 10px; }
    .h24c-title { font-size: 17px; }
    .h24c-title--dialog { font-size: 19px; }
    .h24c-text { font-size: 13px; margin-top: 10px; }
    .h24c-text--second { margin-top: 6px; }
    .h24c-actions { flex-direction: column-reverse; margin-top: 16px; gap: 10px; }
    .h24c-btn { width: 100%; }
    .h24c-overlay { padding: 0; align-items: flex-end; }
    .h24c-dialog { width: 100%; max-height: 92vh; max-height: 92dvh; border-radius: 20px 20px 0 0; }
    .h24c-dialog__head { padding: 20px 20px 4px; }
    .h24c-dialog__head .h24c-icon { width: 42px; height: 42px; }
    .h24c-dialog__body { padding: 0 20px 4px; }
    .h24c-dialog__foot { margin: 0 20px; padding: 16px 0 calc(20px + env(safe-area-inset-bottom)); }
    .h24c-cat { gap: 12px; padding: 16px 14px; }
    .h24c-cat .h24c-icon { width: 40px; height: 40px; }
    .h24c-cat .h24c-icon { font-size: 19px; }
    .h24c-cat__name { font-size: 15px; }
    .h24c-cat__desc { padding-right: 0; }
    .h24c-table th:nth-child(2), .h24c-table td:nth-child(2) { display: none; }
}
@keyframes h24c-in-mobile { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes h24c-out-mobile { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(16px); } }
@media (max-width: 640px) {
    .h24c-banner.h24c-banner--out { animation-name: h24c-out-mobile; }
}

@media (prefers-reduced-motion: reduce) {
    .h24c-banner, .h24c-overlay, .h24c-dialog, .h24c-banner--out, .h24c-overlay--out, .h24c-overlay--out .h24c-dialog { animation: none; }
    .h24c-btn, .h24c-switch, .h24c-switch::after, .h24c-close, .h24c-link, .h24c-details summary i { transition: none !important; }
}
