/*
 * Banner de consentimiento. Mantiene la línea del popup anterior (css/_cookies.scss):
 * tarjeta blanca, radio 20px, Cera Pro, botones negros tipo píldora.
 * html tiene font-size 62.5% → 1rem = 10px.
 */
.ft-consent {
	--ft-black: #333333;
	--ft-white: #ffffff;
	--ft-grey: #808080;
	--ft-grey-light: #f9f9f9;
	--ft-grey-line: #ebebeb;
	--ft-teal: #15d0c7;
	--ft-teal-text: #0a7a74; /* turquesa del sitio oscurecido para contraste AA sobre blanco */
	--ft-radius: 20px;
	--ft-shadow: 0 0 15px rgba(51, 51, 51, .25);

	position: fixed;
	inset: 0;
	z-index: 2147483000;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	padding: 1.6rem;
	font-family: 'Cera Pro', sans-serif;
	color: var(--ft-black);
	line-height: 1.4;
	pointer-events: none;
}

.ft-consent[hidden],
.ft-consent [hidden],
.ft-consent-reopen[hidden] {
	display: none !important;
}

.ft-consent *,
.ft-consent *::before,
.ft-consent *::after {
	box-sizing: border-box;
}

.ft-consent__backdrop {
	position: fixed;
	inset: 0;
	background: rgba(255, 255, 255, .6);
	backdrop-filter: blur(2px);
	pointer-events: auto;
}

/* Páginas legales: sin fondo ni bloqueo, la página se puede leer y usar. */
.ft-consent--inline .ft-consent__backdrop {
	display: none;
}

.ft-consent--inline.ft-consent--settings .ft-consent__backdrop {
	display: block;
}

.ft-consent__dialog {
	position: relative;
	width: 100%;
	max-width: 1450px;
	max-height: calc(100vh - 3.2rem);
	max-height: calc(100dvh - 3.2rem);
	display: flex;
	flex-direction: column;
	background: var(--ft-white);
	border-radius: var(--ft-radius);
	box-shadow: var(--ft-shadow);
	pointer-events: auto;
	animation: ft-consent-in .35s ease-out;
	outline: none;
}

.ft-consent--settings .ft-consent__dialog {
	max-width: 820px;
	align-self: center;
}

@keyframes ft-consent-in {
	from { transform: translateY(2rem); opacity: 0; }
	to { transform: none; opacity: 1; }
}

.ft-consent__layer {
	display: flex;
	flex-direction: column;
	min-height: 0;
	padding: 2.4rem;
}

/* ---------------------------------------------------------------- 1.ª capa */

.ft-consent__layer[data-ft-layer="main"] {
	overflow-y: auto;
}

.ft-consent__title {
	margin: 0 0 1rem;
	font-size: 2rem;
	font-weight: 700;
	line-height: 1.25;
	outline: none;
}

.ft-consent__text {
	margin: 0 0 1rem;
	font-size: 1.4rem;
}

.ft-consent__links {
	display: flex;
	flex-wrap: wrap;
	gap: .4rem 1.6rem;
	margin: 0 0 .4rem;
}

.ft-consent a {
	color: var(--ft-teal-text);
	font-weight: 700;
	font-size: 1.4rem;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.ft-consent a:hover {
	color: var(--ft-black);
}

.ft-consent__actions {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	margin-top: 1.6rem;
}

/* Los tres botones tienen exactamente el mismo estilo: mismo peso visual. */
.ft-consent__btn,
.ft-placeholder .ft-consent__btn,
.ft-form-notice .ft-consent__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 4.4rem;
	padding: 1rem 2rem;
	border: 2px solid #333333;
	border-radius: 20px;
	background: #333333;
	color: #ffffff;
	font-family: 'Cera Pro', sans-serif;
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	cursor: pointer;
	transition: background-color .2s, color .2s;
}

.ft-consent__btn:hover {
	background: #ffffff;
	color: #333333;
}

.ft-consent__link {
	padding: 0;
	border: 0;
	background: none;
	color: #0a7a74;
	font: inherit;
	font-size: 1.4rem;
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}

.ft-consent :focus-visible,
.ft-consent-reopen:focus-visible,
.ft-placeholder :focus-visible,
.ft-form-notice :focus-visible {
	outline: 3px solid #333333;
	outline-offset: 2px;
	box-shadow: 0 0 0 5px #ffffff;
}

@media (min-width: 768px) {
	.ft-consent {
		padding: 2rem;
	}

	.ft-consent__actions {
		flex-direction: row;
		justify-content: flex-end;
	}

	.ft-consent__actions .ft-consent__btn {
		flex: 1 1 0;
	}
}

@media (min-width: 1024px) {
	.ft-consent__layer[data-ft-layer="main"] {
		display: grid;
		grid-template-columns: 1fr 28rem;
		grid-template-areas:
			"title actions"
			"text actions"
			"links actions";
		column-gap: 6rem;
		align-items: start;
		padding: 2.4rem 3.2rem;
	}

	.ft-consent__layer[data-ft-layer="main"] .ft-consent__title { grid-area: title; }
	.ft-consent__layer[data-ft-layer="main"] .ft-consent__text { grid-area: text; }
	.ft-consent__layer[data-ft-layer="main"] .ft-consent__links { grid-area: links; }

	.ft-consent__layer[data-ft-layer="main"] .ft-consent__actions {
		grid-area: actions;
		flex-direction: column;
		align-self: center;
		margin-top: 0;
	}
}

/* ---------------------------------------------------------------- 2.ª capa */

.ft-consent__layer[data-ft-layer="settings"] {
	padding: 0;
	height: 100%;
}

.ft-consent__head {
	display: flex;
	align-items: center;
	gap: 1.2rem;
	padding: 2rem 2.4rem 1.2rem;
	border-bottom: 1px solid var(--ft-grey-line);
}

.ft-consent__head .ft-consent__title {
	margin: 0;
}

.ft-consent__back {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 4.4rem;
	height: 4.4rem;
	flex: 0 0 auto;
	border: 0;
	border-radius: 50%;
	background: var(--ft-grey-light);
	color: var(--ft-black);
	cursor: pointer;
}

.ft-consent__scroll {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 1.6rem 2.4rem;
}

.ft-consent__layer[data-ft-layer="settings"] .ft-consent__actions {
	margin: 0;
	padding: 1.6rem 2.4rem 2rem;
	border-top: 1px solid var(--ft-grey-line);
}

.ft-cat {
	padding: 1.6rem 0;
	border-bottom: 1px solid var(--ft-grey-line);
}

.ft-cat:last-of-type {
	border-bottom: 0;
}

.ft-cat__head,
.ft-service__head {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.ft-cat__title {
	flex: 1 1 auto;
	margin: 0;
	font-size: 1.7rem;
	font-weight: 700;
}

.ft-cat__always {
	font-size: 1.3rem;
	color: var(--ft-grey);
}

.ft-cat__desc,
.ft-cat__empty {
	margin: .6rem 0 .8rem;
	font-size: 1.4rem;
}

.ft-cat__empty {
	color: var(--ft-grey);
	font-style: italic;
}

.ft-cat__toggle {
	min-height: 4.4rem;
	padding: 0;
	border: 0;
	background: none;
	color: var(--ft-teal-text);
	font: inherit;
	font-size: 1.4rem;
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}

.ft-services {
	display: grid;
	gap: 1rem;
	margin-top: .4rem;
}

.ft-service {
	padding: 1.4rem 1.6rem;
	border-radius: 10px;
	background: var(--ft-grey-light);
}

.ft-service__name {
	flex: 1 1 auto;
	margin: 0;
	font-size: 1.5rem;
	font-weight: 700;
}

.ft-service__info {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: .4rem 1.2rem;
	margin: 1rem 0;
	font-size: 1.3rem;
}

.ft-service__info dt {
	font-weight: 700;
}

.ft-service__info dd {
	margin: 0;
	overflow-wrap: anywhere;
}

.ft-service__info a {
	font-size: 1.3rem;
}

.ft-service__cookies table {
	width: 100%;
	border-collapse: collapse;
	font-size: 1.25rem;
}

.ft-service__cookies caption {
	margin-bottom: .4rem;
	font-weight: 700;
	text-align: left;
}

.ft-service__cookies th,
.ft-service__cookies td {
	padding: .6rem .8rem;
	border-bottom: 1px solid var(--ft-grey-line);
	text-align: left;
	vertical-align: top;
}

.ft-service__cookies code {
	font-size: 1.2rem;
	overflow-wrap: anywhere;
}

@media (max-width: 599px) {
	.ft-service__info {
		grid-template-columns: 1fr;
	}

	.ft-service__info dd {
		margin-bottom: .6rem;
	}

	.ft-service__cookies thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
	}

	.ft-service__cookies tr {
		display: block;
		padding: .6rem 0;
		border-bottom: 1px solid var(--ft-grey-line);
	}

	.ft-service__cookies td {
		display: grid;
		grid-template-columns: 7.5rem 1fr;
		gap: .8rem;
		padding: .2rem 0;
		border: 0;
	}

	.ft-service__cookies td::before {
		content: attr(data-label);
		font-weight: 700;
	}
}

.ft-consent__meta {
	margin-top: 1.6rem;
	padding: 1.4rem 1.6rem;
	border-radius: 10px;
	border: 1px solid var(--ft-grey-line);
	font-size: 1.3rem;
}

.ft-consent__meta p {
	margin: 0 0 .8rem;
}

.ft-consent__meta code {
	overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------- switch */

.ft-switch {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 4.4rem;
	min-height: 4.4rem;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
}

.ft-switch__track {
	position: relative;
	width: 4.4rem;
	height: 2.4rem;
	border-radius: 2.4rem;
	background: var(--ft-grey);
	transition: background-color .2s;
}

.ft-switch__thumb {
	position: absolute;
	top: .3rem;
	left: .3rem;
	width: 1.8rem;
	height: 1.8rem;
	border-radius: 50%;
	background: var(--ft-white);
	transition: transform .2s;
}

.ft-switch[aria-checked="true"] .ft-switch__track {
	background: var(--ft-teal-text);
}

.ft-switch[aria-checked="true"] .ft-switch__thumb {
	transform: translateX(2rem);
}

.ft-switch:disabled {
	cursor: not-allowed;
	opacity: .55;
}

/* ---------------------------------------------------------------- reabrir */

.ft-consent-reopen {
	position: fixed;
	left: 1.6rem;
	bottom: 1.6rem;
	z-index: 99990;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 4.4rem;
	height: 4.4rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #ffffff;
	color: #333333;
	box-shadow: 0 0 15px rgba(51, 51, 51, .25);
	cursor: pointer;
}

.ft-consent-reopen:hover {
	background: #333333;
	color: #ffffff;
}

html.ft-consent-lock,
html.ft-consent-lock body {
	overflow: hidden;
}

/* ---------------------------------------------------------------- placeholders */

.ft-consent-embed iframe[data-ft-src] {
	display: none;
}

.ft-placeholder-host {
	position: relative;
	min-height: 24rem;
}

.ft-placeholder,
.ft-form-notice {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1.2rem;
	padding: 2.4rem;
	border-radius: 20px;
	background: #f5f5f5;
	color: #333333;
	font-family: 'Cera Pro', sans-serif;
	font-size: 1.4rem;
	line-height: 1.4;
	text-align: center;
}

.ft-placeholder {
	min-height: 24rem;
}

.ft-placeholder-host > .ft-placeholder {
	position: absolute;
	inset: 0;
	z-index: 2;
}

.ft-placeholder p,
.ft-form-notice p {
	max-width: 52rem;
	margin: 0;
}

.ft-form-notice {
	margin-bottom: 2rem;
	align-items: flex-start;
	text-align: left;
}

@media (prefers-reduced-motion: reduce) {
	.ft-consent__dialog { animation: none; }
	.ft-consent__btn,
	.ft-switch__track,
	.ft-switch__thumb { transition: none; }
}
