/*
 * Cookie consent gate (GDPR / Prawo Komunikacji Elektronicznej art. 399-400).
 * Centered modal over a full-screen overlay that blocks the page until the
 * visitor makes an explicit choice. Styled to match the Boomerang theme:
 * brand palette ($color-project-1 #009ff2, $color-project-main #757575),
 * Oswald headings, Open Sans body.
 * Contrast mode is handled mostly by public/css/contrast.css (.contrast *);
 * only gap-fillers are added at the bottom.
 */

/* ---------- Base visibility ---------- */
.cookie-consent-overlay,
.cookie-consent-toggle {
    display: none;
}

.cookie-consent-overlay:not([hidden]) {
    display: flex;
}

.cookie-consent-toggle:not([hidden]) {
    display: inline-flex;
}

/* Reinforced hidden state (beats any display override from frameworks). */
.cookie-consent-overlay[hidden],
.cookie-consent-toggle[hidden] {
    display: none !important;
}

/* ---------- Body scroll lock + blur while the gate/modal is open ---------- */
body.cookie-consent-locked {
    overflow: hidden;
}

/* Blur the page content behind the overlay so it cannot be read pre-choice.
   The overlay/modal is a sibling of .body-wrap, so it stays sharp. */
body.cookie-consent-locked .body-wrap {
    filter: blur(8px);
    -webkit-filter: blur(8px);
}

/* ---------- Full-screen overlay ---------- */
.cookie-consent-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 100000; /* clears Bootstrap modals (1050) and the site header */
    background: rgba(0, 0, 0, 0.55);
    align-items: center;
    justify-content: center;
    padding: 16px;
    font-family: 'Open Sans', sans-serif;
}

/* ---------- Centered modal card ---------- */
.cookie-consent-modal {
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    background: #ffffff;
    color: #343a40;
    border-top: 3px solid #009ff2;
    border-radius: 0.3rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    padding: 22px 24px 20px;
}

.cookie-consent-modal__title {
    font-family: 'Oswald', sans-serif;
    font-weight: 600;
    font-size: 1.15rem;
    margin: 0 0 6px;
    color: #343a40;
}

.cookie-consent-modal__message {
    margin: 0 0 14px;
    font-size: 0.9rem;
    color: #51575d;
}

.cookie-consent-modal__link {
    color: #009ff2;
    text-decoration: underline;
}

.cookie-consent-modal__link:hover {
    color: #007fc0;
}

.cookie-consent-modal__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
}

/* Equal visual weight for Accept all / Accept only necessary - no dark patterns. */
.cookie-consent-btn {
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    cursor: pointer;
}

.cookie-consent-btn--primary {
    background-color: #009ff2;
    border: 1px solid #009ff2;
    color: #ffffff;
}

.cookie-consent-btn--primary:hover,
.cookie-consent-btn--primary:focus {
    background-color: #008ad6;
    border-color: #008ad6;
    color: #ffffff;
}

.cookie-consent-btn--secondary {
    background-color: #757575;
    border: 1px solid #757575;
    color: #ffffff;
}

.cookie-consent-btn--secondary:hover,
.cookie-consent-btn--secondary:focus {
    background-color: #636363;
    border-color: #636363;
    color: #ffffff;
}

.cookie-consent-btn--link {
    background: transparent;
    border: 0;
    color: #343a40;
    text-decoration: underline;
    padding: 0.5rem 0.75rem;
    text-transform: none;
    letter-spacing: normal;
}

.cookie-consent-btn--link:hover,
.cookie-consent-btn--link:focus {
    background: transparent;
    color: #009ff2;
}

/* ---------- Settings categories ---------- */
.cookie-consent-settings__category {
    border-top: 1px solid #e5e5e5;
    padding: 10px 0;
}

.cookie-consent-settings__category-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.cookie-consent-settings__category-title {
    font-family: 'Oswald', sans-serif;
    font-weight: 600;
    margin: 0;
    color: #343a40;
}

.cookie-consent-settings__locked {
    font-size: 0.75rem;
    font-family: 'Open Sans', sans-serif;
    font-weight: 400;
    color: #757575;
    margin-left: 8px;
}

.cookie-consent-settings__category-desc {
    margin: 4px 0 0;
    font-size: 0.85rem;
    color: #51575d;
}

.cookie-consent-settings__checkbox {
    width: 1.3rem;
    height: 1.3rem;
    cursor: pointer;
}

.cookie-consent-settings__checkbox:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

/* ---------- Floating reopen / withdraw control ---------- */
.cookie-consent-toggle {
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 99999;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background-color: #757575;
    color: #ffffff;
    border: none;
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.cookie-consent-toggle:hover,
.cookie-consent-toggle:focus {
    background-color: #009ff2;
    color: #ffffff;
}

/* ---------- Mobile ---------- */
@media (max-width: 575px) {
    .cookie-consent-modal {
        padding: 18px 16px 16px;
    }

    .cookie-consent-modal__actions .cookie-consent-btn {
        flex: 1;
    }
}

/* ---------- Contrast mode gap-fillers ----------
   contrast.css already restyles .contrast div/a/button/input (black bg, white text,
   #E4FF00 accents). Only elements with an explicit color set here need overrides. */
.contrast .cookie-consent-modal__title,
.contrast .cookie-consent-modal__message,
.contrast .cookie-consent-settings__category-desc {
    color: #ffffff !important;
}

.contrast .cookie-consent-settings__locked {
    color: #E4FF00 !important;
}

.contrast .cookie-consent-modal__link {
    color: #E4FF00 !important;
}
