/* ADVANXE DESIGNER — frontend cliente — CSS v2.9.0 */

.advd-open-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	margin: 0 0 16px;
	padding: 14px 18px;
	font-size: 1.02em;
	font-weight: 700;
	color: #fff;
	background: #ffa332;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	transition: background 0.15s ease;
}

.advd-open-btn:hover,
.advd-open-btn:focus {
	background: #ff2e0b;
}

.advd-fe {
	display: none;
}

.advd-fe.advd-fe-open {
	display: block;
}

body.advd-fe-modal-open {
	overflow: hidden;
}

.advd-fe-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(20, 20, 20, 0.65);
	z-index: 99998;
}

.advd-fe-panel {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: min(1000px, calc(100vw - 24px));
	max-height: calc(100vh - 24px);
	max-height: calc(100dvh - 24px);
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
	z-index: 99999;
	overflow: hidden;
}

.advd-fe-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 18px;
	border-bottom: 1px solid #eee;
}

.advd-fe-title {
	font-size: 1.1em;
	font-weight: 700;
}

.advd-fe-close {
	background: none;
	border: none;
	font-size: 26px;
	line-height: 1;
	color: #666;
	cursor: pointer;
	padding: 2px 8px;
}

.advd-fe-body {
	display: flex;
	gap: 20px;
	padding: 18px;
	overflow: auto;
	flex: 1 1 auto;
	-webkit-overflow-scrolling: touch;
}

.advd-fe-preview-col {
	flex: 1 1 55%;
	min-width: 0;
}

.advd-fe-fields-col {
	flex: 1 1 45%;
	min-width: 0;
}

.advd-fe-preview-col {
	flex: 1 1 55%;
	min-width: 0;
}

.advd-fe .advd-fe-stage {
	position: relative;
	width: 100%;
	line-height: 0;
	border-radius: 6px;
	background: #f4f4f4;
	text-align: center;
}

.advd-fe .advd-fe-mockup {
	display: inline-block !important;
	margin: 0 auto !important;
	vertical-align: top;
}

.advd-fe-area {
	position: absolute;
	overflow: hidden;
	pointer-events: none;
}

.advd-fe-area-plain {
	background: #fff;
	box-shadow: 0 1px 8px rgba(0, 0, 0, 0.15);
}

.advd-fe-layer {
	position: absolute;
}

.advd-fe-hint {
	margin: 10px 0 0;
	font-size: 0.85em;
	color: #666;
	line-height: 1.45;
}

/* Campi */
.advd-fe-field {
	margin: 0 0 16px;
	padding: 14px;
	border: 1px solid #e6e6e6;
	border-radius: 8px;
	background: #fff;
	position: relative;
}

.advd-fe-field-error {
	border-color: #d63638;
	box-shadow: 0 0 0 2px rgba(214, 54, 56, 0.2);
}

.advd-fe-field > label {
	display: block;
	font-weight: 700;
	margin: 0 0 8px;
}

.advd-fe-req {
	color: #d63638;
}

.advd-fe-text {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #ccc;
	border-radius: 6px;
	font-size: 1em;
	box-sizing: border-box;
}

.advd-fe-text:focus {
	border-color: #ffa332;
	outline: none;
	box-shadow: 0 0 0 2px rgba(255, 163, 50, 0.2);
}

.advd-fe-count {
	display: block;
	text-align: right;
	font-size: 0.78em;
	color: #999;
	margin-top: 3px;
}

.advd-fe-opts {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	align-items: center;
	margin-top: 10px;
}

.advd-fe-opt {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 0.9em;
	color: #555;
}

.advd-fe-font {
	padding: 6px 10px;
	border: 1px solid #ccc;
	border-radius: 6px;
	font-size: 1.05em;
	max-width: 220px;
}

.advd-fe-color {
	width: 42px;
	height: 32px;
	padding: 0;
	border: 1px solid #ccc;
	border-radius: 6px;
	cursor: pointer;
	background: none;
}

/* Upload */
.advd-fe-upload-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 11px 18px;
	background: #ffa332;
	color: #fff;
	font-weight: 700;
	border-radius: 6px;
	cursor: pointer;
	transition: background 0.15s ease;
}

.advd-fe-upload-btn:hover {
	background: #ff2e0b;
}

.advd-fe-upload-btn input[type="file"] {
	display: none;
}

.advd-fe-upload-status {
	display: block;
	margin-top: 8px;
	font-size: 0.88em;
	color: #555;
	min-height: 1.2em;
}

.advd-fe-status-error {
	color: #d63638;
	font-weight: 600;
}

.advd-fe-status-ok {
	color: #1e8a3c;
}

.advd-fe-foot {
	padding: 14px 18px;
	border-top: 1px solid #eee;
	background: #fafafa;
}

.advd-fe-confirm {
	width: 100%;
	background: #ffa332 !important;
	color: #fff !important;
	border: none !important;
	padding: 13px 22px !important;
	font-weight: 700 !important;
	border-radius: 6px !important;
	cursor: pointer;
}

.advd-fe-confirm:hover {
	background: #ff2e0b !important;
}

@media (max-width: 782px) {

	.advd-fe-panel {
		top: 0;
		left: 0;
		transform: none;
		width: 100vw;
		height: 100vh;
		height: 100dvh;
		max-height: none;
		border-radius: 0;
	}

	/* Impilato: l'anteprima grande in alto, i campi scorrono sotto. La
	   colonna anteprima resta ferma mentre solo i campi scorrono. */
	.advd-fe-body {
		flex-direction: column;
		gap: 0;
		padding: 0;
		overflow: hidden; /* lo scroll lo gestisce la colonna campi */
	}

	.advd-fe-preview-col {
		flex: 0 0 auto;
		position: sticky;
		top: 0;
		z-index: 2;
		background: #fff;
		padding: 12px 12px 10px;
		border-bottom: 1px solid #eee;
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
	}

	.advd-fe .advd-fe-stage {
		width: 100% !important;
		margin: 0 auto;
		background: #f4f4f4;
		text-align: center;
	}

	.advd-fe-hint {
		text-align: center;
		margin-top: 6px;
	}

	.advd-fe-fields-col {
		flex: 1 1 auto;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		padding: 14px 12px 20px;
	}

	.advd-fe-slider-nav {
		display: flex;
	}
}

/* Barra di navigazione a slide (nascosta su desktop) */
.advd-fe-slider-nav {
	display: none;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 14px;
}

.advd-fe-nav-prev,
.advd-fe-nav-next {
	width: 44px;
	height: 44px;
	border: 1px solid #ddd;
	background: #fff;
	border-radius: 50%;
	font-size: 24px;
	line-height: 1;
	color: #333;
	cursor: pointer;
	flex: 0 0 auto;
}

.advd-fe-nav-prev:disabled,
.advd-fe-nav-next:disabled {
	opacity: 0.35;
	cursor: default;
}

.advd-fe-nav-count {
	font-weight: 700;
	color: #555;
	font-size: 0.95em;
}

.advd-fe-nav-next-btn {
	width: 100%;
	background: #ffa332;
	color: #fff;
	border: none;
	padding: 13px 22px;
	font-weight: 700;
	border-radius: 6px;
	cursor: pointer;
	margin-bottom: 10px;
}

.advd-fe-nav-next-btn:hover {
	background: #ff2e0b;
}

/* Evidenziazione del pezzo che il cliente sta modificando */
.advd-fe-layer-hi {
	outline: 2px dashed #ffa332;
	outline-offset: 2px;
	border-radius: 2px;
}
