/* Consentiment RGPD */
.crgpd-banner, .crgpd-overlay, .crgpd-reopen, .crgpd-placeholder {
	--crgpd-bg: #ffffff;
	--crgpd-fg: #1d2327;
	--crgpd-muted: #50575e;
	--crgpd-border: #dcdcde;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.5;
	box-sizing: border-box;
}
.crgpd-banner *, .crgpd-overlay *, .crgpd-placeholder * { box-sizing: border-box; }

.crgpd-banner {
	position: fixed;
	z-index: 2147483000;
	left: 16px;
	right: 16px;
	bottom: 16px;
	background: var(--crgpd-bg);
	color: var(--crgpd-fg);
	border: 1px solid var(--crgpd-border);
	border-radius: 10px;
	box-shadow: 0 8px 30px rgba(0, 0, 0, .18);
}
.crgpd-banner.crgpd-center {
	top: 50%;
	bottom: auto;
	left: 50%;
	right: auto;
	transform: translate(-50%, -50%);
	width: min(560px, calc(100% - 32px));
}
.crgpd-inner { max-width: 1100px; margin: 0 auto; padding: 18px 20px; }

.crgpd-title { margin: 0 0 6px; font-size: 18px; font-weight: 700; color: var(--crgpd-fg); line-height: 1.3; padding: 0; }
.crgpd-text { margin: 0 0 8px; color: var(--crgpd-fg); padding: 0; }
.crgpd-links { margin: 0 0 12px; padding: 0; display: flex; gap: 16px; flex-wrap: wrap; }
.crgpd-links a { color: var(--crgpd-color); text-decoration: underline; }

.crgpd-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

/* Tots els botons amb el mateix pes: rebutjar ha de ser tan visible com acceptar. */
.crgpd-btn {
	flex: 1 1 160px;
	max-width: 260px;
	margin: 0;
	padding: 10px 16px;
	border: 2px solid var(--crgpd-color);
	border-radius: 6px;
	background: var(--crgpd-color);
	color: #fff;
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	text-align: center;
}
.crgpd-btn:hover { filter: brightness(1.1); }
.crgpd-btn:focus-visible, .crgpd-reopen:focus-visible, .crgpd-close:focus-visible {
	outline: 3px solid var(--crgpd-fg);
	outline-offset: 2px;
}

/* Finestra de preferències */
.crgpd-overlay {
	position: fixed;
	inset: 0;
	z-index: 2147483001;
	background: rgba(0, 0, 0, .5);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}
.crgpd-dialog {
	background: var(--crgpd-bg);
	color: var(--crgpd-fg);
	border-radius: 10px;
	width: min(620px, 100%);
	max-height: calc(100vh - 32px);
	overflow-y: auto;
	padding: 20px;
}
.crgpd-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.crgpd-close {
	flex: 0 0 auto;
	max-width: none;
	width: 36px;
	height: 36px;
	padding: 0;
	font-size: 22px;
	line-height: 1;
	background: transparent;
	color: var(--crgpd-fg);
	border: 1px solid var(--crgpd-border);
}
.crgpd-cat { border-top: 1px solid var(--crgpd-border); padding: 12px 0; }
.crgpd-cat-head { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; margin: 0; }
.crgpd-cat-head input { width: 20px; height: 20px; margin: 0; accent-color: var(--crgpd-color); }
.crgpd-always { margin-left: auto; font-size: 13px; font-weight: 400; color: var(--crgpd-muted); }
.crgpd-cat-desc { margin: 4px 0 0 30px; color: var(--crgpd-muted); font-size: 14px; padding: 0; }
.crgpd-dialog .crgpd-links { margin-top: 8px; }

/* Botó fix per canviar el consentiment */
.crgpd-reopen {
	position: fixed;
	z-index: 2147482999;
	left: 16px;
	bottom: 16px;
	flex: none;
	max-width: none;
	padding: 6px 12px;
	font-size: 13px;
	border-radius: 20px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}

/* Contingut extern bloquejat */
.crgpd-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 20px;
	background: #f0f0f1;
	color: var(--crgpd-fg);
	border: 1px dashed var(--crgpd-border);
	border-radius: 8px;
	text-align: center;
	width: 100%;
}
.crgpd-placeholder p { margin: 0; padding: 0; }
.crgpd-placeholder .crgpd-btn { flex: none; }

body.crgpd-locked { overflow: hidden; }

@media (max-width: 600px) {
	.crgpd-banner { left: 8px; right: 8px; bottom: 8px; }
	.crgpd-inner { padding: 14px; }
	.crgpd-actions { flex-direction: column; }
	.crgpd-btn { max-width: none; width: 100%; flex: none; }
	.crgpd-close { width: 36px; }
}

/* Taula de galetes [crgpd_taula_galetes] */
.crgpd-table-wrap { overflow-x: auto; margin: 1em 0; }
.crgpd-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.crgpd-table th, .crgpd-table td { border: 1px solid #dcdcde; padding: 8px 10px; text-align: left; vertical-align: top; }
.crgpd-table th { background: #f6f7f7; }
@media (max-width: 600px) {
	.crgpd-table thead { display: none; }
	.crgpd-table, .crgpd-table tbody, .crgpd-table tr, .crgpd-table td { display: block; width: 100%; }
	.crgpd-table tr { margin-bottom: 12px; border: 1px solid #dcdcde; }
	.crgpd-table td { border: 0; border-bottom: 1px solid #f0f0f1; }
	.crgpd-table td::before { content: attr(data-label); display: block; font-weight: 600; }
}
