/* Aviso y preferencias de cookies. Usa los tokens de styles.css con valores de respaldo. */
.tc-banner { position: fixed; z-index: 1000; left: 16px; right: 16px; bottom: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; max-width: 980px; margin-inline: auto; padding: 18px 22px; border: 1px solid var(--line, #bfcfde99); border-radius: 16px; color: var(--blue-900, #132258); background: var(--white, #fff); box-shadow: 0 18px 54px #13225840; font: 400 15px/1.5 var(--font-body, system-ui, sans-serif); }
.tc-banner[hidden], .tc-modal[hidden] { display: none; }
.tc-banner p { flex: 1 1 320px; margin: 0; }
.tc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tc-banner .tc-policy { flex: none; color: var(--blue-600, #294cbf); font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.tc-banner .tc-policy:hover { color: var(--blue-900, #132258); }

.tc-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 20px; border: 1.5px solid var(--blue, #315ae2); border-radius: 10px; color: var(--blue, #315ae2); background: var(--white, #fff); font: 700 14px/1.2 var(--font-body, system-ui, sans-serif); cursor: pointer; transition: background .2s, color .2s; }
.tc-btn:hover { background: var(--blue-50, #f5f7ff); }
.tc-btn--primary { color: var(--white, #fff); background: var(--blue, #315ae2); }
.tc-btn--primary:hover { background: var(--blue-600, #294cbf); }
.tc-btn--text { border-color: transparent; text-decoration: underline; text-underline-offset: 3px; }
.tc-banner :focus-visible, .tc-modal :focus-visible { outline: 3px solid #99b1ff; outline-offset: 3px; }

.tc-modal { position: fixed; z-index: 1001; inset: 0; display: grid; place-items: center; padding: 16px; background: #132258a6; }
.tc-dialog { position: relative; width: min(100%, 560px); max-height: calc(100vh - 32px); overflow-y: auto; padding: 32px; border-radius: 16px; color: var(--blue-900, #132258); background: var(--white, #fff); box-shadow: 0 28px 80px #13225866; font: 400 15px/1.55 var(--font-body, system-ui, sans-serif); }
.tc-dialog h2 { margin: 0; padding-right: 36px; font: 800 24px/1.2 var(--font-display, system-ui, sans-serif); letter-spacing: -.02em; }
.tc-dialog > p { margin: 10px 0 0; color: var(--muted, #132258b2); }
.tc-close { position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; color: var(--blue-900, #132258); background: transparent; font-size: 26px; line-height: 1; cursor: pointer; }
.tc-close:hover { background: var(--blue-50, #f5f7ff); }

.tc-cats { margin: 22px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line, #bfcfde99); }
.tc-cat { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 20px; align-items: start; padding: 18px 0; border-bottom: 1px solid var(--line, #bfcfde99); }
.tc-cat h3 { margin: 0; font: 700 16px/1.3 var(--font-display, system-ui, sans-serif); }
.tc-cat p { grid-column: 1; margin: 0; color: var(--muted, #132258b2); font-size: 14px; }
.tc-cat__state { grid-column: 2; grid-row: 1; align-self: center; color: var(--blue, #315ae2); font-size: 13px; font-weight: 700; }

.tc-switch { grid-column: 2; grid-row: 1; position: relative; width: 48px; height: 28px; padding: 0; border: 0; border-radius: 999px; background: #bfcfde; cursor: pointer; transition: background .2s; }
.tc-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px #13225840; transition: transform .2s; }
.tc-switch[aria-checked="true"] { background: var(--blue, #315ae2); }
.tc-switch[aria-checked="true"]::after { transform: translateX(20px); }

.tc-footer { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

/* Botón "Preferencias de cookies" dentro del footer: se ve como los demás enlaces */
.tf__legal button[data-cookie-settings] { padding: 0; border: 0; color: #FFFFFFB2; background: none; font: inherit; cursor: pointer; }
.tf__legal button[data-cookie-settings]:hover { color: #FFFFFF; }
.tf__legal button[data-cookie-settings]:focus-visible { outline: 2px solid #99B1FF; outline-offset: 2px; border-radius: 4px; }
.legal-card__body button[data-cookie-settings] { padding: 0; border: 0; color: var(--blue-600, #294cbf); background: none; font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

@media (max-width: 640px) {
  .tc-banner { left: 10px; right: 10px; bottom: 10px; padding: 16px; }
  .tc-actions { width: 100%; }
  .tc-actions .tc-btn { flex: 1 1 auto; padding-inline: 12px; }
  .tc-dialog { padding: 24px 20px; }
  .tc-footer .tc-btn { flex: 1 1 100%; }
  .tf__legal button[data-cookie-settings] { display: inline-flex; align-items: center; min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .tc-switch, .tc-switch::after, .tc-btn { transition: none; } }
