/**
 * Marketing widgets — social proof, promo popup, sticky bar.
 */

.museo-social-proof {
	position: fixed;
	left: var(--space-sm);
	bottom: var(--space-sm);
	z-index: 260;
	display: flex;
	flex-direction: column-reverse;
	gap: var(--space-xs);
	max-width: min(20rem, calc(100vw - 2rem));
	pointer-events: none;
}

body:has(.cookie-consent:not([hidden])) .museo-social-proof {
	bottom: 6.5rem;
}

.museo-social-proof__toast {
	position: relative;
	display: flex;
	align-items: center;
	gap: 0.65rem;
	pointer-events: auto;
	padding: 0.65rem 2rem 0.65rem 0.65rem;
	background: #fff;
	border: 2px solid var(--color-mint);
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-card);
	transform: translateX(-120%);
	opacity: 0;
	transition: transform 0.32s ease, opacity 0.32s ease, border-color 0.2s ease, box-shadow 0.2s ease;
	cursor: pointer;
}

.museo-social-proof__thumb {
	flex-shrink: 0;
	width: 2.75rem;
	height: 2.75rem;
	border-radius: var(--radius-sm);
	object-fit: cover;
	border: 1px solid rgba(26, 26, 46, 0.08);
	background: var(--color-surface-mint, #e6faf3);
}

.museo-social-proof__toast:hover,
.museo-social-proof__toast:focus-visible {
	border-color: var(--color-lilac-strong);
	box-shadow: 4px 4px 0 var(--color-lilac);
	outline: none;
}

.museo-social-proof__toast.is-visible {
	transform: translateX(0);
	opacity: 1;
}

.museo-social-proof__close {
	position: absolute;
	top: 0.35rem;
	right: 0.35rem;
	width: 1.75rem;
	height: 1.75rem;
	padding: 0;
	border: none;
	background: transparent;
	color: var(--color-text-muted);
	font-size: 1.25rem;
	line-height: 1;
	cursor: pointer;
	border-radius: var(--radius-sm);
}

.museo-social-proof__close:hover {
	color: var(--color-ink);
	background: rgba(26, 26, 46, 0.06);
}

.museo-social-proof__line {
	margin: 0;
	flex: 1;
	min-width: 0;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--color-text-dark);
	line-height: 1.45;
}

.museo-social-proof__line em {
	font-style: normal;
	color: var(--color-accent-text);
}

/* Homepage promo popup */
.museo-promo-popup {
	position: fixed;
	inset: 0;
	z-index: 280;
	display: grid;
	place-items: center;
	padding: var(--space-md);
}

.museo-promo-popup[hidden] {
	display: none;
}

.museo-promo-popup__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(26, 26, 46, 0.88);
}

.museo-promo-popup__panel {
	position: relative;
	width: min(26rem, 100%);
	padding: var(--space-lg) var(--space-md) var(--space-md);
	background: linear-gradient(160deg, #fff 0%, #f0e6fc 100%);
	border: 3px solid var(--color-lilac);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-card);
	text-align: center;
	animation: museo-promo-in 0.35s ease;
}

@keyframes museo-promo-in {
	from {
		opacity: 0;
		transform: translateY(12px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.museo-promo-popup__close {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	width: 2rem;
	height: 2rem;
	border: none;
	background: transparent;
	font-size: 1.5rem;
	line-height: 1;
	color: var(--color-text-muted);
	cursor: pointer;
}

.museo-promo-popup__badge {
	display: inline-block;
	margin: 0 0 var(--space-sm);
	padding: 0.35rem 0.75rem;
	font-size: 0.6875rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--color-ink);
	background: var(--color-sun);
	border-radius: var(--radius-xl);
}

.museo-promo-popup__title {
	margin: 0 0 var(--space-sm);
	font-family: var(--font-display);
	font-size: clamp(1.35rem, 4vw, 1.75rem);
	font-weight: 800;
	color: var(--color-text-dark);
	line-height: 1.2;
}

.museo-promo-popup__text {
	margin: 0 0 var(--space-md);
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--color-text-muted);
	line-height: 1.55;
}

.museo-promo-popup__actions {
	display: flex;
	flex-direction: column;
	gap: var(--space-xs);
}

.museo-promo-popup__cta {
	width: 100%;
}

html.museo-promo-open {
	overflow: hidden;
}

/* Sticky promo bar */
.museo-sticky-bar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 240;
	transform: translateY(0);
	transition: transform 0.32s ease;
}

.museo-sticky-bar--idle {
	transform: translateY(110%);
	pointer-events: none;
}

html.museo-sticky-bar-visible .museo-sticky-bar--idle {
	transform: translateY(110%);
}

html.museo-sticky-bar-visible .museo-sticky-bar:not(.museo-sticky-bar--idle) {
	transform: translateY(0);
	pointer-events: auto;
}

html.museo-sticky-bar-visible body:has(.cookie-consent:not([hidden])) .museo-sticky-bar {
	bottom: 5.5rem;
}

.museo-sticky-bar__inner {
	display: grid;
	grid-template-columns: 1fr auto auto;
	align-items: center;
	gap: var(--space-sm);
	width: 100%;
	max-width: none;
	padding: var(--space-xs) var(--space-md);
	background: linear-gradient(90deg, rgba(255, 107, 74, 0.95), rgba(176, 126, 245, 0.92));
	border-top: 2px solid rgba(255, 255, 255, 0.35);
	box-shadow: 0 -8px 24px rgba(26, 26, 46, 0.15);
}

.museo-sticky-bar__text {
	margin: 0;
	padding-left: 0;
	font-family: var(--font-display);
	font-size: 0.875rem;
	font-weight: 700;
	color: #fff;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.museo-sticky-bar__cta {
	white-space: nowrap;
	background: #fff !important;
	color: var(--color-text-dark) !important;
	border-color: #fff !important;
}

.museo-sticky-bar__close {
	width: 2rem;
	height: 2rem;
	margin-right: var(--space-xs);
	border: none;
	background: rgba(255, 255, 255, 0.2);
	color: #fff;
	font-size: 1.25rem;
	line-height: 1;
	border-radius: var(--radius-sm);
	cursor: pointer;
}

@media (max-width: 640px) {
	.museo-sticky-bar__inner {
		grid-template-columns: 1fr auto;
		grid-template-areas:
			'text close'
			'cta cta';
	}

	.museo-sticky-bar__text {
		grid-area: text;
		font-size: 0.8125rem;
	}

	.museo-sticky-bar__close {
		grid-area: close;
		justify-self: end;
	}

	.museo-sticky-bar__cta {
		grid-area: cta;
		width: 100%;
		text-align: center;
	}
}

/* WhatsApp floating — a sinistra del widget GTranslate */
.museo-whatsapp {
	position: fixed;
	right: calc(1rem + 5.5rem + 0.75rem);
	bottom: calc(1rem + env(safe-area-inset-bottom, 0));
	z-index: 245;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 3.25rem;
	height: 3.25rem;
	color: #fff;
	background: #25d366;
	border-radius: 50%;
	box-shadow: 0 8px 24px rgba(37, 211, 102, 0.45);
	transition: transform 0.2s ease;
}

.museo-whatsapp:hover {
	transform: scale(1.06);
	color: #fff;
}

body:has(.cookie-consent:not([hidden])) .museo-whatsapp {
	bottom: calc(6.5rem + env(safe-area-inset-bottom, 0));
}

html.museo-sticky-bar-visible .museo-whatsapp {
	bottom: calc(5.5rem + env(safe-area-inset-bottom, 0));
}

body:has(.cookie-consent:not([hidden])):has(.museo-sticky-bar:not(.museo-sticky-bar--idle)) .museo-whatsapp {
	bottom: calc(11rem + env(safe-area-inset-bottom, 0));
}

@media (max-width: 767px) {
	.museo-whatsapp {
		left: 1rem;
		right: auto;
		bottom: calc(5.5rem + env(safe-area-inset-bottom, 0));
	}

	body:has(.cookie-consent:not([hidden])) .museo-whatsapp {
		bottom: calc(10rem + env(safe-area-inset-bottom, 0));
	}

	body:has(.cookie-consent:not([hidden])):has(.museo-sticky-bar:not(.museo-sticky-bar--idle)) .museo-whatsapp {
		bottom: calc(15.5rem + env(safe-area-inset-bottom, 0));
	}
}

@media (min-width: 768px) {
	.museo-whatsapp {
		width: 3.5rem;
		height: 3.5rem;
	}
}
