/* Banner de cookies: usa las variables de theme-toggle.css para seguir el tema claro u oscuro. */
.cookie-consent {
    --cookie-consent-cta: #d9235f;
    --cookie-consent-cta-hover: #bf1f55;
    position: fixed;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    left: 16px;
    z-index: 1080;
    max-width: 640px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    margin: 0 auto;
    padding: 20px;
    border: 1px solid var(--site-theme-border, rgba(31, 26, 18, 0.14));
    border-radius: 20px;
    background: var(--site-theme-surface-raised, #ffffff);
    color: var(--site-theme-text, #1f1a12);
    box-shadow: var(--site-theme-shadow, 0 18px 42px rgba(31, 26, 18, 0.12));
}

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

.cookie-consent__title {
    margin: 0 0 8px;
    color: var(--site-theme-text, #1f1a12);
    font-size: 1.15rem;
    font-weight: 800;
}

.cookie-consent__text {
    margin: 0 0 12px;
    color: var(--site-theme-text, #1f1a12);
    font-size: 0.95rem;
    line-height: 1.5;
}

.cookie-consent__text a {
    color: var(--site-theme-link, #a21b48);
    font-weight: 600;
}

.cookie-consent__settings {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px solid var(--site-theme-border, rgba(31, 26, 18, 0.14));
    border-radius: 14px;
    background: var(--site-theme-bg-soft, #fffaf2);
    font-size: 0.95rem;
}

.cookie-consent__settings .form-check-label {
    color: var(--site-theme-text, #1f1a12);
}

.cookie-consent .form-check-input {
    background-color: var(--site-theme-surface-raised, #ffffff);
    border-color: var(--site-theme-muted, #70685d);
}

.cookie-consent .form-check-input:checked {
    background-color: var(--cookie-consent-cta);
    border-color: var(--cookie-consent-cta);
}

.cookie-consent .form-check-input:disabled {
    opacity: 0.6;
}

.cookie-consent .form-check-input:disabled ~ .form-check-label {
    color: var(--site-theme-muted, #70685d);
    opacity: 1;
}

.cookie-consent__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

/* Rechazar y Aceptar tienen el mismo peso visual. */
.cookie-consent__button {
    min-height: 44px;
    padding: 10px 18px;
    border: 2px solid transparent;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.cookie-consent__button--primary {
    background: var(--cookie-consent-cta);
    border-color: var(--cookie-consent-cta);
    color: #ffffff;
}

.cookie-consent__button--primary:hover {
    background: var(--cookie-consent-cta-hover);
    border-color: var(--cookie-consent-cta-hover);
}

.cookie-consent__button--ghost {
    background: transparent;
    border-color: var(--site-theme-border, rgba(31, 26, 18, 0.14));
    color: var(--site-theme-text, #1f1a12);
}

.cookie-consent__button--ghost:hover {
    border-color: var(--site-theme-text, #1f1a12);
}

.cookie-consent__button:focus-visible,
.cookie-consent__title:focus-visible,
.cookie-consent a:focus-visible,
.cookie-settings-link:focus-visible {
    outline: 3px solid var(--site-theme-focus, #a31c47);
    outline-offset: 2px;
}

@media (max-width: 575.98px) {
    .cookie-consent {
        right: 12px;
        left: 12px;
        padding: 16px;
    }

    .cookie-consent__button {
        flex: 1 1 calc(50% - 8px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .cookie-consent__button {
        transition: none;
    }
}

.cookie-settings-link {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}
