/**
 * SaporiNostri Core — WhatsApp Floating Widget
 */

:root {
	--sn-wa-bg: #2db742;
	--sn-wa-color: #ffffff;
	--sn-wa-shadow: 0 12px 28px rgba(18, 24, 40, .14);
	--sn-wa-z: 9999;
	--sn-wa-offset: 16px;
	--sn-wa-popup-w: 300px;
}

/* Container */
.sn-wa-widget {
	position: fixed;
	bottom: var(--sn-wa-offset);
	z-index: var(--sn-wa-z);
	display: flex;
	flex-direction: column;
	gap: 10px;
	max-width: min(calc(100vw - 2 * var(--sn-wa-offset)), 300px);
}
.sn-wa-widget.sn-wa-left  { left:  var(--sn-wa-offset); align-items: flex-start; }
.sn-wa-widget.sn-wa-right { right: var(--sn-wa-offset); align-items: flex-end; }

/* Trigger */
.sn-wa-trigger {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	padding: 0;
	box-sizing: border-box;
	border: none;
	border-radius: 50%;
	background: var(--sn-wa-bg);
	color: var(--sn-wa-color);
	font-size: .9375rem;
	font-weight: 700;
	cursor: pointer;
	box-shadow: 0 10px 22px rgba(18, 24, 40, .12);
	transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.sn-wa-trigger:hover,
.sn-wa-trigger:focus-visible {
	transform: translateY(-2px);
	filter: brightness(1.02);
	box-shadow: 0 14px 28px rgba(18, 24, 40, .16);
	outline: none;
}
.sn-wa-widget.is-open .sn-wa-trigger { box-shadow: 0 10px 22px rgba(18, 24, 40, .12); }


.sn-wa-trigger__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: transparent;
	flex-shrink: 0;
}

/* Popup */
.sn-wa-popup {
	display: none;
	flex-direction: column;
	width: var(--sn-wa-popup-w);
	max-width: calc(100vw - 2 * var(--sn-wa-offset));
	border-radius: 18px;
	background: #fff;
	box-shadow: 0 16px 34px rgba(18, 24, 40, .14);
	border: 1px solid rgba(12, 18, 28, .08);
	overflow: hidden;
	order: -1;
}
.sn-wa-widget.is-open .sn-wa-popup { display: flex; }

/* Popup header */
.sn-wa-popup__header {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 12px 14px;
	background: var(--sn-wa-bg);
	color: var(--sn-wa-color);
}
.sn-wa-popup__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: rgba(255,255,255,.16);
	box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
	flex-shrink: 0;
}
.sn-wa-popup__name { font-weight: 800; font-size: .92rem; letter-spacing: -.01em; }
.sn-wa-popup__desc { font-size: .8rem; opacity: .88; margin-top: 1px; line-height: 1.35; }
.sn-wa-popup__close {
	margin-left: auto;
	background: none;
	border: none;
	color: var(--sn-wa-color);
	font-size: 1rem;
	cursor: pointer;
	padding: 2px;
	opacity: .8;
	transition: opacity .15s;
	flex-shrink: 0;
}
.sn-wa-popup__close:hover { opacity: 1; }

/* Popup body */
.sn-wa-popup__body {
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.sn-wa-popup__response {
	margin: 0;
	font-size: .9rem;
	line-height: 1.45;
	color: #344054;
}

/* GDPR */
.sn-wa-gdpr {
	font-size: .82rem;
	color: #475467;
	background: #f8fafc;
	border: 1px solid #e4e7ec;
	border-radius: 12px;
	padding: 10px 12px;
}
.sn-wa-gdpr label { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.sn-wa-gdpr input[type="checkbox"] { margin-top: 2px; flex-shrink: 0; }
.sn-wa-gdpr a { color: inherit; text-decoration: underline; }

/* CTA */
.sn-wa-popup__cta {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 11px 14px;
	border-radius: 12px;
	background: var(--sn-wa-bg);
	color: var(--sn-wa-color) !important;
	font-weight: 700;
	font-size: .88rem;
	text-decoration: none !important;
	transition: transform .15s ease, filter .15s ease, opacity .2s;
	box-shadow: 0 8px 18px rgba(45,183,66,.20);
}
.sn-wa-popup__cta:hover:not(.is-disabled) { opacity: .95; transform: translateY(-1px); filter: brightness(1.02); }
.sn-wa-popup__cta.is-disabled { opacity: .45; pointer-events: none; cursor: not-allowed; }

/* Mobile */
@media (max-width: 480px) {
	:root { --sn-wa-popup-w: calc(100vw - 20px); --sn-wa-offset: 10px; }
	.sn-wa-widget { max-width: calc(100vw - 20px); }
	.sn-wa-trigger { width: 48px; height: 48px; }
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (prefers-reduced-motion: reduce) {
	.sn-wa-trigger { animation: none; }
}
