/* PRODEX — consentimiento de cookies (sitio público)
   Todo vive bajo `.pxc`; los tokens se derivan de la paleta oficial compartida. */

.pxc {
    --pxc-ink: var(--prodex-ink);          /* navy PRODEX: títulos, botón primario */
    --pxc-text: #475569;
    --pxc-line: rgba(var(--prodex-ink-rgb), 0.12);
    --pxc-accent: var(--prodex-aqua);       /* cyan PRODEX (no se usa para texto: contraste insuficiente sobre blanco) */
    --pxc-accent-strong: var(--prodex-ink);/* variante con ≥3:1 sobre blanco para controles y foco */
    --pxc-surface: #ffffff;
    --pxc-muted: #f1f5f9;

    position: fixed;
    z-index: 2147483000;
    left: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
    width: min(360px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    box-sizing: border-box;
    padding: 16px;
    background: var(--pxc-surface);
    color: var(--pxc-text);
    border: 1px solid var(--pxc-line);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(var(--prodex-ink-rgb), 0.14);
    font: 400 14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 200ms ease, transform 200ms ease;
}
.pxc *, .pxc *::before, .pxc *::after { box-sizing: border-box; }
.pxc[hidden], .pxc [hidden] { display: none !important; }
.pxc.is-open { opacity: 1; transform: none; }

.pxc__title { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.3; color: var(--pxc-ink); }
.pxc__text { margin: 8px 0 0; font-size: 13px; line-height: 1.5; color: var(--pxc-text); }
.pxc__text a { color: var(--pxc-ink); text-decoration: underline; text-underline-offset: 2px; }
.pxc__text a:hover { text-decoration-thickness: 2px; }

.pxc__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 16px; }

.pxc__btn {
    appearance: none;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}
.pxc__btn--primary { background: var(--pxc-ink); color: #fff; border: 1px solid var(--pxc-ink); }
.pxc__btn--primary:hover { background: #163d69; border-color: #163d69; }
.pxc__btn--secondary { background: var(--pxc-surface); color: var(--pxc-ink); border: 1px solid var(--pxc-ink); }
.pxc__btn--secondary:hover { background: var(--pxc-muted); }

.pxc__link {
    appearance: none;
    margin-right: auto;
    min-height: 40px;
    padding: 0 4px;
    background: none;
    border: 0;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    color: var(--pxc-ink);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
.pxc__link:hover { text-decoration-thickness: 2px; }

/* Foco visible propio (el sitio no debe depender del outline por defecto del navegador). */
.pxc a:focus-visible, .pxc button:focus-visible, .pxc input:focus-visible + .pxc__slider {
    outline: 2px solid var(--pxc-accent-strong);
    outline-offset: 2px;
}

/* Preferencias */
.pxc__prefs { margin-top: 4px; }
.pxc.is-reopen .pxc__prefs { margin-top: 0; }
.pxc__prefs-title { margin: 0 0 4px; font-size: 15px; font-weight: 600; color: var(--pxc-ink); }
.pxc__cat { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--pxc-line); }
.pxc__prefs-title + .pxc__cat { margin-top: 8px; }
.pxc__cat-info { min-width: 0; }
.pxc__cat-name { display: block; font-size: 13px; font-weight: 600; color: var(--pxc-ink); cursor: pointer; }
.pxc__cat-desc { margin: 2px 0 0; font-size: 12px; line-height: 1.45; color: var(--pxc-text); }

/* Interruptor accesible: el <input type="checkbox"> real cubre el control (opacity 0), nunca display:none. */
.pxc__switch { position: relative; flex: none; width: 40px; height: 24px; margin-top: 2px; }
.pxc__switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.pxc__slider { position: absolute; inset: 0; border-radius: 999px; background: #94a3b8; transition: background-color 150ms ease; pointer-events: none; }
.pxc__slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 150ms ease; }
.pxc__switch input:checked + .pxc__slider { background: var(--pxc-accent-strong); }
.pxc__switch input:checked + .pxc__slider::after { transform: translateX(16px); }
.pxc__switch.is-locked input { cursor: not-allowed; }
.pxc__switch.is-locked .pxc__slider { background: var(--pxc-ink); opacity: 0.55; }

@media (max-width: 480px) {
    .pxc { left: 12px; right: 12px; width: auto; bottom: max(12px, env(safe-area-inset-bottom)); }
    .pxc__actions { flex-direction: column-reverse; align-items: stretch; }
    .pxc__link { margin: 0; align-self: center; }
    .pxc__btn { width: 100%; min-height: 44px; }
    .pxc__link { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
    .pxc { transition: none; transform: none; }
    .pxc__slider, .pxc__slider::after, .pxc__btn { transition: none; }
}
