/* Siderghisa — Form richiesta preventivo (step unico). Stile Woodmart/brand. */
.sg-prev-wrap {
	--sg-header: #1a3654;
	--sg-accent: #2c8fa6;
	max-width: 860px;
	margin: 0 auto;
}

.sg-prev-form {
	background: #fff;
	border: 1px solid #e3e9ee;
	border-radius: 10px;
	padding: 28px;
	box-shadow: 0 6px 22px rgba(26, 54, 84, .06);
}
@keyframes sg-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Campi ---------- */
.sg-prev-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px 20px;
	margin-bottom: 22px;
}
.sg-prev-field--full { grid-column: 1 / -1; }
.sg-prev-field--small { max-width: 160px; }
.sg-prev-field { margin: 0; }
.sg-prev-field label {
	display: block;
	font-weight: 600;
	font-size: 14px;
	color: var(--sg-header);
	margin-bottom: 6px;
}
.sg-prev-field label span { color: var(--sg-accent); }

/* Città + Provincia sulla stessa cella (Provincia non più isolata) */
.sg-prev-citaprov { display: flex; gap: 14px; margin: 0; align-items: flex-start; }
.sg-prev-citaprov > span { display: block; }
.sg-prev-citaprov .sg-prev-cp-citta { flex: 1 1 auto; min-width: 0; }
.sg-prev-citaprov .sg-prev-cp-prov { flex: 0 0 96px; }

.sg-prev-form input[type="text"],
.sg-prev-form input[type="email"],
.sg-prev-form textarea {
	width: 100%;
	box-sizing: border-box;
	max-width: 100%;
	padding: 11px 13px;
	border: 1px solid #d4dde4;
	border-radius: 7px;
	font-size: 15px;
	background: #fff;
	color: #2b2f33;
	transition: border-color .15s, box-shadow .15s;
}
.sg-prev-form input:focus,
.sg-prev-form textarea:focus {
	outline: 0;
	border-color: var(--sg-accent);
	box-shadow: 0 0 0 3px rgba(44, 143, 166, .15);
}
.sg-prev-form textarea { resize: vertical; }

/* ---------- Tipo richiesta: il cuore del form ---------- */
.sg-prev-interest {
	margin: 4px 0 22px;
	padding: 16px 16px 15px;
	background: #f4f9fb;
	border: 1px solid #d9e7ed;
	border-left: 4px solid var(--sg-accent);
	border-radius: 10px;
}
.sg-prev-interest-title {
	margin: 0 0 4px !important;
	font-size: 17px;
	font-weight: 700;
	color: var(--sg-header);
	line-height: 1.3;
}
.sg-prev-interest-title span { color: var(--sg-accent); }
.sg-prev-interest-hint {
	margin: 0 0 13px !important;
	font-size: 13.5px;
	color: #5a6b76;
	line-height: 1.4;
}

/* Pillole: reset duri per neutralizzare gli stili del tema (fix layout mobile) */
.sg-prev-pills {
	display: grid !important;
	grid-template-columns: repeat(3, 1fr);
	grid-auto-rows: auto !important;
	gap: 10px;
}
.sg-prev-wrap .sg-prev-pill {
	position: relative;
	display: block !important;
	float: none !important;
	width: auto !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
	min-height: 0 !important;
	cursor: pointer;
}
.sg-prev-wrap .sg-prev-pill input[type="radio"] {
	position: absolute !important;
	opacity: 0 !important;
	width: 0 !important;
	height: 0 !important;
	min-width: 0 !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	-webkit-appearance: none;
	appearance: none;
	pointer-events: none;
}
.sg-prev-wrap .sg-prev-pill-box {
	display: flex !important;
	align-items: flex-start;
	justify-content: flex-start !important;
	text-align: left !important;
	gap: 11px;
	width: 100% !important;
	height: 100%;
	box-sizing: border-box;
	margin: 0 !important;
	padding: 13px 14px !important;
	min-height: 0 !important;
	background: #fff;
	border: 1px solid #d4dde4;
	border-radius: 9px;
	line-height: 1.35 !important;
	transition: border-color .15s, box-shadow .15s, background .15s;
}
.sg-prev-pill-radio {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	margin-top: 1px;
	position: relative;
	border: 2px solid #c6d3db;
	border-radius: 50%;
	background: #fff;
	transition: border-color .15s, background .15s;
}
.sg-prev-pill-radio::after {
	content: "";
	position: absolute;
	left: 5px;
	top: 2px;
	width: 4px;
	height: 8px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
	opacity: 0;
}
.sg-prev-pill-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sg-prev-pill-text b { margin: 0 !important; font-size: 15px; line-height: 1.25 !important; color: var(--sg-header); }
.sg-prev-pill-text small { margin: 0 !important; font-size: 12.5px; line-height: 1.35 !important; color: #6b7780; }
.sg-prev-pill input:checked + .sg-prev-pill-box {
	border-color: var(--sg-accent);
	background: #eef8fa;
	box-shadow: inset 0 0 0 1px var(--sg-accent);
}
.sg-prev-pill input:checked + .sg-prev-pill-box .sg-prev-pill-radio {
	border-color: var(--sg-accent);
	background: var(--sg-accent);
}
.sg-prev-pill input:checked + .sg-prev-pill-box .sg-prev-pill-radio::after { opacity: 1; }
.sg-prev-pill input:focus-visible + .sg-prev-pill-box { box-shadow: 0 0 0 3px rgba(44, 143, 166, .25); }
@media (max-width: 900px) {
	.sg-prev-pills { grid-template-columns: 1fr; }
}

/* ---------- Blocchi condizionali (oggetto / categorie / prodotti) ---------- */
.sg-prev-cats-wrap,
.sg-prev-oggetto-wrap,
.sg-prev-prodotti-wrap { margin: 0 0 22px; }
.sg-prev-wrap.sg-js .sg-prev-cats-wrap,
.sg-prev-wrap.sg-js .sg-prev-oggetto-wrap,
.sg-prev-wrap.sg-js .sg-prev-prodotti-wrap { display: none; }
.sg-prev-wrap.sg-js .sg-prev-cats-wrap.is-visible,
.sg-prev-wrap.sg-js .sg-prev-oggetto-wrap.is-visible,
.sg-prev-wrap.sg-js .sg-prev-prodotti-wrap.is-visible { display: block; animation: sg-fade .2s ease; }
.sg-prev-oggetto-wrap .sg-prev-field { margin: 0; }
.sg-prev-cats-hint { margin: 0 0 12px; font-size: 13.5px; color: #6b7780; }

/* Ricerca prodotti */
.sg-prev-search { position: relative; margin-bottom: 14px; max-width: 100%; }
.sg-prev-wrap .sg-prev-search-input {
	width: 100% !important;
	max-width: 100% !important;
	box-sizing: border-box !important;
	margin: 0 !important;
	padding: 11px 13px;
	border: 1px solid #d4dde4;
	border-radius: 7px;
	font-size: 15px;
	background: #fff;
	color: #2b2f33;
	-webkit-appearance: none;
	appearance: none;
}
.sg-prev-search-input:focus { outline: 0; border-color: var(--sg-accent); box-shadow: 0 0 0 3px rgba(44, 143, 166, .15); }
.sg-prev-wrap .sg-prev-search-results {
	position: absolute;
	left: 0;
	right: 0;
	top: calc(100% + 4px);
	background: #fff;
	border: 1px solid #d4dde4;
	border-radius: 10px;
	box-shadow: 0 12px 30px rgba(26, 54, 84, .14);
	z-index: 20;
	max-height: 320px;
	overflow-y: auto;
	padding: 6px;
}
/* Override forte: i risultati sono <button>, da svincolare dallo stile del tema. */
.sg-prev-wrap .sg-prev-search-results .sg-prev-search-item {
	display: flex !important;
	align-items: center;
	justify-content: flex-start !important;
	gap: 12px;
	width: 100% !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 8px 10px !important;
	border: 0 !important;
	border-radius: 8px !important;
	background: #fff !important;
	box-shadow: none !important;
	text-align: left !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	line-height: 1.35 !important;
	color: #2b2f33 !important;
	cursor: pointer;
	overflow-wrap: anywhere;
	transition: background .12s ease;
}
/* Miniatura prodotto (o segnaposto) */
.sg-prev-search-thumb {
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	border: 1px solid #e3e9ee;
	border-radius: 7px;
	background: #f4f7f9;
	object-fit: cover;
	display: block;
}
.sg-prev-search-thumb--ph { position: relative; }
.sg-prev-search-thumb--ph::after {
	content: "";
	position: absolute;
	inset: 12px;
	border: 2px dashed #c6d3db;
	border-radius: 5px;
}
/* Nome + codice */
.sg-prev-search-text {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
	text-align: left;
}
.sg-prev-search-label { font-size: 14px; font-weight: 600; color: var(--sg-header); }
.sg-prev-search-sku { font-size: 12px; color: #8a939b; }
/* Affordance aggiungi */
.sg-prev-search-add {
	flex: 0 0 auto;
	width: 26px;
	height: 26px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: #eaf3f6;
	color: var(--sg-accent);
	font-size: 17px;
	font-weight: 700;
	line-height: 1;
	transition: background .12s ease, color .12s ease;
}
.sg-prev-wrap .sg-prev-search-results .sg-prev-search-item:hover,
.sg-prev-wrap .sg-prev-search-results .sg-prev-search-item:focus {
	background: #f0f8fa !important;
	outline: 0;
}
.sg-prev-wrap .sg-prev-search-results .sg-prev-search-item:hover .sg-prev-search-add,
.sg-prev-wrap .sg-prev-search-results .sg-prev-search-item:focus .sg-prev-search-add {
	background: var(--sg-accent);
	color: #fff;
}
.sg-prev-search-none { padding: 12px 14px; font-size: 14px; color: #9aa6b0; }

/* Lista prodotti aggiunti */
.sg-prev-prodotti-list { display: flex; flex-direction: column; gap: 8px; }
.sg-prev-prod-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border: 1px solid #e0e7ec;
	border-radius: 8px;
	background: #fcfdfe;
}
.sg-prev-prod-thumb {
	flex: 0 0 auto;
	width: 42px;
	height: 42px;
	border: 1px solid #e3e9ee;
	border-radius: 7px;
	background: #f4f7f9;
	object-fit: cover;
	display: block;
}
.sg-prev-prod-thumb--ph { position: relative; }
.sg-prev-prod-thumb--ph::after {
	content: "";
	position: absolute;
	inset: 11px;
	border: 2px dashed #c6d3db;
	border-radius: 4px;
}
.sg-prev-prod-name { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; font-size: 14px; font-weight: 600; color: var(--sg-header); }
.sg-prev-prod-qty { display: inline-flex; align-items: center; border: 1px solid #d4dde4; border-radius: 7px; overflow: hidden; }
/* Reset anti-tema: sono <button>/<input> reali, Woodmart li gonfia con min-height/padding */
.sg-prev-wrap .sg-prev-qbtn {
	width: 32px; height: 34px;
	padding: 0 !important;
	min-width: 0 !important;
	min-height: 0 !important;
	margin: 0 !important;
	box-shadow: none !important;
	text-transform: none !important;
	border: 0; border-radius: 0;
	background: #f4f7f9; color: var(--sg-header);
	font-size: 18px; line-height: 1; cursor: pointer;
}
.sg-prev-wrap .sg-prev-qbtn:hover { background: #e7eef2; }
.sg-prev-wrap .sg-prev-qin {
	width: 46px !important; height: 34px;
	padding: 0 !important;
	min-width: 0 !important;
	min-height: 0 !important;
	margin: 0 !important;
	box-sizing: border-box !important;
	text-align: center;
	border: 0; border-left: 1px solid #e3e9ee; border-right: 1px solid #e3e9ee;
	border-radius: 0;
	background: #fff;
	font-size: 14px;
	-moz-appearance: textfield;
}
.sg-prev-qin::-webkit-outer-spin-button,
.sg-prev-qin::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sg-prev-wrap .sg-prev-prod-rm {
	width: 30px; height: 30px; flex: 0 0 auto;
	padding: 0 !important;
	min-width: 0 !important;
	min-height: 0 !important;
	margin: 0 !important;
	box-shadow: none !important;
	border: 0; border-radius: 50%;
	background: #f4f7f9; color: #c0392b;
	font-size: 18px; line-height: 1; cursor: pointer;
}
.sg-prev-wrap .sg-prev-prod-rm:hover { background: #fdecea; }
.sg-prev-prodotti-empty { margin: 10px 0 0; font-size: 14px; color: #9aa6b0; }

.sg-prev-cats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sg-prev-cat-card {
	border: 1px solid #e0e7ec;
	border-radius: 10px;
	background: #fcfdfe;
	padding: 14px 15px 15px;
	transition: border-color .15s, box-shadow .15s;
}
.sg-prev-cat-card.is-selected {
	border-color: var(--sg-accent);
	box-shadow: 0 2px 12px rgba(44, 143, 166, .08);
}
.sg-prev-cat-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 11px;
}
.sg-prev-cat-name { font-weight: 700; font-size: 15px; color: var(--sg-header); }
.sg-prev-cat-count { font-size: 12px; font-weight: 600; color: var(--sg-accent); white-space: nowrap; }

.sg-prev-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sg-prev-chip { position: relative; display: inline-flex; margin: 0; }
.sg-prev-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.sg-prev-chip > span {
	display: inline-block;
	padding: 7px 13px;
	border: 1px solid #cfd9e0;
	border-radius: 999px;
	font-size: 13.5px;
	line-height: 1.2;
	color: #41484e;
	background: #fff;
	cursor: pointer;
	user-select: none;
	transition: background .12s, border-color .12s, color .12s;
}
.sg-prev-chip:hover > span { border-color: var(--sg-accent); color: var(--sg-header); }
.sg-prev-chip input:checked + span {
	background: var(--sg-accent);
	border-color: var(--sg-accent);
	color: #fff;
}
.sg-prev-chip input:checked + span::before { content: "\2713\00a0"; font-weight: 700; }
.sg-prev-chip input:focus-visible + span { box-shadow: 0 0 0 3px rgba(44, 143, 166, .25); }
/* "Tutta la categoria": tratteggiata finché non selezionata */
.sg-prev-chip--all > span { font-weight: 600; border-style: dashed; }
.sg-prev-chip--all input:checked + span { border-style: solid; }

/* ---------- Messaggio (ultimo campo) ---------- */
.sg-prev-form > .sg-prev-field--full { margin: 0 0 24px; }

/* ---------- Privacy + Turnstile ---------- */
.sg-prev-privacy { margin: 0 0 20px; font-size: 14px; }
.sg-prev-privacy label {
	display: flex;
	align-items: flex-start;
	gap: 9px;
	cursor: pointer;
	color: #41484e;
	line-height: 1.5;
}
.sg-prev-privacy input { margin-top: 3px; accent-color: var(--sg-accent); }
.sg-prev-privacy a { color: var(--sg-accent); text-decoration: underline; }
.sg-prev-req { color: var(--sg-accent); }
.sg-prev-turnstile { margin: 6px 0 20px; }

/* ---------- Submit ---------- */
.sg-prev-submit { margin: 4px 0 0; padding-top: 20px; border-top: 1px solid #eef2f5; }
.sg-prev-wrap .sg-prev-btn {
	background: var(--sg-accent);
	border: 0;
	color: #fff;
	font-weight: 700;
	font-size: 15px;
	letter-spacing: .3px;
	padding: 14px 34px;
	border-radius: 7px;
	cursor: pointer;
	transition: background .15s, transform .05s;
}
.sg-prev-wrap .sg-prev-btn:hover { background: var(--sg-header); }
.sg-prev-wrap .sg-prev-btn:active { transform: translateY(1px); }

/* ---------- Stati / messaggi ---------- */
.sg-prev-error { display: block; color: #c0392b; font-size: 12.5px; margin-top: 5px; }
.sg-prev-alert {
	background: #fdecea; border: 1px solid #f5c6c0; color: #a5342a;
	padding: 12px 16px; border-radius: 7px; margin-bottom: 18px; font-size: 14px;
}
.sg-prev-success {
	background: #eaf6f0; border: 1px solid #bfe3d2; border-left: 4px solid #2e9e6f;
	color: #1f6b4a; padding: 18px 20px; border-radius: 8px; font-size: 15px; line-height: 1.6;
}
.sg-prev-hp { position: absolute; left: -9999px; top: -9999px; height: 0; overflow: hidden; }

@media (max-width: 640px) {
	.sg-prev-grid,
	.sg-prev-cats { grid-template-columns: 1fr; }
	.sg-prev-form { padding: 18px 14px; }
	.sg-prev-interest { padding: 14px 13px 13px; }

	/* Righe prodotto: miniatura+nome sulla prima riga, quantità e rimozione sotto */
	.sg-prev-prod-row { flex-wrap: wrap; row-gap: 9px; }
	.sg-prev-prod-name { flex: 1 1 calc(100% - 56px); }
	.sg-prev-prod-rm { margin-left: auto; }
}

/* Landing quote anchors clear the sticky navigation on desktop and mobile. */
#richiedi-preventivo, #sg-preventivo { scroll-margin-top: 140px; }
.sg-landing-quote .title-wrapper { max-width: 860px; margin-inline: auto; }
.sg-landing-quote .sg-prev-wrap { width: 100%; }
