/* Cookie Consent Manager - estilos frontend
   Diseño minimalista, paleta sobria, pensado para integrarse en cualquier web. */

.ccm-overlay,
.ccm-banner,
.ccm-modal {
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
}

.ccm-overlay *,
.ccm-banner *,
.ccm-modal * {
	box-sizing: border-box;
}

/* --- Overlay bloqueante --- */
/* Oscurece ligeramente y bloquea la interacción con el resto de la página
   hasta que el usuario acepte, deniegue o guarde sus preferencias. */

.ccm-overlay {
	position: fixed;
	inset: 0;
	z-index: 999998;
	background: rgba(20, 20, 20, 0.35);
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);
	animation: ccm-fade-in 0.25s ease;
}

@keyframes ccm-fade-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes ccm-pop-in {
	from { opacity: 0; transform: translate(-50%, -48%) scale(0.97); }
	to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* --- Banner / cuadro principal (ahora modal centrado) --- */

.ccm-banner {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 999999;
	width: 92%;
	max-width: 460px;
	max-height: 88vh;
	overflow-y: auto;
	background: var(--ccm-bg, #ffffff);
	color: var(--ccm-text, #1a1a1a);
	border-radius: 16px;
	padding: 32px 28px 28px;
	box-shadow: 0 24px 60px -10px rgba(0,0,0,0.25), 0 0 0 1px rgba(0,0,0,0.04);
	animation: ccm-pop-in 0.25s ease;
	text-align: center;
}

.ccm-banner-icon {
	width: 48px;
	height: 48px;
	margin: 0 auto 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: rgba(0,0,0,0.04);
	color: var(--ccm-text, #1a1a1a);
	opacity: 0.8;
}

.ccm-banner-title {
	margin: 0 0 10px 0;
	font-size: 18px;
	font-weight: 600;
	letter-spacing: -0.01em;
}

.ccm-banner-text {
	margin: 0 0 24px 0;
	color: inherit;
	opacity: 0.65;
	font-size: 14px;
	line-height: 1.6;
}

.ccm-policy-link {
	color: var(--ccm-primary, #1a1a1a);
	text-decoration: underline;
	text-decoration-color: rgba(0,0,0,0.25);
	text-underline-offset: 2px;
	opacity: 1;
	font-weight: 500;
}

.ccm-banner-actions {
	display: flex;
	flex-direction: column;
	gap: 7px;
}

.ccm-banner-actions .ccm-btn {
	width: 100%;
}

/* El botón "Configurar" queda visualmente más discreto, como acción secundaria */
.ccm-banner-actions .ccm-btn-ghost {
	order: 4;
	margin-top: 4px;
}

.ccm-banner-actions .ccm-btn-outline {
	order: 2;
}

.ccm-banner-actions .ccm-btn-primary {
	order: 1;
}

#ccm-essential-only.ccm-btn-outline {
	order: 3;
}

/* --- Botones --- */
/* Paleta sobria: primario oscuro casi negro por defecto, sin colores llamativos,
   para integrarse visualmente en cualquier identidad de marca. */

.ccm-btn {
	cursor: pointer;
	border: none;
	border-radius: 10px;
	padding: 12px 20px;
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
	font-family: inherit;
	transition: opacity 0.15s ease, transform 0.1s ease, background-color 0.15s ease;
}

.ccm-btn:hover { opacity: 0.85; }
.ccm-btn:active { transform: scale(0.98); }
.ccm-btn:focus-visible {
	outline: 2px solid var(--ccm-primary, #1a1a1a);
	outline-offset: 2px;
}

.ccm-btn-primary {
	background: var(--ccm-primary, #1a1a1a);
	color: #fff;
}

.ccm-btn-outline {
	background: transparent;
	color: var(--ccm-text, #1a1a1a);
	border: 1.5px solid rgba(0,0,0,0.15);
}

.ccm-btn-outline:hover {
	background: rgba(0,0,0,0.03);
	opacity: 1;
}

.ccm-btn-ghost {
	background: none;
	color: var(--ccm-text, #1a1a1a);
	opacity: 0.55;
	text-decoration: underline;
	text-decoration-color: rgba(0,0,0,0.2);
	text-underline-offset: 2px;
	padding: 6px 4px;
}

.ccm-btn-ghost:hover {
	opacity: 0.85;
}

/* --- Modal de preferencias detallado --- */

.ccm-modal {
	position: fixed;
	inset: 0;
	z-index: 1000000;
}

.ccm-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(20, 20, 20, 0.4);
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);
}

.ccm-modal-box {
	position: relative;
	max-width: 560px;
	width: 92%;
	margin: 5vh auto;
	background: var(--ccm-bg, #ffffff);
	color: var(--ccm-text, #1a1a1a);
	border-radius: 16px;
	max-height: 90vh;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	box-shadow: 0 24px 60px -10px rgba(0,0,0,0.25), 0 0 0 1px rgba(0,0,0,0.04);
	animation: ccm-pop-in 0.2s ease;
}

.ccm-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 22px 26px;
	border-bottom: 1px solid rgba(0,0,0,0.06);
}

.ccm-modal-header h2 {
	margin: 0;
	font-size: 17px;
	font-weight: 600;
	letter-spacing: -0.01em;
}

.ccm-modal-close {
	background: none;
	border: none;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	color: inherit;
	opacity: 0.45;
	padding: 4px 6px;
	border-radius: 6px;
	transition: opacity 0.15s ease, background-color 0.15s ease;
}

.ccm-modal-close:hover {
	opacity: 0.9;
	background: rgba(0,0,0,0.04);
}

.ccm-modal-body {
	padding: 6px 26px 18px;
	overflow-y: auto;
	flex: 1;
}

.ccm-modal-intro {
	font-size: 13.5px;
	opacity: 0.6;
	margin: 16px 0 18px 0;
	padding-bottom: 16px;
	border-bottom: 1px solid rgba(0,0,0,0.06);
	line-height: 1.6;
}

.ccm-modal-intro a {
	color: var(--ccm-primary, #1a1a1a);
	text-decoration: underline;
	text-decoration-color: rgba(0,0,0,0.25);
	text-underline-offset: 2px;
	font-weight: 500;
}

.ccm-category {
	padding: 16px 0;
	border-bottom: 1px solid rgba(0,0,0,0.06);
}

.ccm-category:last-child { border-bottom: none; }

.ccm-category-header {
	display: flex;
	align-items: center;
	gap: 12px;
}

.ccm-category-toggle-details {
	flex: 1;
	display: flex;
	align-items: center;
	gap: 8px;
	background: none;
	border: none;
	cursor: pointer;
	color: inherit;
	font: inherit;
	padding: 0;
	text-align: left;
}

.ccm-category-label {
	font-weight: 600;
	font-size: 14.5px;
}

.ccm-chevron {
	font-size: 12px;
	opacity: 0.4;
	transition: transform 0.15s ease;
}

.ccm-category-toggle-details.ccm-expanded .ccm-chevron {
	transform: rotate(180deg);
}

.ccm-badge {
	font-size: 11.5px;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	background: rgba(0,0,0,0.05);
	color: inherit;
	opacity: 0.6;
	padding: 4px 9px;
	border-radius: 20px;
	font-weight: 600;
	white-space: nowrap;
}

.ccm-category-desc {
	margin: 8px 0 0 0;
	font-size: 14px;
	opacity: 0.6;
	line-height: 1.6;
}

.ccm-category-details {
	margin-top: 12px;
	overflow-x: auto;
}

.ccm-services-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13.5px;
}

.ccm-services-table th,
.ccm-services-table td {
	text-align: left;
	padding: 7px 8px;
	border-bottom: 1px solid rgba(0,0,0,0.05);
}

.ccm-services-table th {
	font-weight: 600;
	opacity: 0.5;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.4px;
}

.ccm-no-services {
	font-size: 13.5px;
	opacity: 0.5;
	margin: 6px 0 0 0;
}

.ccm-modal-footer {
	padding: 18px 26px;
	border-top: 1px solid rgba(0,0,0,0.06);
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 10px;
}

.ccm-modal-legal-links {
	padding: 14px 26px 18px;
	display: flex;
	gap: 18px;
	flex-wrap: wrap;
	justify-content: center;
	font-size: 13.5px;
	border-top: 1px solid rgba(0,0,0,0.05);
}

.ccm-modal-legal-links a {
	color: var(--ccm-text, #1a1a1a);
	text-decoration: underline;
	text-decoration-color: rgba(0,0,0,0.25);
	text-underline-offset: 2px;
	font-weight: 500;
	opacity: 0.7;
	transition: opacity 0.15s ease;
}

.ccm-modal-legal-links a:hover {
	opacity: 1;
}

/* --- Switch toggle --- */

.ccm-switch {
	position: relative;
	display: inline-block;
	width: 40px;
	height: 23px;
	flex-shrink: 0;
}

.ccm-switch input {
	opacity: 0;
	width: 0;
	height: 0;
}

.ccm-slider {
	position: absolute;
	cursor: pointer;
	inset: 0;
	background-color: rgba(0,0,0,0.15);
	border-radius: 24px;
	transition: 0.2s;
}

.ccm-slider::before {
	position: absolute;
	content: "";
	height: 17px;
	width: 17px;
	left: 3px;
	bottom: 3px;
	background-color: #fff;
	border-radius: 50%;
	transition: 0.2s;
	box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.ccm-switch input:checked + .ccm-slider {
	background-color: var(--ccm-primary, #1a1a1a);
}

.ccm-switch input:checked + .ccm-slider::before {
	transform: translateX(17px);
}

.ccm-switch input:disabled + .ccm-slider {
	opacity: 0.4;
	cursor: not-allowed;
}

body.ccm-modal-open,
body.ccm-banner-open {
	overflow: hidden;
}

/* --- Responsive --- */

@media (max-width: 640px) {
	.ccm-banner {
		width: 90%;
		padding: 28px 22px 24px;
	}

	.ccm-modal-footer {
		flex-direction: column-reverse;
	}

	.ccm-modal-footer .ccm-btn {
		width: 100%;
	}

	.ccm-modal-box {
		margin: 4vh auto;
		max-height: 92vh;
	}

	.ccm-modal-header,
	.ccm-modal-body,
	.ccm-modal-footer,
	.ccm-modal-legal-links {
		padding-left: 20px;
		padding-right: 20px;
	}
}
