/* Skycode Consent Pro. Usa los tokens del tema si existen y cae a valores propios. */
.rbc {
    --rbc-bg: var(--color-surface-raised, #111);
    --rbc-bg-2: var(--color-surface-muted, #222);
    --rbc-ink: var(--color-ink, #fff);
    --rbc-muted: var(--color-ink-muted, rgba(255, 255, 255, .72));
    --rbc-line: var(--color-line, rgba(255, 255, 255, .14));
    --rbc-line-strong: var(--color-line-strong, rgba(255, 255, 255, .4));
    --rbc-accent: #34d399;
    --rbc-on-action: var(--color-on-action, #000);
    --rbc-action: var(--color-action, #fff);
    --rbc-font: var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    font-family: var(--rbc-font);
    color: var(--rbc-ink);
}
.rbc *, .rbc *::before, .rbc *::after { box-sizing: border-box; }
.rbc [hidden] { display: none !important; }

/* ------------------------------------------------------------- banner */
.rbc-banner {
    position: fixed;
    z-index: 9990;
    left: 12px;
    right: 12px;
    /* Por encima de WhatsApp / volver arriba; --rb-dock-offset lo sube sobre la barra de compra. */
    bottom: calc(max(6rem, var(--rb-dock-offset, 0px)) + env(safe-area-inset-bottom, 0px));
    max-height: calc(100dvh - max(6rem, var(--rb-dock-offset, 0px)) - 1.25rem - env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    padding: 20px;
    background: color-mix(in srgb, var(--rbc-bg) 96%, transparent);
    border: 1px solid var(--rbc-line);
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .25s ease, transform .25s ease;
}
.rbc-banner.is-open { opacity: 1; transform: none; }
@media (min-width: 768px) {
    .rbc-banner { left: auto; right: 24px; width: 440px; padding: 24px; border-radius: 24px; bottom: calc(max(7rem, var(--rb-dock-offset, 0px)) + env(safe-area-inset-bottom, 0px)); }
}

.rbc-title { margin: 0 0 8px; font-size: 16px; line-height: 1.3; font-weight: 700; letter-spacing: -.01em; color: var(--rbc-ink); }
.rbc-text { margin: 0 0 10px; font-size: 14px; line-height: 1.55; color: var(--rbc-muted); }
.rbc-text--meta { font-size: 13px; }
.rbc-link { color: var(--rbc-ink); text-decoration: underline; text-underline-offset: 3px; margin-left: 4px; }
.rbc-link:hover { color: var(--rbc-accent); }

.rbc-actions { display: grid; gap: 8px; margin-top: 16px; }
@media (min-width: 768px) { .rbc-actions { grid-template-columns: 1fr 1fr; } .rbc-actions .rbc-btn--ghost { grid-column: 1 / -1; } }

/* Aceptar y rechazar tienen exactamente el mismo peso visual (no hay patrón oscuro). */
.rbc-btn {
    min-height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    font: 700 14px/1 var(--rbc-font);
    cursor: pointer;
    border: 1px solid transparent;
    transition: background-color .15s ease, transform .1s ease, border-color .15s ease;
}
.rbc-btn:active { transform: scale(.98); }
.rbc-btn--solid { background: var(--rbc-action); color: var(--rbc-on-action); }
.rbc-btn--solid:hover { background: #e5e7eb; }
.rbc-btn--ghost { background: transparent; color: var(--rbc-ink); border-color: var(--rbc-line-strong); }
.rbc-btn--ghost:hover { border-color: var(--rbc-ink); }
.rbc :focus-visible, .rbc-link-btn:focus-visible { outline: 2px solid var(--rbc-accent); outline-offset: 2px; }

.rbc-link-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.rbc-link-btn:hover { opacity: .8; }

/* -------------------------------------------------------- preferencias */
.rbc-prefs { position: fixed; inset: 0; z-index: 9995; display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .2s ease; }
.rbc-prefs.is-open { opacity: 1; }
.rbc-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .72); }
.rbc-dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: 92dvh;
    background: var(--rbc-bg);
    border: 1px solid var(--rbc-line);
    border-radius: 24px 24px 0 0;
    outline: 0;
    transform: translateY(24px);
    transition: transform .25s ease;
}
.rbc-prefs.is-open .rbc-dialog { transform: none; }
@media (min-width: 768px) {
    .rbc-prefs { align-items: center; }
    .rbc-dialog { width: min(680px, calc(100vw - 48px)); max-height: 86dvh; border-radius: 24px; }
}
.rbc-dialog__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px 12px; }
.rbc-dialog__head .rbc-title { margin: 0; font-size: 18px; }
.rbc-x { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--rbc-line); background: transparent; color: var(--rbc-ink); font-size: 24px; line-height: 1; cursor: pointer; }
.rbc-x:hover { border-color: var(--rbc-ink); }
.rbc-dialog__body { padding: 0 24px 8px; overflow-y: auto; overscroll-behavior: contain; }
.rbc-dialog__foot { display: grid; gap: 8px; padding: 16px 24px calc(16px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--rbc-line); }
@media (min-width: 768px) { .rbc-dialog__foot { grid-template-columns: repeat(3, 1fr); } }

.rbc-cat { padding: 16px 0; border-top: 1px solid var(--rbc-line); }
.rbc-cat__row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.rbc-cat__info { flex: 1; }
.rbc-cat__name { margin: 0 0 4px; font-size: 15px; font-weight: 700; color: var(--rbc-ink); }
.rbc-badge { flex: none; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--rbc-accent); border: 1px solid color-mix(in srgb, var(--rbc-accent) 40%, transparent); }

.rbc-switch { position: relative; flex: none; display: inline-flex; width: 52px; height: 44px; align-items: center; cursor: pointer; }
.rbc-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.rbc-switch__track { position: relative; width: 52px; height: 30px; border-radius: 999px; background: var(--rbc-bg-2); border: 1px solid var(--rbc-line-strong); transition: background-color .2s ease; pointer-events: none; }
.rbc-switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s ease; }
.rbc-switch input:checked + .rbc-switch__track { background: var(--rbc-accent); border-color: var(--rbc-accent); }
.rbc-switch input:checked + .rbc-switch__track::after { transform: translateX(22px); background: #04130d; }
.rbc-switch input:focus-visible + .rbc-switch__track { outline: 2px solid var(--rbc-accent); outline-offset: 3px; }

.rbc-details { margin-top: 8px; }
.rbc-details summary { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; font-weight: 600; color: var(--rbc-muted); cursor: pointer; }
.rbc-details summary:hover { color: var(--rbc-ink); }
.rbc-list { margin: 0 0 8px; padding: 0; list-style: none; display: grid; gap: 10px; }
.rbc-list li { display: grid; gap: 2px; padding: 12px; font-size: 13px; line-height: 1.5; color: var(--rbc-muted); background: var(--rbc-bg-2); border-radius: 12px; word-break: break-word; }
.rbc-list strong { color: var(--rbc-ink); }
.rbc-rights { padding: 16px 0 12px; border-top: 1px solid var(--rbc-line); }
.rbc-rights code { font-size: 12px; color: var(--rbc-ink); word-break: break-all; }

/* tabla de la política (shortcode) */
.rbc-table-title { margin: 20px 0 8px; font-size: 14px; font-weight: 700; }
.rbc-scroll { overflow-x: auto; border: 1px solid var(--color-line, rgba(255,255,255,.14)); border-radius: 12px; }
.rbc-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 13px; line-height: 1.5; }
.rbc-table th, .rbc-table td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--color-line, rgba(255,255,255,.14)); }
.rbc-table th { font-weight: 700; white-space: nowrap; }
.rbc-table tr:last-child td { border-bottom: 0; }

.rbc-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
body.rbc-lock { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
    .rbc-banner, .rbc-prefs, .rbc-dialog, .rbc-switch__track, .rbc-switch__track::after, .rbc-btn { transition: none; }
}

/* Móvil: barra compacta. Antes ocupaba ~64 % de la pantalla y era el LCP de la tienda. */
@media (max-width: 767px) {
    .rbc-banner { padding: 14px; border-radius: 16px; bottom: calc(max(4.5rem, var(--rb-dock-offset, 0px)) + env(safe-area-inset-bottom, 0px)); }
    .rbc-title, .rbc-text--meta { display: none; }
    .rbc-text { margin: 0; font-size: 13px; line-height: 1.45; }
    .rbc-actions { grid-template-columns: 1fr 1fr; margin-top: 12px; }
    .rbc-actions .rbc-btn--ghost { grid-column: 1 / -1; min-height: 36px; border-color: transparent; text-decoration: underline; text-underline-offset: 3px; }
}
