/* EdilCompany Catalogo & Shop — front-end */

:root {
	--ecs-brand: #2d2b63;
	--ecs-brand-d: #211f4d;
	--ecs-brand-light: #efeffa;
	--ecs-border: #e4e4ee;
	--ecs-text: #2a2a33;
	--ecs-muted: #6c6c7a;
	--ecs-radius: 12px;
	--ecs-shadow: 0 6px 24px rgba( 33, 31, 77, 0.08 );
}

.ecs-price-label {
	display: inline-block;
	font-weight: 600;
	opacity: 0.85;
}

/* --- Box "Aggiungi al preventivo" (scheda singola) --- */
.ecs-quote-box {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 0.6em;
	margin: 1.2em 0;
}
.ecs-quote-box .ecs-qty-label {
	display: block;
	width: 100%;
	font-weight: 600;
	margin-bottom: 0.2em;
}
.ecs-quote-box .ecs-qty-input {
	width: 110px;
	max-width: 40vw;
}
.ecs-add-to-quote.loading {
	opacity: 0.6;
	pointer-events: none;
}
.ecs-quote-feedback {
	flex-basis: 100%;
	font-size: 0.9em;
	color: #2e7d32;
}
.ecs-quote-feedback.is-error {
	color: #c62828;
}
.ecs-quote-feedback a {
	text-decoration: underline;
}
.ecs-add-to-quote--loop {
	display: inline-block;
}

/* =====================================================================
 * Pagina preventivo
 * ================================================================== */
.ecs-quote-page {
	color: var( --ecs-text );
	width: 100%;
	max-width: 100%;
	margin: 0;
}

/* Card */
.ecs-quote-card {
	background: #fff;
	border: 1px solid var( --ecs-border );
	border-radius: var( --ecs-radius );
	box-shadow: var( --ecs-shadow );
	padding: 0;
	margin: 0 0 1.6em;
	overflow: hidden;
}
.ecs-card-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.6em;
	padding: 1em 1.3em;
	background: var( --ecs-brand );
	color: #fff;
}
.ecs-card-title {
	margin: 0;
	font-size: 1.15rem;
	color: #fff;
	line-height: 1.2;
}
.ecs-card-badge {
	background: rgba( 255, 255, 255, 0.18 );
	border-radius: 999px;
	padding: 0.25em 0.8em;
	font-size: 0.85rem;
	font-weight: 600;
	white-space: nowrap;
}

/* Tabella prodotti */
.ecs-quote-table-wrap {
	overflow-x: auto;
}
.ecs-quote-table {
	width: 100%;
	border-collapse: collapse;
	margin: 0;
	font-size: 0.98rem;
}
.ecs-quote-table thead th {
	text-align: left;
	font-size: 0.78rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var( --ecs-muted );
	padding: 0.9em 1.3em;
	border-bottom: 1px solid var( --ecs-border );
	background: #fafafd;
}
.ecs-quote-table tbody td {
	padding: 0.85em 1.3em;
	border-bottom: 1px solid var( --ecs-border );
	vertical-align: middle;
}
.ecs-quote-table tbody tr:last-child td {
	border-bottom: 0;
}
.ecs-prod {
	display: flex;
	align-items: center;
	gap: 0.85em;
}
.ecs-prod img {
	width: 52px;
	height: 52px;
	object-fit: cover;
	border-radius: 8px;
	border: 1px solid var( --ecs-border );
	flex: 0 0 auto;
}
.ecs-prod a {
	font-weight: 600;
	color: var( --ecs-brand );
	text-decoration: none;
}
.ecs-prod a:hover {
	text-decoration: underline;
}
.ecs-col-sku {
	color: var( --ecs-muted );
}
.ecs-qty-input {
	width: 92px;
	padding: 0.5em 0.6em;
	border: 1px solid var( --ecs-border );
	border-radius: 8px;
	font-size: 1rem;
}
.ecs-qty-input:focus {
	outline: none;
	border-color: var( --ecs-brand );
	box-shadow: 0 0 0 3px rgba( 45, 43, 99, 0.12 );
}
.ecs-remove {
	background: #f6f6fa;
	border: 1px solid var( --ecs-border );
	width: 34px !important;
	height: 34px !important;
	min-width: 34px !important;
	max-width: 34px;
	padding: 0 !important;
	box-sizing: border-box;
	flex: 0 0 auto;
	aspect-ratio: 1 / 1;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 1.2em;
	line-height: 1;
	cursor: pointer;
	color: #b3261e;
	transition: background 0.15s, color 0.15s;
}
.ecs-remove:hover {
	background: #fdecea;
	color: #8c1d18;
}

/* Azioni sotto la tabella */
.ecs-quote-actions {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 1em;
	padding: 1em 1.3em;
	border-top: 1px solid var( --ecs-border );
	background: #fafafd;
}
.ecs-continue {
	color: var( --ecs-brand );
	font-weight: 600;
	text-decoration: none;
}
.ecs-continue:hover {
	text-decoration: underline;
}

/* Bottoni */
.ecs-btn {
	display: inline-block;
	border: 0;
	border-radius: 10px;
	padding: 0.7em 1.3em;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	line-height: 1.2;
	text-decoration: none;
	transition: filter 0.15s, background 0.15s, transform 0.05s;
}
.ecs-btn:active {
	transform: translateY( 1px );
}
.ecs-btn--primary {
	background: var( --ecs-brand );
	color: #fff;
}
.ecs-btn--primary:hover {
	background: var( --ecs-brand-d );
	color: #fff;
}
.ecs-btn--ghost {
	background: #fff;
	color: var( --ecs-brand );
	border: 1px solid var( --ecs-brand );
}
.ecs-btn--ghost:hover {
	background: var( --ecs-brand-light );
}

/* Form richiesta */
.ecs-request .ecs-request-sub {
	margin: 1em 1.3em 0;
	color: var( --ecs-muted );
}
.ecs-type-toggle {
	display: flex;
	gap: 0.7em;
	padding: 1.1em 1.3em 0;
	flex-wrap: wrap;
}
.ecs-pill {
	display: inline-flex;
	align-items: center;
	gap: 0.45em;
	padding: 0.65em 1.2em;
	border: 2px solid var( --ecs-border );
	border-radius: 999px;
	cursor: pointer;
	font-weight: 600;
	color: var( --ecs-muted );
	user-select: none;
	transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.ecs-pill:hover {
	border-color: #c9c9de;
}
.ecs-pill.is-active {
	border-color: var( --ecs-brand );
	color: var( --ecs-brand );
	background: var( --ecs-brand-light );
}
.ecs-pill input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}
.ecs-pill-ico {
	font-size: 1.1em;
}

.ecs-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1em 1.2em;
	padding: 1.2em 1.3em 0.4em;
}
.ecs-field {
	display: flex;
	flex-direction: column;
	margin: 0;
}
.ecs-field--full {
	grid-column: 1 / -1;
}
.ecs-field label {
	font-weight: 600;
	margin-bottom: 0.35em;
	font-size: 0.92rem;
}
.ecs-field input,
.ecs-field textarea {
	width: 100%;
	padding: 0.7em 0.8em;
	border: 1px solid var( --ecs-border );
	border-radius: 9px;
	font-size: 1rem;
	font-family: inherit;
	background: #fff;
}
.ecs-field input:focus,
.ecs-field textarea:focus {
	outline: none;
	border-color: var( --ecs-brand );
	box-shadow: 0 0 0 3px rgba( 45, 43, 99, 0.12 );
}

/* Visibilità campi in base al tipo (default: mostra privato) */
.ecs-quote-form-list.ecs-type-privato .ecs-when-azienda {
	display: none;
}
.ecs-quote-form-list.ecs-type-azienda .ecs-when-privato {
	display: none;
}

.ecs-check {
	display: flex;
	align-items: flex-start;
	gap: 0.55em;
	padding: 0.4em 1.3em 0;
	color: var( --ecs-muted );
	cursor: pointer;
}
.ecs-check input {
	margin-top: 0.2em;
}
.ecs-check a {
	color: var( --ecs-brand );
	text-decoration: underline;
}
.ecs-quote-submit {
	margin: 1.2em 1.3em 1.4em;
	font-size: 1.05rem;
	padding: 0.85em 1.8em;
}

.ecs-quote-empty {
	text-align: center;
	color: var( --ecs-muted );
	padding: 2em 0;
	font-size: 1.1rem;
}

/* Notifiche */
.ecs-notice {
	padding: 0.9em 1.1em;
	border-radius: 10px;
	margin-bottom: 1.4em;
	border: 1px solid transparent;
}
.ecs-notice--success { background: #e8f5e9; border-color: #a5d6a7; }
.ecs-notice--info    { background: #e3f2fd; border-color: #90caf9; }
.ecs-notice--error   { background: #ffebee; border-color: #ef9a9a; }
.ecs-notice ul { margin: 0; padding-left: 1.2em; }
.ecs-notice p { margin: 0; }

/* Widget fluttuante preventivo */
.ecs-float-quote {
	position: fixed;
	right: 18px;
	bottom: 18px;
	z-index: 9998;
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	background: var( --ecs-brand );
	color: #fff !important;
	padding: 0.6em 0.9em;
	border-radius: 999px;
	box-shadow: 0 4px 14px rgba( 0, 0, 0, 0.25 );
	text-decoration: none;
	font-weight: 600;
	line-height: 1;
}
.ecs-float-quote:hover { background: var( --ecs-brand-d ); }
.ecs-float-quote .ecs-float-count {
	background: #fff;
	color: var( --ecs-brand );
	border-radius: 999px;
	min-width: 1.6em;
	height: 1.6em;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 0.85em;
	padding: 0 0.4em;
}
.ecs-float-quote--empty { opacity: 0.55; }

/* Responsive */
@media ( max-width: 640px ) {
	.ecs-grid {
		grid-template-columns: 1fr;
	}
	.ecs-quote-table thead {
		display: none;
	}
	.ecs-quote-table,
	.ecs-quote-table tbody,
	.ecs-quote-table tr,
	.ecs-quote-table td {
		display: block;
		width: 100%;
	}
	.ecs-quote-table tr {
		padding: 0.6em 0;
		border-bottom: 1px solid var( --ecs-border );
	}
	.ecs-quote-table td {
		border: 0;
		padding: 0.3em 1.3em;
	}
	.ecs-quote-table td::before {
		content: attr( data-title );
		display: block;
		font-size: 0.72rem;
		text-transform: uppercase;
		letter-spacing: 0.04em;
		color: var( --ecs-muted );
		margin-bottom: 0.2em;
	}
	.ecs-quote-table td.ecs-col-x {
		text-align: right;
	}
	.ecs-quote-table td.ecs-col-x::before {
		display: none;
	}
	.ecs-float-quote .ecs-float-label { display: none; }
}
