/* =========================================================
   Cookie Consent Banner & Preferences Modal
   El Meridiano L'Horta
   ========================================================= */

/* ── Banner ─────────────────────────────────────────────── */

.eml-cookie-banner {
	position: fixed;
	bottom: 24px;
	left: 24px;
	z-index: 99999;
	width: 380px;
	max-width: calc(100vw - 48px);
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18), 0 4px 16px rgba(0, 0, 0, 0.08);
	padding: 22px 22px 18px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	/* entrance: start hidden below, animate up */
	transform: translateY(calc(100% + 32px));
	opacity: 0;
	transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.32s ease;
}

.eml-cookie-banner.is-visible {
	transform: translateY(0);
	opacity: 1;
}

.eml-cookie-banner__icon {
	font-size: 22px;
	line-height: 1;
}

.eml-cookie-banner__title {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	color: #1d2327;
	letter-spacing: 0.01em;
}

.eml-cookie-banner__text {
	margin: 0;
	font-size: 13px;
	line-height: 1.55;
	color: #555d66;
}

.eml-cookie-banner__policy-link {
	color: #0d9488;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.eml-cookie-banner__policy-link:hover {
	color: #0f766e;
}

.eml-cookie-banner__actions {
	display: flex;
	gap: 8px;
	margin-top: 4px;
}

.eml-cookie-banner__manage-link {
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	font-size: 12px;
	color: #a7aaad;
	text-decoration: underline;
	text-underline-offset: 2px;
	text-align: left;
	transition: color 0.15s ease;
}

.eml-cookie-banner__manage-link:hover {
	color: #0d9488;
}

/* ── Shared button styles ────────────────────────────────── */

.eml-cookie-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: none;
	cursor: pointer;
	font-size: 13px;
	font-weight: 800;
	letter-spacing: 0.04em;
	padding: 9px 14px;
	border-radius: 3px;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
	white-space: nowrap;
}

.eml-cookie-btn--primary {
	background: #0d9488;
	color: #fff;
	border: 1.5px solid #0d9488;
}

.eml-cookie-btn--primary:hover {
	background: #0f766e;
	border-color: #0f766e;
}

.eml-cookie-btn--secondary {
	background: transparent;
	color: #0d9488;
	border: 1.5px solid #0d9488;
}

.eml-cookie-btn--secondary:hover {
	background: #f0fdfa;
}

/* ── Preferences modal ───────────────────────────────────── */

.eml-cookie-modal {
	position: fixed;
	inset: 0;
	z-index: 100001;
	display: flex;
	align-items: center;
	justify-content: center;
}

.eml-cookie-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	backdrop-filter: blur(2px);
}

.eml-cookie-modal__content {
	position: relative;
	z-index: 1;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
	width: 520px;
	max-width: calc(100vw - 40px);
	max-height: 85vh;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.eml-cookie-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 20px 14px;
	border-bottom: 1px solid #f0f0f1;
	flex-shrink: 0;
}

.eml-cookie-modal__title {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	color: #1d2327;
}

.eml-cookie-modal__close {
	background: none;
	border: none;
	cursor: pointer;
	padding: 4px;
	color: #a7aaad;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 4px;
	transition: color 0.15s ease, background 0.15s ease;
}

.eml-cookie-modal__close:hover {
	color: #0d9488;
	background: #f0fdfa;
}

.eml-cookie-modal__body {
	padding: 20px;
	overflow-y: auto;
	flex: 1;
}

.eml-cookie-modal__intro {
	margin: 0 0 18px;
	font-size: 13px;
	line-height: 1.6;
	color: #555d66;
}

.eml-cookie-modal__footer {
	display: flex;
	gap: 10px;
	padding: 16px 20px;
	border-top: 1px solid #f0f0f1;
	flex-shrink: 0;
}

/* ── Preference list ─────────────────────────────────────── */

.eml-cookie-pref-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0;
}

.eml-cookie-pref-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 16px 0;
	border-bottom: 1px solid #f0f0f1;
}

.eml-cookie-pref-item:last-child {
	border-bottom: none;
}

.eml-cookie-pref-item__info {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.eml-cookie-pref-item__name {
	font-size: 13px;
	font-weight: 700;
	color: #1d2327;
}

.eml-cookie-pref-item__desc {
	font-size: 12px;
	line-height: 1.5;
	color: #a7aaad;
}

/* ── Toggle switch ───────────────────────────────────────── */

.eml-cookie-toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	flex-shrink: 0;
}

.eml-cookie-toggle--disabled {
	cursor: default;
}

.eml-cookie-toggle__input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.eml-cookie-toggle__track {
	position: relative;
	display: inline-block;
	width: 40px;
	height: 22px;
	background: #dcdcde;
	border-radius: 999px;
	transition: background 0.18s ease;
	flex-shrink: 0;
}

.eml-cookie-toggle__thumb {
	position: absolute;
	top: 3px;
	left: 3px;
	width: 16px;
	height: 16px;
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
	transition: transform 0.18s ease;
}

/* checked state */
.eml-cookie-toggle__input:checked + .eml-cookie-toggle__track {
	background: #0d9488;
}

.eml-cookie-toggle__input:checked + .eml-cookie-toggle__track .eml-cookie-toggle__thumb {
	transform: translateX(18px);
}

/* always-on (disabled) state */
.eml-cookie-toggle--disabled .eml-cookie-toggle__track {
	background: #0d9488;
	opacity: 0.5;
}

.eml-cookie-toggle--disabled .eml-cookie-toggle__thumb {
	transform: translateX(18px);
}

.eml-cookie-toggle__label {
	font-size: 11px;
	font-weight: 600;
	color: #a7aaad;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	white-space: nowrap;
}

/* focus ring for keyboard nav */
.eml-cookie-toggle__input:focus-visible + .eml-cookie-toggle__track {
	outline: 2px solid #0d9488;
	outline-offset: 2px;
}

/* ── Accessibility ───────────────────────────────────────── */

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ── Footer menu link ────────────────────────────────────── */

.eml-cookie-footer-link {
	background: none;
	border: none;
	padding: 0;
	margin: 0;
	cursor: pointer;
	font-family: inherit;
	text-align: left;
	-webkit-appearance: none;
}

/* ── Mobile ──────────────────────────────────────────────── */

@media (max-width: 480px) {
	.eml-cookie-banner {
		bottom: 0;
		left: 0;
		right: 0;
		width: 100%;
		max-width: 100%;
		border-radius: 12px 12px 0 0;
		box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
		padding: 20px 16px 28px;
		transform: translateY(100%);
	}

	.eml-cookie-banner.is-visible {
		transform: translateY(0);
	}

	.eml-cookie-banner__actions {
		flex-direction: column;
	}

	.eml-cookie-btn {
		width: 100%;
	}

	.eml-cookie-modal__footer {
		flex-direction: column;
	}

	.eml-cookie-modal__footer .eml-cookie-btn {
		width: 100%;
	}
}
