/* Prezzo per Unità - Plugin. Stessi toni del banner Consegna e reso (lista divisa).
   Colori personalizzabili sovrascrivendo le variabili nel CSS del tema. */
.pcm-calc {
	/* Stessi colori delle schede "Consegne e resi" (variabili --pdr-*), con valori di riserva. */
	--pcm-card: var(--pdr-card-bg, #f6f5f2);
	--pcm-line: var(--pdr-line, #e6e4dd);
	--pcm-muted: var(--pdr-muted, #77766f);
	--pcm-strong: var(--pdr-n-fg, #3f3e3a);
	--pcm-ok-fg: var(--pdr-ok-fg, #2b6a1c);
	--pcm-field: #ffffff;
	--pcm-border: #d6d4cc;
	box-sizing: border-box;
	width: 100%;
	margin: 0 0 16px;
	padding: 4px 14px;
	border-radius: 10px;
	background: var(--pcm-card);
	color: var(--pcm-strong);
	font-size: 14px;
	line-height: 1.45;
	clear: both;
}
.pcm-calc[hidden] { display: none !important; }
.pcm-calc *, .pcm-calc *::before, .pcm-calc *::after { box-sizing: border-box; }

/* Righe */
.pcm-calc .pcm-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--pcm-line); }
.pcm-calc .pcm-row:first-child { border-top: 0; }
.pcm-l { display: flex; flex-direction: column; min-width: 0; }
.pcm-calc .pcm-k { margin: 0; color: var(--pcm-strong); font-size: 14px; font-weight: 400; line-height: 1.4; }
.pcm-calc .pcm-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin-top: 1px; color: var(--pcm-muted); font-size: 12.5px; line-height: 1.4; }
.pcm-explain:empty { display: none; }

/* Campo metri */
.pcm-input { display: inline-flex; align-items: stretch; flex: 0 0 auto; height: 32px; border: 1px solid var(--pcm-border); border-radius: 6px; background: var(--pcm-field); overflow: hidden; }
.pcm-input:focus-within { border-color: var(--pcm-strong); }
.pcm-calc .pcm-need {
	width: 72px;
	min-width: 0;
	height: 100%;
	margin: 0;
	padding: 0 8px;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: var(--pcm-strong);
	font-size: 16px; /* evita lo zoom automatico su iPhone */
	text-align: right;
	outline: none;
}
.pcm-suffix { display: flex; align-items: center; padding: 0 8px; border-left: 1px solid var(--pcm-line); color: var(--pcm-muted); font-size: 13px; }

/* Sfrido: riga piccola sotto l'etichetta */
.pcm-calc .pcm-check { display: inline-flex; align-items: center; gap: 5px; margin: 0; cursor: pointer; color: var(--pcm-muted); font-size: 12.5px; font-weight: 400; }
.pcm-calc .pcm-check input { width: 14px !important; height: 14px !important; margin: 0 !important; padding: 0 !important; flex: 0 0 auto; position: static !important; accent-color: var(--pcm-strong); }

/* Punto interrogativo, come nei banner consegna */
.pcm-help { position: relative; display: inline-flex; }
.pcm-calc .pcm-q {
	-webkit-appearance: none;
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 1px solid #c9c7bf;
	border-radius: 50%;
	background: transparent;
	color: var(--pcm-muted);
	font-size: 10px;
	font-weight: 600;
	line-height: 1;
	cursor: help;
}
.pcm-tip {
	position: absolute;
	left: -120px;
	top: calc(100% + 8px);
	z-index: 20;
	width: 260px;
	max-width: 80vw;
	padding: 10px 12px;
	border: 1px solid var(--pcm-line);
	border-radius: 8px;
	background: #ffffff;
	color: var(--pcm-strong);
	font-size: 13px;
	line-height: 1.45;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .08);
	visibility: hidden;
	opacity: 0;
	transition: opacity .12s;
}
.pcm-help:hover .pcm-tip, .pcm-help:focus-within .pcm-tip, .pcm-help.is-open .pcm-tip { visibility: visible; opacity: 1; }

/* Risultato */
.pcm-selected { flex: 0 0 auto; color: var(--pcm-strong); font-size: 15px; font-weight: 700; line-height: 1.3; white-space: nowrap; }
.pcm-stock { margin: -4px 0 8px; color: #b32d2e; font-size: 12.5px; }
.pcm-stock[hidden] { display: none; }
.pcm-total { color: var(--pcm-strong); font-size: 16px; font-weight: 700; white-space: nowrap; }

/* Sconto per quantità (stile delle note dei banner consegna) */
.pcm-calc .pcm-bulk { display: flex; align-items: flex-start; gap: 7px; margin: 0; padding: 9px 0; border-top: 1px solid var(--pcm-line); color: var(--pcm-muted); font-size: 13px; line-height: 1.45; }
.pcm-calc .pcm-bulk[hidden] { display: none; }
.pcm-bulk-ico { flex: 0 0 auto; margin-top: 2px; color: var(--pcm-muted); }
.pcm-calc .pcm-bulk-link { display: inline-block; color: var(--pcm-strong) !important; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }

/* Stepper scatole */
.pcm-stepper { display: inline-flex; align-items: stretch; flex: 0 0 auto; height: 32px; border: 1px solid var(--pcm-border); border-radius: 6px; overflow: hidden; background: var(--pcm-field); }
.pcm-calc .pcm-stepper button {
	-webkit-appearance: none;
	appearance: none;
	width: 30px;
	min-width: 0;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: var(--pcm-strong);
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
}
.pcm-calc .pcm-stepper button:disabled { opacity: .35; cursor: default; }
.pcm-calc .pcm-boxes {
	-moz-appearance: textfield;
	width: 40px;
	height: 100%;
	margin: 0;
	padding: 0 2px;
	border: 0;
	border-left: 1px solid var(--pcm-line);
	border-right: 1px solid var(--pcm-line);
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: var(--pcm-strong);
	text-align: center;
	font-size: 15px;
	font-weight: 600;
}
.pcm-calc .pcm-boxes::-webkit-outer-spin-button,
.pcm-calc .pcm-boxes::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Pulsante "Aggiungi al carrello" a tutta larghezza e arrotondato */
form.cart.pcm-active { display: block !important; margin-top: 0 !important; padding-top: 0 !important; }
form.cart.pcm-active .single_add_to_cart_button {
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 100% !important;
	float: none !important;
	margin: 0 !important;
	border-radius: 999px !important;
}
form.cart.pcm-active .woocommerce-variation-add-to-cart { display: block !important; }

/* La quantità di WooCommerce la gestisce il calcolatore */
form.cart.pcm-active .quantity { display: none !important; }

/* Prezzo al m² */
/* "/m²" subito dopo il prezzo, stesso carattere e dimensione */
.pcm-price { white-space: nowrap; }
.pcm-price .pcm-per, .pcm-price .pcm-from { font-size: inherit !important; font-weight: inherit !important; color: inherit !important; font-family: inherit !important; margin: 0 !important; vertical-align: baseline !important; }
.pcm-price .pcm-from { margin-right: .25em !important; }
.pcm-price del + .pcm-per, .pcm-price ins + .pcm-per { text-decoration: none; }
/* Carrello e checkout: righe sotto il nome, tutte della stessa dimensione */
.pcm-item-meta { display: block !important; margin-top: 4px; }
.pcm-item-meta .pcm-item-line { display: block !important; margin: 0 !important; color: #77766f !important; font-size: 13px !important; font-weight: 400 !important; line-height: 1.5 !important; text-transform: none !important; }
.pcm-cart-box { display: block; margin-top: 2px; color: #77766f; font-size: 13px; font-weight: 400; white-space: nowrap; }
.pcm-qty-unit { margin-left: 4px; color: #77766f; font-size: .9em; }

/* Calcolatore del vecchio plugin nascosto (se fosse ancora attivo) */
.pcm-hide-mpc #price_calculator,
.pcm-hide-mpc .wc-measurement-price-calculator-price-table,
.pcm-hide-mpc .wc-measurement-price-calculator-input-help { display: none !important; }
