/* =========================================================
   Fleksy PWA – popup, banner di installazione, campanella, toast
   Il colore principale è la variabile --fleksy-pwa-color
   (impostata dal "Colore tema" nelle impostazioni).
   ========================================================= */

.fleksy-pwa-prompt,
.fleksy-pwa-prompt *,
.fleksy-pwa-bell,
.fleksy-pwa-toast {
	box-sizing: border-box;
}

/* ---------- Contenitore popup / banner ---------- */
.fleksy-pwa-prompt {
	--fleksy-pwa-color: #2563eb;
	position: fixed;
	z-index: 2147483000;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-size: 15px;
	line-height: 1.45;
	color: #111827;
	opacity: 0;
	transition: opacity .2s ease;
}
.fleksy-pwa-prompt.is-visible {
	opacity: 1;
}
.fleksy-pwa-prompt__box {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	align-items: flex-start;
	padding: 20px;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
	transform: translateY(12px);
	transition: transform .25s ease;
}
.fleksy-pwa-prompt.is-visible .fleksy-pwa-prompt__box {
	transform: none;
}
.fleksy-pwa-prompt__icon {
	width: 56px;
	height: 56px;
	flex: 0 0 56px;
	border-radius: 14px;
	object-fit: cover;
}
.fleksy-pwa-prompt__body {
	flex: 1 1 200px;
	min-width: 0;
	padding-right: 18px;
}
.fleksy-pwa-prompt__title {
	display: block;
	margin: 0 0 4px;
	font-size: 17px;
}
.fleksy-pwa-prompt__text {
	margin: 0;
	color: #4b5563;
	white-space: pre-line;
}
.fleksy-pwa-prompt__actions {
	display: flex;
	gap: 8px;
	justify-content: flex-end;
	width: 100%;
}

/* ---------- Pulsanti (protetti dagli stili "button" del tema/Elementor) ---------- */
.fleksy-pwa-prompt .fleksy-pwa-prompt__btn {
	appearance: none;
	margin: 0;
	padding: 10px 20px;
	border: 0;
	border-radius: 999px;
	background: var(--fleksy-pwa-color);
	color: #fff;
	font: inherit;
	font-weight: 600;
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
}
.fleksy-pwa-prompt .fleksy-pwa-prompt__btn--ghost {
	background: transparent;
	color: #374151;
}
.fleksy-pwa-prompt .fleksy-pwa-prompt__close {
	position: absolute;
	top: 8px;
	right: 10px;
	appearance: none;
	margin: 0;
	padding: 4px;
	border: 0;
	background: none;
	color: #6b7280;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}
.fleksy-pwa-prompt__btn:focus-visible,
.fleksy-pwa-prompt__close:focus-visible,
.fleksy-pwa-bell:focus-visible {
	outline: 3px solid var(--fleksy-pwa-color);
	outline-offset: 2px;
}

/* ---------- Popup centrale (richiesta notifiche) ---------- */
.fleksy-pwa-prompt--popup {
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(17, 24, 39, .45);
}
.fleksy-pwa-prompt--popup .fleksy-pwa-prompt__box {
	flex-direction: column;
	align-items: center;
	width: 100%;
	max-width: 400px;
	text-align: center;
}
.fleksy-pwa-prompt--popup .fleksy-pwa-prompt__body {
	flex-basis: auto;
	padding-right: 0;
}
.fleksy-pwa-prompt--popup .fleksy-pwa-prompt__text {
	text-align: left;
}
.fleksy-pwa-prompt--popup .fleksy-pwa-prompt__icon {
	width: 72px;
	height: 72px;
	border-radius: 18px;
}
.fleksy-pwa-prompt--popup .fleksy-pwa-prompt__actions {
	justify-content: center;
}

/* ---------- Banner di installazione minimal (in basso) ---------- */
.fleksy-pwa-prompt--banner {
	left: 12px;
	right: 12px;
	bottom: max(12px, env(safe-area-inset-bottom));
	max-width: 480px;
	margin: 0 auto;
	font-size: 14px;
}
.fleksy-pwa-prompt--banner .fleksy-pwa-prompt__box {
	flex-wrap: nowrap;
	align-items: center;
	gap: 10px;
	padding: 10px 10px 10px 12px;
	border-radius: 14px;
	box-shadow: 0 8px 28px rgba(0, 0, 0, .18);
}
.fleksy-pwa-prompt--banner .fleksy-pwa-prompt__icon {
	width: 40px;
	height: 40px;
	flex: 0 0 40px;
	border-radius: 10px;
}
.fleksy-pwa-prompt--banner .fleksy-pwa-prompt__body {
	flex: 1 1 auto;
	padding: 0;
}
.fleksy-pwa-prompt--banner .fleksy-pwa-prompt__title {
	margin: 0;
	font-size: 14px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.fleksy-pwa-prompt--banner .fleksy-pwa-prompt__text {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: 13px;
	line-height: 1.35;
	white-space: normal;
}
.fleksy-pwa-prompt--banner .fleksy-pwa-prompt__actions {
	flex: 0 0 auto;
	width: auto;
}
.fleksy-pwa-prompt--banner .fleksy-pwa-prompt__btn {
	padding: 8px 14px;
	font-size: 13px;
}
.fleksy-pwa-prompt--banner .fleksy-pwa-prompt__close {
	position: static;
	order: 10;
	padding: 4px 6px;
	font-size: 20px;
}

/* ---------- Campanella (fissa o shortcode [fleksy_pwa_push]) ---------- */
.fleksy-pwa-bell.fleksy-pwa-bell {
	--fleksy-pwa-color: #2563eb;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 48px !important;
	height: 48px !important;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: var(--fleksy-pwa-color) !important;
	color: #fff !important;
	font: 600 14px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	text-transform: none;
	letter-spacing: normal;
	vertical-align: middle;
	cursor: pointer;
	transition: transform .2s ease, bottom .2s ease, opacity .2s ease;
}
.fleksy-pwa-bell.fleksy-pwa-bell svg {
	display: block;
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	fill: currentColor;
}
.fleksy-pwa-bell.fleksy-pwa-bell:hover {
	transform: scale(1.06);
}
.fleksy-pwa-bell.fleksy-pwa-bell--fixed {
	position: fixed;
	z-index: 2147482999;
	box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
}
.fleksy-pwa-bell--right     { right: 20px; bottom: 20px; }
.fleksy-pwa-bell--left      { left: 20px;  bottom: 20px; }
.fleksy-pwa-bell--top-right { right: 20px; top: 20px; }
.fleksy-pwa-bell--top-left  { left: 20px;  top: 20px; }
.admin-bar .fleksy-pwa-bell--top-right,
.admin-bar .fleksy-pwa-bell--top-left {
	top: 52px;
}
.fleksy-pwa-bell.fleksy-pwa-bell--inline {
	position: relative;
}
.fleksy-pwa-bell.fleksy-pwa-bell--inline.has-text {
	width: auto !important;
	padding: 0 16px 0 12px !important;
	border-radius: 999px !important;
}
.fleksy-pwa-bell.is-subscribed {
	opacity: .75;
}
.fleksy-pwa-bell.is-denied {
	filter: grayscale(1);
	opacity: .6;
}
.fleksy-pwa-bell[hidden] {
	display: none !important;
}
.fleksy-pwa-modal-open .fleksy-pwa-bell--right,
.fleksy-pwa-modal-open .fleksy-pwa-bell--left {
	bottom: 96px;
}

/* ---------- Messaggio temporaneo (toast) ---------- */
.fleksy-pwa-toast {
	position: fixed;
	left: 50%;
	bottom: 24px;
	z-index: 2147483001;
	max-width: calc(100% - 32px);
	padding: 12px 18px;
	border-radius: 12px;
	background: #111827;
	color: #fff;
	font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
	opacity: 0;
	transform: translate(-50%, 20px);
	transition: opacity .25s ease, transform .25s ease;
}
.fleksy-pwa-toast.is-visible {
	opacity: 1;
	transform: translate(-50%, 0);
}

/* ---------- Tema scuro ---------- */
@media (prefers-color-scheme: dark) {
	.fleksy-pwa-prompt { color: #f9fafb; }
	.fleksy-pwa-prompt__box { background: #1f2937; }
	.fleksy-pwa-prompt__text { color: #d1d5db; }
	.fleksy-pwa-prompt .fleksy-pwa-prompt__btn--ghost,
	.fleksy-pwa-prompt .fleksy-pwa-prompt__close { color: #e5e7eb; }
}

/* ---------- Movimento ridotto ---------- */
@media (prefers-reduced-motion: reduce) {
	.fleksy-pwa-prompt,
	.fleksy-pwa-prompt__box,
	.fleksy-pwa-bell,
	.fleksy-pwa-toast { transition: none; }
}
