/* TBO Seguridad Total — banner de cookies. Todo bajo IDs propios para no alterar ni heredar estilos del tema. */
#tbo-cookies, #tbo-ck-prefs, #tbo-ck-boton {
	--tbo-ck-fondo: #ffffff; --tbo-ck-texto: #1f2937; --tbo-ck-suave: #4b5563; --tbo-ck-borde: #d1d5db; --tbo-ck-pista: #9ca3af;
	--tbo-ck-sombra: 0 10px 40px rgba(17, 24, 39, .18);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 15px; line-height: 1.5; color: var(--tbo-ck-texto); text-align: left; letter-spacing: normal;
}
@media (prefers-color-scheme: dark) {
	#tbo-cookies, #tbo-ck-prefs, #tbo-ck-boton {
		--tbo-ck-fondo: #111827; --tbo-ck-texto: #f3f4f6; --tbo-ck-suave: #d1d5db; --tbo-ck-borde: #374151; --tbo-ck-pista: #6b7280;
		--tbo-ck-sombra: 0 10px 40px rgba(0, 0, 0, .5);
	}
}
#tbo-cookies *, #tbo-ck-prefs *, #tbo-ck-boton * { box-sizing: border-box; }
#tbo-cookies[hidden], #tbo-ck-prefs[hidden], #tbo-ck-boton[hidden], #tbo-ck-prefs [hidden] { display: none !important; }

/* Banner */
#tbo-cookies { position: fixed; z-index: 2147483000; }
#tbo-cookies .tbo-ck__banner { background: var(--tbo-ck-fondo); color: var(--tbo-ck-texto); box-shadow: var(--tbo-ck-sombra); border: 1px solid var(--tbo-ck-borde); }
#tbo-cookies .tbo-ck__titulo { margin: 0 0 6px; font-size: 17px; font-weight: 700; color: inherit; }
#tbo-cookies .tbo-ck__texto { margin: 0; color: var(--tbo-ck-suave); }
#tbo-cookies .tbo-ck__enlaces, #tbo-ck-prefs .tbo-ck__enlaces { margin: 8px 0 0; font-size: 14px; }
#tbo-cookies a, #tbo-ck-prefs a { color: inherit; text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
#tbo-cookies .tbo-ck__acciones { display: flex; flex-wrap: wrap; gap: 8px; }

#tbo-cookies.tbo-ck--barra { left: 0; right: 0; bottom: 0; }
#tbo-cookies.tbo-ck--barra .tbo-ck__banner { display: flex; align-items: center; gap: 24px; padding: 18px max(16px, calc((100vw - 1180px) / 2)); border-width: 1px 0 0; }
#tbo-cookies.tbo-ck--barra .tbo-ck__cuerpo { flex: 1 1 auto; }
#tbo-cookies.tbo-ck--barra .tbo-ck__acciones { flex: 0 0 auto; }

#tbo-cookies.tbo-ck--caja { left: 16px; bottom: 16px; max-width: 420px; width: calc(100% - 32px); }
#tbo-cookies.tbo-ck--caja .tbo-ck__banner { padding: 20px; border-radius: 14px; }
#tbo-cookies.tbo-ck--caja .tbo-ck__acciones { margin-top: 16px; }
#tbo-cookies.tbo-ck--caja .tbo-ck__btn { flex: 1 1 auto; }

#tbo-cookies.tbo-ck--centro { inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(17, 24, 39, .55); }
#tbo-cookies.tbo-ck--centro .tbo-ck__banner { max-width: 560px; width: 100%; padding: 24px; border-radius: 16px; }
#tbo-cookies.tbo-ck--centro .tbo-ck__acciones { margin-top: 18px; }
#tbo-cookies.tbo-ck--centro .tbo-ck__btn { flex: 1 1 auto; }

/* Botones: «Aceptar» y «Rechazar» tienen el mismo peso visual. */
#tbo-cookies .tbo-ck__btn, #tbo-ck-prefs .tbo-ck__btn {
	appearance: none; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin: 0;
	padding: 10px 18px; border: 2px solid var(--tbo-ck-color); border-radius: 8px; background: var(--tbo-ck-color); color: var(--tbo-ck-sobre);
	font: inherit; font-size: 15px; font-weight: 600; line-height: 1.2; text-transform: none; letter-spacing: normal; cursor: pointer; box-shadow: none;
	transition: filter .15s ease;
}
#tbo-cookies .tbo-ck__btn--sec, #tbo-ck-prefs .tbo-ck__btn--sec { background: transparent; color: var(--tbo-ck-texto); border-color: var(--tbo-ck-borde); }
#tbo-cookies .tbo-ck__btn:hover, #tbo-ck-prefs .tbo-ck__btn:hover { filter: brightness(1.1); }
#tbo-cookies :focus-visible, #tbo-ck-prefs :focus-visible, #tbo-ck-boton:focus-visible { outline: 3px solid var(--tbo-ck-color); outline-offset: 2px; }

/* Panel de preferencias */
#tbo-ck-prefs { position: fixed; inset: 0; z-index: 2147483001; display: flex; align-items: center; justify-content: center; padding: 16px; }
#tbo-ck-prefs .tbo-ck-modal__fondo { position: absolute; inset: 0; background: rgba(17, 24, 39, .55); }
#tbo-ck-prefs .tbo-ck-modal__caja {
	position: relative; display: flex; flex-direction: column; width: 100%; max-width: 620px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
	background: var(--tbo-ck-fondo); color: var(--tbo-ck-texto); border-radius: 16px; box-shadow: var(--tbo-ck-sombra); outline: none;
}
#tbo-ck-prefs .tbo-ck-modal__cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--tbo-ck-borde); }
#tbo-ck-prefs .tbo-ck-modal__titulo { margin: 0; padding: 0; font: inherit; font-size: 19px; font-weight: 700; color: inherit; }
#tbo-ck-prefs .tbo-ck-modal__cerrar { appearance: none; width: 40px; height: 40px; margin: 0; padding: 0; border: 0; border-radius: 8px; background: transparent; color: inherit; font-size: 26px; line-height: 1; cursor: pointer; }
#tbo-ck-prefs .tbo-ck-modal__cerrar:hover { background: rgba(127, 127, 127, .15); }
#tbo-ck-prefs .tbo-ck-modal__cuerpo { padding: 16px 22px; overflow-y: auto; }
#tbo-ck-prefs .tbo-ck-modal__cuerpo > p { margin: 0 0 12px; color: var(--tbo-ck-suave); }
#tbo-ck-prefs .tbo-ck-modal__pie { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding: 16px 22px; border-top: 1px solid var(--tbo-ck-borde); }
#tbo-ck-prefs .tbo-ck-modal__pie .tbo-ck__btn { flex: 1 1 auto; }

#tbo-ck-prefs .tbo-ck-cat { padding: 14px 0; border-top: 1px solid var(--tbo-ck-borde); }
#tbo-ck-prefs .tbo-ck-cat__cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#tbo-ck-prefs .tbo-ck-cat__t { font-weight: 700; cursor: pointer; margin: 0; }
#tbo-ck-prefs .tbo-ck-cat__siempre { font-size: 13px; font-weight: 600; color: var(--tbo-ck-suave); }
#tbo-ck-prefs .tbo-ck-cat__desc { margin: 6px 0 0; font-size: 14px; color: var(--tbo-ck-suave); }
#tbo-ck-prefs .tbo-ck-oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#tbo-ck-prefs .tbo-ck-id { margin: 12px 0 0; font-size: 13px; color: var(--tbo-ck-suave); overflow-wrap: anywhere; }
#tbo-ck-prefs .tbo-ck-id code { font-size: 12px; }

/* Interruptor accesible: el input real ocupa toda la pista. */
#tbo-ck-prefs .tbo-ck-switch { position: relative; flex: 0 0 auto; width: 48px; height: 28px; }
#tbo-ck-prefs .tbo-ck-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
#tbo-ck-prefs .tbo-ck-switch__pista { position: absolute; inset: 0; border-radius: 999px; background: var(--tbo-ck-pista); transition: background .15s ease; }
#tbo-ck-prefs .tbo-ck-switch__pista::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .15s ease; }
#tbo-ck-prefs .tbo-ck-switch input:checked + .tbo-ck-switch__pista { background: var(--tbo-ck-color); }
#tbo-ck-prefs .tbo-ck-switch input:checked + .tbo-ck-switch__pista::after { transform: translateX(20px); }
#tbo-ck-prefs .tbo-ck-switch input:focus-visible + .tbo-ck-switch__pista { outline: 3px solid var(--tbo-ck-color); outline-offset: 2px; }

/* Botón flotante para cambiar o retirar el consentimiento */
#tbo-ck-boton {
	position: fixed; bottom: 16px; z-index: 2147482999; display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px;
	margin: 0; padding: 0; border: 1px solid var(--tbo-ck-borde); border-radius: 50%; background: var(--tbo-ck-fondo); color: var(--tbo-ck-color);
	box-shadow: 0 4px 14px rgba(17, 24, 39, .2); cursor: pointer;
}
#tbo-ck-boton.tbo-ck-flotante--izq { left: 16px; }
#tbo-ck-boton.tbo-ck-flotante--der { right: 16px; }
#tbo-ck-boton svg { display: block; }

html.tbo-ck-abierto, html.tbo-ck-abierto body { overflow: hidden; }

@media (max-width: 782px) {
	#tbo-cookies.tbo-ck--barra .tbo-ck__banner { flex-direction: column; align-items: stretch; gap: 14px; padding: 16px; }
	#tbo-cookies .tbo-ck__acciones { display: grid; grid-template-columns: 1fr 1fr; }
	#tbo-cookies .tbo-ck__btn--sec { grid-column: 1 / -1; order: 3; }
	#tbo-cookies.tbo-ck--caja { left: 8px; bottom: 8px; width: calc(100% - 16px); max-width: none; }
	#tbo-cookies .tbo-ck__texto { max-height: 38vh; overflow-y: auto; }
	#tbo-ck-prefs { padding: 0; align-items: flex-end; }
	#tbo-ck-prefs .tbo-ck-modal__caja { max-width: none; max-height: 92vh; max-height: 92dvh; border-radius: 16px 16px 0 0; }
	#tbo-ck-prefs .tbo-ck-modal__pie { display: grid; grid-template-columns: 1fr 1fr; }
	#tbo-ck-prefs .tbo-ck-modal__pie .tbo-ck__btn--sec { grid-column: 1 / -1; order: 3; }
}
@media (prefers-reduced-motion: reduce) {
	#tbo-cookies *, #tbo-ck-prefs * { transition: none !important; }
}
@media print {
	#tbo-cookies, #tbo-ck-prefs, #tbo-ck-boton { display: none !important; }
}
