/*
 * Tactic Cookie Consent — estilos del banner y modal.
 * Variables propias para no depender del tema. Botones "Aceptar" y "Rechazar"
 * con el mismo tamaño/peso: rechazar es tan fácil como aceptar (requisito CNIL).
 */
:root {
	--tcc-ink: #0f1e2e;
	--tcc-muted: #5b6b7b;
	--tcc-line: #e2e8f0;
	--tcc-primary: #1a6bff;
	--tcc-primary-dark: #0b4fd6;
	--tcc-bg: #ffffff;
	--tcc-radius: 12px;
	--tcc-shadow: 0 10px 40px rgba(8, 19, 31, 0.18);
}

.tactic-cc-banner[hidden],
.tactic-cc-modal[hidden] { display: none; }

/* ---- Banner ---- */
.tactic-cc-banner {
	position: fixed;
	left: 1rem; right: 1rem; bottom: 1rem;
	z-index: 9999;
	background: var(--tcc-bg);
	color: var(--tcc-ink);
	border: 1px solid var(--tcc-line);
	border-radius: var(--tcc-radius);
	box-shadow: var(--tcc-shadow);
	max-width: 1100px;
	margin: 0 auto;
}
.tactic-cc-banner__inner {
	display: flex;
	gap: 1.25rem;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	padding: 1.1rem 1.35rem;
}
.tactic-cc-banner__text { flex: 1 1 380px; min-width: 260px; }
.tactic-cc-banner__title { margin: 0 0 0.25rem; font-size: 1.05rem; font-weight: 700; }
.tactic-cc-banner__text p { margin: 0; font-size: 0.92rem; line-height: 1.5; color: var(--tcc-muted); }
.tactic-cc-banner__text a { color: var(--tcc-primary-dark); }
.tactic-cc-banner__actions {
	display: flex;
	gap: 0.6rem;
	flex-wrap: wrap;
	align-items: center;
}

/* ---- Botones ---- */
.tactic-cc-btn {
	font: inherit;
	font-size: 0.92rem;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	border-radius: 10px;
	padding: 0.7rem 1.1rem;
	border: 1px solid transparent;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}
.tactic-cc-btn--primary { background: var(--tcc-primary); color: #fff; }
.tactic-cc-btn--primary:hover { background: var(--tcc-primary-dark); }
/* Secundario (Rechazar): mismo tamaño y peso que el primario, alto contraste. */
.tactic-cc-btn--secondary { background: #eef2f7; color: var(--tcc-ink); border-color: var(--tcc-line); }
.tactic-cc-btn--secondary:hover { background: #e2e8f0; }
.tactic-cc-btn--ghost { background: transparent; color: var(--tcc-muted); text-decoration: underline; padding-left: 0.5rem; padding-right: 0.5rem; }
.tactic-cc-btn--ghost:hover { color: var(--tcc-ink); }
.tactic-cc-btn:focus-visible,
.tactic-cc-open-settings:focus-visible { outline: 2px solid var(--tcc-primary); outline-offset: 2px; }

/* ---- Modal de preferencias ---- */
.tactic-cc-modal {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}
.tactic-cc-modal__overlay { position: absolute; inset: 0; background: rgba(8, 19, 31, 0.55); }
.tactic-cc-modal__panel {
	position: relative;
	background: var(--tcc-bg);
	color: var(--tcc-ink);
	border-radius: 16px;
	box-shadow: var(--tcc-shadow);
	width: min(560px, 100%);
	max-height: 85vh;
	overflow-y: auto;
	padding: 1.75rem;
}
.tactic-cc-modal__title { margin: 0 0 1rem; font-size: 1.35rem; font-weight: 700; }
.tactic-cc-modal__actions { display: flex; gap: 0.6rem; justify-content: flex-end; margin-top: 1.25rem; flex-wrap: wrap; }

/* ---- Categorías ---- */
.tactic-cc-cat { border-top: 1px solid var(--tcc-line); padding: 1rem 0; }
.tactic-cc-cat:first-of-type { border-top: 0; }
.tactic-cc-cat__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.tactic-cc-cat__name { font-weight: 600; }
.tactic-cc-cat__always { font-size: 0.8rem; color: var(--tcc-muted); background: #eef2f7; padding: 0.25rem 0.6rem; border-radius: 999px; }
.tactic-cc-cat__desc { margin: 0.4rem 0 0; font-size: 0.88rem; color: var(--tcc-muted); line-height: 1.5; }

/* Interruptor (switch) accesible: se apoya en un checkbox real. */
.tactic-cc-switch { display: inline-flex; align-items: center; gap: 0.6rem; cursor: pointer; }
.tactic-cc-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tactic-cc-switch__track {
	width: 42px; height: 24px; border-radius: 999px; background: #cbd5e1;
	position: relative; transition: background-color 0.15s ease; flex: none;
}
.tactic-cc-switch__track::after {
	content: ""; position: absolute; top: 3px; left: 3px;
	width: 18px; height: 18px; border-radius: 50%; background: #fff;
	transition: transform 0.15s ease; box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.tactic-cc-switch input:checked + .tactic-cc-switch__track { background: var(--tcc-primary); }
.tactic-cc-switch input:checked + .tactic-cc-switch__track::after { transform: translateX(18px); }
.tactic-cc-switch input:focus-visible + .tactic-cc-switch__track { outline: 2px solid var(--tcc-primary); outline-offset: 2px; }

/* Botón de reabrir preferencias (shortcode) */
.tactic-cc-open-settings {
	font: inherit; cursor: pointer; background: none; border: 0; padding: 0;
	color: var(--tcc-primary-dark); text-decoration: underline;
}

/* Móvil: acciones a lo ancho y en orden lógico */
@media (max-width: 600px) {
	.tactic-cc-banner__actions { width: 100%; }
	.tactic-cc-banner__actions .tactic-cc-btn--primary,
	.tactic-cc-banner__actions .tactic-cc-btn--secondary { flex: 1 1 auto; text-align: center; }
	.tactic-cc-banner__actions .tactic-cc-btn--ghost { order: 3; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
	.tactic-cc-btn, .tactic-cc-switch__track, .tactic-cc-switch__track::after { transition: none; }
}
