/* Companion stylesheet for consent-banner.js.
   Scoped under #cookie-banner / #show-popup-cookies to avoid clashing with
   whatever CSS framework (Bootstrap, Tailwind, ...) the host page already
   loads. Hidden by default; consent-banner.js toggles display:flex/none. */

#cookie-banner {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2147483000;
    box-sizing: border-box;
    padding: 16px 20px;
    background: #1a1a2e;
    color: #f2f2f2;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.25);
}

#cookie-banner * {
    box-sizing: border-box;
}

#cookie-banner .banner-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 24px;
    max-width: 1200px;
    margin: 0 auto;
}

#cookie-banner #popup-text {
    flex: 1 1 320px;
    margin: 0;
    color: #f2f2f2;
}

#cookie-banner #popup-text a {
    color: #8ab4ff;
    text-decoration: underline;
}

/* Category checkboxes: hidden until "settings" is opened (see JS), then
   toggled to display:block. Stacked, opt-in (unchecked by default). */
#cookie-banner .consent-label {
    display: none;
    flex: 0 0 100%;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #d8d8e0;
    cursor: pointer;
    font-size: 13px;
}

#cookie-banner .consent-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #4f8cff;
}

#cookie-banner .consent-label input[type="checkbox"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#cookie-banner #button-consent-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 0 0 auto;
    margin-left: auto;
}

#cookie-banner button {
    appearance: none;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

#cookie-banner button:focus-visible {
    outline: 2px solid #8ab4ff;
    outline-offset: 2px;
}

/* Primary CTA ("Accept all" / "Accept selected") */
#cookie-banner #accept-selected {
    background: #4f8cff;
    color: #fff;
}

#cookie-banner #accept-selected:hover {
    background: #3f78e6;
}

/* "Only essentials" — reject-all, given equal visual weight to accept */
#cookie-banner #functional-only {
    background: transparent;
    border-color: #6b6b80;
    color: #f2f2f2;
}

#cookie-banner #functional-only:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* "Customize" — tertiary, plain link-style */
#cookie-banner #settings-cookies {
    background: transparent;
    color: #b8b8c8;
    text-decoration: underline;
    padding: 9px 4px;
}

#cookie-banner #settings-cookies:hover {
    color: #f2f2f2;
}

@media (max-width: 640px) {
    #cookie-banner .banner-content {
        flex-direction: column;
        align-items: stretch;
    }

    #cookie-banner #button-consent-container {
        margin-left: 0;
        flex-direction: column;
    }

    #cookie-banner #button-consent-container button {
        width: 100%;
    }
}

/* #show-popup-cookies is purely a behavior hook (consent-banner.js listens
   for clicks on this id to reopen the banner) — deliberately unstyled here so
   it inherits whatever the host page already uses for that element (a footer
   link, a mobile menu item, ...). Add .consent-reopen-fab if a theme wants a
   standalone floating "cookie settings" trigger instead. */
.consent-reopen-fab {
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 2147482999;
    appearance: none;
    border: 1px solid #d0d0d8;
    border-radius: 999px;
    background: #fff;
    color: #1a1a2e;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.15);
}

.consent-reopen-fab:hover {
    background: #f2f2f5;
}
