/*
 * Copamex Site -- the cookie consent panel (1.46.0, Phase 15.1; Tracking).
 *
 * A card fixed in the bottom-left corner (the WhatsApp button owns the
 * bottom-right), full width on phones; not a modal, so the page stays usable.
 * Same layer as the WhatsApp button (--ilm-z-dropdown minus one): ILM's
 * menus, the sticky header and its dialogs open over it. Light whatever the
 * page; its colours are its own. Plain CSS, no build step.
 */

.copamex-consent,
.copamex-consent-reopen {
	--copamex-consent-ink: #1d2327;
	--copamex-consent-accent: #075e54;
	--copamex-consent-gap: 1rem;
	position: fixed;
	inset-block-end: calc(var(--copamex-consent-gap) + env(safe-area-inset-bottom, 0px));
	inset-inline-start: calc(var(--copamex-consent-gap) + env(safe-area-inset-left, 0px));
	z-index: calc(var(--ilm-z-dropdown, 1000) - 1);
	box-sizing: border-box;
	font-family: inherit;
	font-size: 0.9375rem;
	line-height: 1.45;
	color: var(--copamex-consent-ink);
}

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

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

.copamex-consent {
	inline-size: min(26rem, calc(100vw - 2 * var(--copamex-consent-gap)));
	max-block-size: calc(100vh - 2 * var(--copamex-consent-gap));
	overflow: auto;
	padding: 1.125rem 1.25rem;
	border: 1px solid #c3c4c7;
	border-radius: 0.75rem;
	background: #fff;
	box-shadow: 0 0.5rem 2rem rgb(0 0 0 / 0.18);
}

.copamex-consent__title {
	margin: 0 0 0.375rem;
	font-size: 1.0625rem;
	font-weight: 700;
	line-height: 1.3;
	color: inherit;
}

.copamex-consent__text {
	margin: 0 0 0.875rem;
}

.copamex-consent__link {
	color: var(--copamex-consent-accent);
	text-decoration: underline;
}

.copamex-consent__preview {
	margin: 0 0 0.625rem;
	padding: 0.375rem 0.5rem;
	border-radius: 0.375rem;
	background: #fcf0c3;
	font-size: 0.8125rem;
	word-break: break-word;
}

.copamex-consent__options {
	margin: 0 0 0.875rem;
	padding: 0;
	list-style: none;
}

.copamex-consent__option {
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
	padding-block: 0.375rem;
	border-block-start: 1px solid #e5e5e5;
}

.copamex-consent__option label {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-weight: 600;
}

.copamex-consent__option input {
	inline-size: 1.125rem;
	block-size: 1.125rem;
	margin: 0;
	accent-color: var(--copamex-consent-accent);
}

.copamex-consent__desc {
	padding-inline-start: 1.625rem;
	font-size: 0.8125rem;
	color: #50575e;
}

.copamex-consent__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.copamex-consent__button,
.copamex-consent-reopen {
	min-block-size: 2.75rem;
	padding: 0.5rem 1rem;
	border: 1px solid var(--copamex-consent-accent);
	border-radius: 999px;
	background: #fff;
	color: var(--copamex-consent-accent);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.copamex-consent__button--primary {
	background: var(--copamex-consent-accent);
	color: #fff;
}

.copamex-consent__button:focus-visible,
.copamex-consent-reopen:focus-visible,
.copamex-consent__option input:focus-visible,
.copamex-consent__link:focus-visible {
	outline: 3px solid #2271b1;
	outline-offset: 2px;
}

.copamex-consent-reopen {
	min-block-size: 2.5rem;
	padding: 0.375rem 0.875rem;
	font-size: 0.8125rem;
	box-shadow: 0 0.25rem 1rem rgb(0 0 0 / 0.12);
}

@media (max-width: 767.98px) {
	.copamex-consent {
		inset-inline-start: 0;
		inset-block-end: 0;
		inline-size: 100vw;
		border-radius: 0.75rem 0.75rem 0 0;
		padding-block-end: calc(1.125rem + env(safe-area-inset-bottom, 0px));
	}

	.copamex-consent__button {
		flex: 1 1 auto;
	}

	/* On phones the WhatsApp launcher spans the width: the reopen button sits just above it. */
	.copamex-consent-reopen {
		inset-block-end: calc(var(--copamex-consent-gap) + 3.25rem + 0.5rem + env(safe-area-inset-bottom, 0px));
	}
}

@media (prefers-reduced-motion: no-preference) {
	.copamex-consent__button {
		transition: background-color 0.15s ease, color 0.15s ease;
	}
}
