/* Cookie consent banner
 * - Uses only design tokens from core.css; inherits any of the 15 themes
 *   and light/dark mode without modification.
 * - Sticky region at the bottom of the viewport, NOT a modal.
 *   Visitors can keep using the rest of the page while making a choice.
 *   Tracking scripts stay inert until an explicit choice is recorded.
 * - role="region" + aria-labelledby on the partial; no keyboard trap needed.
 */

.cookie-consent {
    position: fixed;
    bottom: 16px;
    left: 16px;
    right: 16px;
    max-width: 560px;
    margin: 0 auto;
    z-index: 9999;
    background: var(--ap-color-surface);
    color: var(--ap-color-text);
    border: 1px solid var(--ap-color-border);
    border-radius: var(--ap-radius, 8px);
    padding: 20px 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    font-family: inherit;
}

.cookie-consent[hidden] {
    display: none;
}

.cookie-consent__inner {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cookie-consent__title {
    margin: 0;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--ap-color-text);
    line-height: 1.3;
}

.cookie-consent__body {
    margin: 0;
    font-size: 0.95em;
    line-height: 1.5;
    color: var(--ap-color-text-secondary);
}

.cookie-consent__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.cookie-consent__btn {
    padding: 8px 16px;
    border-radius: var(--ap-radius-sm, 6px);
    font-size: 0.9em;
    font-weight: 500;
    font-family: inherit;
    line-height: 1.4;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.cookie-consent__btn:focus-visible {
    outline: 2px solid var(--ap-color-primary);
    outline-offset: 2px;
}

.cookie-consent__btn--primary {
    background: var(--ap-color-primary);
    color: var(--ap-color-text-inverse);
    border-color: var(--ap-color-primary);
}

.cookie-consent__btn--primary:hover {
    background: var(--ap-color-primary-hover);
    border-color: var(--ap-color-primary-hover);
}

.cookie-consent__btn--secondary {
    background: transparent;
    color: var(--ap-color-text);
    border-color: var(--ap-color-border-strong);
}

.cookie-consent__btn--secondary:hover {
    background: var(--ap-color-surface-alt);
    border-color: var(--ap-color-text-muted);
}

@media (max-width: 480px) {
    .cookie-consent {
        bottom: 0;
        left: 0;
        right: 0;
        max-width: none;
        margin: 0;
        border-radius: var(--ap-radius, 8px) var(--ap-radius, 8px) 0 0;
        border-bottom: none;
    }

    .cookie-consent__actions {
        flex-direction: column;
    }

    .cookie-consent__btn {
        width: 100%;
    }
}
