/* CNC Cookie Consent — modal centrado, sobrio, sin dependencias.
   Colores configurables en Ajustes → Cookies CNC vía custom properties. */

#cnc-cc {
	--cnc-primary: #2b4c66;
	--cnc-btn-text: #ffffff;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.5;
	color: #222;
}

.cnc-cc-overlay {
	position: fixed;
	inset: 0;
	background: rgba(20, 20, 40, 0.6);
	z-index: 100000;
}
.cnc-cc-overlay[hidden] { display: none; }

.cnc-cc-modal {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 100001;
	width: min(480px, calc(100vw - 32px));
	max-height: calc(100vh - 48px);
	overflow-y: auto;
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
	padding: 26px 28px;
	box-sizing: border-box;
}
.cnc-cc-modal[hidden] { display: none; }

.cnc-cc-modal h2 {
	margin: 0 0 10px;
	font-size: 19px;
	line-height: 1.3;
	color: #1a1a1a;
}

.cnc-cc-msg {
	margin: 0 0 18px;
	color: #444;
}
.cnc-cc-msg a {
	background: none;
	color: #1a1a1a;
	text-decoration: underline;
}
.cnc-cc-msg a:hover {
	background: none;
	color: var(--cnc-primary, #2b4c66);
}

/* Segunda capa: categorías */
.cnc-cc-prefs[hidden] { display: none; }
.cnc-cc-cat {
	border: 1px solid #e3e3e3;
	border-radius: 8px;
	padding: 12px 14px;
	margin-bottom: 10px;
}
.cnc-cc-cat p {
	margin: 6px 0 0;
	font-size: 13px;
	color: #666;
}
.cnc-cc-cat-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}
.cnc-cc-always {
	font-size: 12px;
	color: #2e7d32;
	font-weight: 600;
	white-space: nowrap;
}

/* Interruptor accesible */
.cnc-cc-switch {
	position: relative;
	display: inline-block;
	flex: none;
}
.cnc-cc-switch input {
	position: absolute;
	opacity: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	cursor: pointer;
}
.cnc-cc-slider {
	display: block;
	width: 40px;
	height: 22px;
	background: #c7c7c7;
	border-radius: 22px;
	transition: background 0.15s;
	pointer-events: none;
}
.cnc-cc-slider::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 16px;
	height: 16px;
	background: #fff;
	border-radius: 50%;
	transition: transform 0.15s;
}
.cnc-cc-switch input:checked + .cnc-cc-slider { background: var(--cnc-primary, #2b4c66); }
.cnc-cc-switch input:checked + .cnc-cc-slider::after { transform: translateX(18px); }
.cnc-cc-switch input:focus-visible + .cnc-cc-slider { outline: 2px solid var(--cnc-primary, #2b4c66); outline-offset: 2px; }
.cnc-cc-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* Tabla de cookies por categoría */
.cnc-cc-cookies {
	margin-top: 8px;
	font-size: 12px;
}
.cnc-cc-cookies summary {
	cursor: pointer;
	color: #555;
	text-decoration: underline;
	list-style: none;
}
.cnc-cc-cookies summary::-webkit-details-marker { display: none; }
.cnc-cc-cookies summary:hover { color: var(--cnc-primary, #2b4c66); }
.cnc-cc-cookies table {
	width: 100%;
	margin-top: 8px;
	border-collapse: collapse;
}
.cnc-cc-cookies th,
.cnc-cc-cookies td {
	text-align: start;
	padding: 4px 6px;
	border-bottom: 1px solid #ececec;
	color: #555;
	vertical-align: top;
	font-weight: normal;
}
.cnc-cc-cookies th { color: #333; font-weight: 600; }
.cnc-cc-cookies code {
	background: none;
	padding: 0;
	font-size: 11px;
	word-break: break-all;
}

/* Acciones — Rechazar en outline, mismo tamaño/capa/posición que Aceptar */
.cnc-cc-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
}
.cnc-cc-main-btns {
	display: flex;
	gap: 10px;
	margin-left: auto;
}
#cnc-cc[dir="rtl"] .cnc-cc-main-btns { margin-left: 0; margin-right: auto; }

/* Blindaje contra estilos del tema en todos los controles del modal */
.cnc-cc-btn,
.cnc-cc-link {
	background-image: none;
	text-transform: none;
	letter-spacing: normal;
	box-shadow: none;
}

.cnc-cc-btn {
	appearance: none;
	border: 1px solid var(--cnc-primary, #2b4c66);
	background: var(--cnc-primary, #2b4c66);
	color: var(--cnc-btn-text, #fff);
	font: inherit;
	font-weight: 600;
	padding: 9px 20px;
	border-radius: 6px;
	cursor: pointer;
}
.cnc-cc-btn:hover {
	background: var(--cnc-primary, #2b4c66);
	background-image: none;
	color: var(--cnc-btn-text, #fff);
	filter: brightness(1.15);
}
.cnc-cc-btn:focus-visible { outline: 2px solid var(--cnc-primary, #2b4c66); outline-offset: 2px; }

.cnc-cc-btn-outline {
	background: transparent;
	color: var(--cnc-primary, #2b4c66);
}
.cnc-cc-btn-outline:hover {
	background: rgba(0, 0, 0, 0.04);
	background-image: none;
	color: var(--cnc-primary, #2b4c66);
	filter: none;
}

.cnc-cc-btn-full {
	width: 100%;
	margin: 4px 0 14px;
}

.cnc-cc-link {
	appearance: none;
	background: none !important;
	border: none;
	padding: 0;
	font: inherit;
	color: #555;
	text-decoration: underline;
	cursor: pointer;
}
.cnc-cc-link:hover {
	background: none !important;
	background-image: none !important;
	color: var(--cnc-primary, #2b4c66);
	text-decoration: underline;
}

/* Disparador del shortcode [cnc_cookie_settings]: se lee como un enlace del tema */
button.cnc-cc-open {
	appearance: none;
	background: none;
	background-image: none;
	border: 0;
	padding: 0;
	font: inherit;
	color: inherit;
	text-decoration: underline;
	cursor: pointer;
}

/* Botón de revocación */
#cnc-cc-revoke {
	position: fixed;
	bottom: 16px;
	left: 16px;
	z-index: 99999;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 1px solid #d5d5d5;
	background: #fff;
	background-image: none;
	color: #444;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
#cnc-cc-revoke:hover { color: var(--cnc-primary, #2b4c66); background: #fff; }
#cnc-cc-revoke[hidden] { display: none; }
#cnc-cc[dir="rtl"] #cnc-cc-revoke { left: auto; right: 16px; }

/* Scroll bloqueado mientras el modal está abierto */
html.cnc-cc-lock, html.cnc-cc-lock body { overflow: hidden !important; }

@media (max-width: 480px) {
	.cnc-cc-modal { padding: 20px 18px; }
	.cnc-cc-actions { flex-direction: column; align-items: stretch; }
	.cnc-cc-main-btns { margin-left: 0; }
	.cnc-cc-main-btns .cnc-cc-btn { flex: 1; }
	.cnc-cc-link { align-self: center; order: 2; margin-top: 10px; }
}
