/**
 * Isolamento layout Divi (colonne, flex, overflow) + prefisso .ape-cfg-wrap--divi.
 * Wrapper .apedoc-configurator: ancoraggio specificità vs. tema/Divi (anche Visual Builder).
 * Gli stili del wizard restano sotto .ape-cfg (BEM); qui si evitano conflitti con il tema.
 */

.ape-cfg-wrap.apedoc-configurator {
	display: block;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	position: relative;
	isolation: isolate;
	box-sizing: border-box;
	overflow-x: clip;
}

.ape-cfg-wrap.apedoc-configurator .ape-cfg.ape-cfg--root {
	max-width: 100%;
	min-width: 0;
	height: auto;
	min-height: 0;
}

/* Moduli Divi in flex row: evita che la colonna “tiri” l’altezza del configuratore come stretch */
.et_pb_module .ape-cfg-wrap.apedoc-configurator,
.et_pb_column .ape-cfg-wrap.apedoc-configurator,
.et_pb_row .et_pb_column .ape-cfg-wrap.apedoc-configurator {
	align-self: flex-start;
	max-width: 100%;
}

.ape-cfg-wrap.apedoc-configurator .ape-cfg__summary-sticky {
	min-width: 0;
}

/* Colonne Divi / flex: evita che la sidebar schiacci la card */
.ape-cfg-wrap.apedoc-configurator .ape-cfg__shell {
	min-width: 0;
}

.ape-cfg-wrap.apedoc-configurator .ape-cfg__card-wrap,
.ape-cfg-wrap.apedoc-configurator .ape-cfg__summary-aside {
	min-width: 0;
}

.ape-cfg-wrap.apedoc-configurator .ape-cfg__nav-rail-scroll,
.ape-cfg-wrap.apedoc-configurator .ape-cfg__nav-block--macro1 .ape-cfg__nav-sub {
	min-width: 0;
}

.ape-cfg-wrap.apedoc-configurator .ape-cfg__quote-banner,
.ape-cfg-wrap.apedoc-configurator .ape-cfg__quote-banner__actions {
	min-width: 0;
}

/* Riduce bleed di font-size / weight del builder */
.ape-cfg-wrap.apedoc-configurator .ape-cfg.ape-cfg--root {
	font-synthesis: none;
}

/* Evita che i reset globali Divi / tema alterino i controlli del configuratore */
.ape-cfg-wrap.apedoc-configurator .ape-cfg button.ape-cfg__btn,
.ape-cfg-wrap.apedoc-configurator .ape-cfg .ape-cfg__nav-link {
	-webkit-appearance: none;
	appearance: none;
	text-transform: none;
	letter-spacing: inherit;
	box-sizing: border-box;
}

/* Progress orizzontale su viewport stretti dentro colonna stretta */
@media (max-width: 767px) {
	.ape-cfg-wrap.apedoc-configurator .ape-cfg__progress {
		margin-left: -4px;
		margin-right: -4px;
		padding-left: 4px;
		padding-right: 4px;
	}
}

/* Blocco privacy da impostazioni (contenuto ricco) — allineato palette APEDOC */
.ape-cfg-wrap.apedoc-configurator .ape-cfg .ape-cfg__privacy-rich {
	margin-bottom: 1.25rem;
	padding: 1rem 1.1rem;
	font-size: 0.9375rem;
	line-height: 1.55;
	color: var(--ape-cfg-muted, rgba(42, 42, 42, 0.72));
	background: var(--apedoc-cream, #f8f7f3);
	border: 1px solid var(--apedoc-shadow, rgba(0, 0, 0, 0.05));
	border-radius: var(--ape-cfg-radius-sm, 10px);
}

.ape-cfg-wrap.apedoc-configurator .ape-cfg__privacy-rich a {
	color: var(--apedoc-bronze, #8b7958);
	text-decoration: underline;
}

.ape-cfg-wrap.apedoc-configurator .ape-cfg__privacy-rich p:last-child {
	margin-bottom: 0;
}

/* -------------------------------------------------------------------------
   Divi Visual Builder / iframe: stessi token e colori del frontend pubblico.
   Il builder applica spesso regole ad alta specificità su a, button, .et_pb_* :
   qui si rinforza il blocco .ape-cfg--root e i componenti principali.
   ------------------------------------------------------------------------- */
body.et-fb .ape-cfg-wrap.apedoc-configurator .ape-cfg.ape-cfg--root,
body.et_pb_theme_builder .ape-cfg-wrap.apedoc-configurator .ape-cfg.ape-cfg--root,
#et-fb-app-frame .ape-cfg-wrap.apedoc-configurator .ape-cfg.ape-cfg--root,
.et-db #et-fb-app-frame .ape-cfg-wrap.apedoc-configurator .ape-cfg.ape-cfg--root {
	--apedoc-gold: #baa24c;
	--apedoc-dark: #151515;
	--apedoc-bronze: #8b7958;
	--apedoc-shadow: rgba(0, 0, 0, 0.05);
	--apedoc-gold-hover: #c9b25d;
	--apedoc-gold-pressed: #a08e42;
	--apedoc-ink: #2a2a2a;
	--apedoc-cream: #f8f7f3;
	--apedoc-cream-deep: #f3efe6;
	--apedoc-line: rgba(139, 121, 88, 0.22);
	--apedoc-line-strong: rgba(21, 21, 21, 0.08);
	--ape-cfg-radius: 16px;
	--ape-cfg-radius-sm: 10px;
	--ape-cfg-border: 1px solid var(--apedoc-shadow);
	--ape-cfg-bg-page: var(--apedoc-cream);
	--ape-cfg-surface: #ffffff;
	--ape-cfg-text: var(--apedoc-ink);
	--ape-cfg-muted: rgba(21, 21, 21, 0.55);
	--ape-cfg-accent: var(--apedoc-gold);
	--ape-cfg-accent-soft: rgba(186, 162, 76, 0.14);
	--ape-cfg-accent-hover: var(--apedoc-gold-pressed);
	--ape-cfg-focus: 0 0 0 2px #ffffff, 0 0 0 3px rgba(186, 162, 76, 0.45);
	--ape-cfg-shadow: 0 1px 2px var(--apedoc-shadow), 0 10px 36px rgba(0, 0, 0, 0.06);
	--ape-cfg-shadow-sm: 0 1px 2px var(--apedoc-shadow);
	--ape-cfg-shadow-card-hover: 0 6px 24px rgba(0, 0, 0, 0.07);
	--ape-cfg-btn-primary-bg: var(--apedoc-dark);
	--ape-cfg-btn-primary-hover: #2a2a2a;
	--ape-cfg-btn-primary-fg: #ffffff;
	color: var(--ape-cfg-text);
	background: var(--ape-cfg-bg-page);
	border-color: var(--apedoc-shadow);
}

body.et-fb .ape-cfg-wrap.apedoc-configurator .ape-cfg.ape-cfg--root a,
#et-fb-app-frame .ape-cfg-wrap.apedoc-configurator .ape-cfg.ape-cfg--root a {
	color: inherit;
}

body.et-fb .ape-cfg-wrap.apedoc-configurator .ape-cfg .ape-cfg__choice-card,
#et-fb-app-frame .ape-cfg-wrap.apedoc-configurator .ape-cfg .ape-cfg__choice-card {
	color: var(--ape-cfg-text);
	background: var(--ape-cfg-surface);
	border: var(--ape-cfg-border);
}

body.et-fb .ape-cfg-wrap.apedoc-configurator .ape-cfg button.ape-cfg__btn--primary,
#et-fb-app-frame .ape-cfg-wrap.apedoc-configurator .ape-cfg button.ape-cfg__btn--primary {
	background: var(--ape-cfg-btn-primary-bg);
	color: var(--ape-cfg-btn-primary-fg);
	border-color: transparent;
}

body.et-fb .ape-cfg-wrap.apedoc-configurator .ape-cfg .ape-cfg__progress-dot,
#et-fb-app-frame .ape-cfg-wrap.apedoc-configurator .ape-cfg .ape-cfg__progress-dot {
	color: inherit;
}

body.et-fb .ape-cfg-wrap.apedoc-configurator .ape-cfg .ape-cfg__summary-card,
#et-fb-app-frame .ape-cfg-wrap.apedoc-configurator .ape-cfg .ape-cfg__summary-card {
	background: var(--ape-cfg-surface);
	color: var(--ape-cfg-text);
}
