/* =====================================================================
   WLRE — Cookie Consent Banner + Preferences Modal
   Italian Garante 2022 compliant: equal-weight reject/manage/accept.
   ===================================================================== */

/* --------------------------------------------------------------------- banner */

.wlre-cookie-banner {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 9000;
	background: var(--wlre-color-brand-900);
	padding-block: var(--wlre-space-24);
	box-shadow: 0 -4px 24px rgba(10, 36, 56, 0.22);
}

.wlre-cookie-banner__inner {
	display: flex;
	flex-direction: column;
	gap: var(--wlre-space-24);
	max-width: 480px;
	margin-inline: auto;
	padding-inline: var(--wlre-space-16);
}

.wlre-cookie-banner__text {
	margin: 0;
	font-family: var(--wlre-font-body);
	font-size: 14px;
	line-height: 1.48;
	color: #fff;
}

.wlre-cookie-banner__text a {
	color: var(--wlre-color-accent-500);
	text-decoration: underline;
}

.wlre-cookie-banner__text a:hover {
	color: var(--wlre-color-accent-600);
}

.wlre-cookie-banner__actions {
	display: flex;
	flex-direction: column;
	gap: var(--wlre-space-12);
	width: 100%;
}

.wlre-cookie-banner__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 48px;
	padding-inline: var(--wlre-space-24);
	border-radius: 8px;
	font-family: var(--wlre-font-body);
	font-size: 14px;
	font-weight: 700;
	line-height: 1.48;
	cursor: pointer;
	white-space: nowrap;
	transition: background-color 0.2s, color 0.2s;
}

.wlre-cookie-banner__btn--outline {
	background: transparent;
	border: 1px solid #fff;
	color: #fff;
}

.wlre-cookie-banner__btn--outline:hover {
	background: rgba(255, 255, 255, 0.1);
}

.wlre-cookie-banner__btn--filled {
	background: var(--wlre-color-accent-500);
	border: none;
	color: var(--wlre-color-brand-900);
}

.wlre-cookie-banner__btn--filled:hover {
	background: var(--wlre-color-accent-600);
}

@media (min-width: 768px) {
	.wlre-cookie-banner__inner {
		flex-direction: row;
		align-items: center;
		max-width: none;
		width: 100%;
		padding-inline: 100px;
	}

	.wlre-cookie-banner__text {
		flex: 1;
		min-width: 0;
		font-size: 16px;
	}

	.wlre-cookie-banner__actions {
		flex-direction: row;
		flex-shrink: 0;
		width: auto;
	}

	.wlre-cookie-banner__btn {
		width: auto;
		min-width: 100px;
		height: 56px;
		font-size: 16px;
	}
}

/* --------------------------------------------------------------------- modal */

/* [hidden] override — explicit display: flex would otherwise win over the
   browser's default [hidden]{display:none} when specificity is equal. */
.wlre-cookie-banner[hidden],
.wlre-cookie-modal[hidden] {
	display: none;
}

.wlre-cookie-modal {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--wlre-space-16);
}

.wlre-cookie-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(10, 36, 56, 0.6);
	backdrop-filter: blur(2px);
}

.wlre-cookie-modal__card {
	position: relative;
	background: #fff;
	border-radius: var(--wlre-radius-l, 12px);
	box-shadow: 0 8px 40px rgba(10, 36, 56, 0.18);
	width: 100%;
	max-width: 540px;
	max-height: 90dvh;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.wlre-cookie-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: var(--wlre-space-24) var(--wlre-space-24) var(--wlre-space-16);
	border-bottom: 1px solid rgba(10, 36, 56, 0.08);
	flex-shrink: 0;
}

.wlre-cookie-modal__title {
	margin: 0;
	font-family: var(--wlre-font-heading);
	font-size: var(--wlre-font-size-l);
	font-weight: 700;
	color: var(--wlre-color-brand-900);
}

.wlre-cookie-modal__close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: none;
	background: transparent;
	border-radius: var(--wlre-radius-s, 4px);
	color: var(--wlre-color-brand-900);
	cursor: pointer;
	opacity: 0.6;
	transition: opacity 0.15s, background 0.15s;
	flex-shrink: 0;
}

.wlre-cookie-modal__close:hover,
.wlre-cookie-modal__close:focus-visible {
	opacity: 1;
	background: rgba(10, 36, 56, 0.06);
}

.wlre-cookie-modal__body {
	padding: var(--wlre-space-20) var(--wlre-space-24);
	overflow-y: auto;
	flex: 1;
}

.wlre-cookie-modal__intro {
	margin: 0 0 var(--wlre-space-20);
	font-family: var(--wlre-font-body);
	font-size: var(--wlre-font-size-s);
	line-height: var(--wlre-line-height-body);
	color: rgba(10, 36, 56, 0.7);
}

.wlre-cookie-modal__intro a {
	color: var(--wlre-color-brand-900);
	text-decoration: underline;
}

.wlre-cookie-modal__category {
	padding: var(--wlre-space-16) 0;
	border-bottom: 1px solid rgba(10, 36, 56, 0.07);
}

.wlre-cookie-modal__category:last-child {
	border-bottom: none;
}

.wlre-cookie-modal__category-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--wlre-space-12);
	margin-bottom: var(--wlre-space-8);
}

.wlre-cookie-modal__category-info {
	display: flex;
	align-items: center;
	gap: var(--wlre-space-10);
}

.wlre-cookie-modal__category-name {
	font-family: var(--wlre-font-heading);
	font-size: var(--wlre-font-size-m);
	font-weight: 600;
	color: var(--wlre-color-brand-900);
}

.wlre-cookie-modal__always-on {
	font-family: var(--wlre-font-body);
	font-size: var(--wlre-font-size-xs, 11px);
	font-weight: 500;
	color: var(--wlre-color-accent-500);
	background: rgba(129, 216, 208, 0.15);
	border: 1px solid rgba(129, 216, 208, 0.4);
	border-radius: 100px;
	padding: 2px 8px;
	white-space: nowrap;
}

.wlre-cookie-modal__category-desc {
	margin: 0;
	font-family: var(--wlre-font-body);
	font-size: var(--wlre-font-size-s);
	line-height: var(--wlre-line-height-body);
	color: rgba(10, 36, 56, 0.6);
}

.wlre-cookie-modal__footer {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: var(--wlre-space-12);
	padding: var(--wlre-space-16) var(--wlre-space-24);
	border-top: 1px solid rgba(10, 36, 56, 0.08);
	flex-shrink: 0;
}

/* Self-contained modal footer buttons — no .wlre-btn inheritance so theme.json
   global button styles cannot override border-radius or padding. */
.wlre-cookie-modal__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-family: var(--wlre-font-body);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
	padding: 10px 20px;
	border-radius: 8px;
	cursor: pointer;
	text-decoration: none;
	transition: background-color 0.2s, color 0.2s, border-color 0.2s;
	white-space: nowrap;
	border: none;
}

.wlre-cookie-modal__btn--outline {
	background: transparent;
	color: var(--wlre-color-brand-900);
	border: 1.5px solid var(--wlre-color-brand-900);
}

.wlre-cookie-modal__btn--outline:hover {
	background: var(--wlre-color-surface-50);
}

.wlre-cookie-modal__btn--primary {
	background: var(--wlre-color-accent-500);
	color: var(--wlre-color-brand-900);
	border: 1.5px solid transparent;
}

.wlre-cookie-modal__btn--primary:hover {
	background: var(--wlre-color-accent-600);
}

@media (max-width: 480px) {
	.wlre-cookie-modal__footer {
		flex-direction: column;
	}

	.wlre-cookie-modal__footer .wlre-btn {
		width: 100%;
		text-align: center;
		justify-content: center;
	}
}

/* Prevent body scroll while modal is open */
body[data-wlre-cookie-modal-open] {
	overflow: hidden;
}

/* --------------------------------------------------------------------- footer manage-preferences link
   Mirrors .wlre-footer__links a exactly so it blends with other footer links. */

.wlre-footer__links .wlre-cookie-manage-link {
	display: block;
	background: none;
	border: none;
	padding: 0;
	margin: 0;
	font-family: var(--wlre-font-body);
	font-weight: 400;
	font-size: var(--wlre-font-size-m);
	line-height: var(--wlre-line-height-body);
	color: var(--wlre-color-neutral-400);
	text-decoration: none;
	cursor: pointer;
	text-align: left;
	transition: color 0.18s ease;
	width: 100%;
}

.wlre-footer__links .wlre-cookie-manage-link:hover,
.wlre-footer__links .wlre-cookie-manage-link:focus-visible {
	color: var(--wlre-color-white);
}
