/* Etichetta contenuto nel carrello / mini-cart (tra titolo e contatore) */
.tindal-packs-label {
	display: block;
	margin: 2px 0 4px;
	font-size: 12px;
	font-weight: 600;
	color: #4757a2;
}

/* Card di selezione multipack in pagina prodotto (fuori dal form.cart) */
.tindal-mp {
	/* Miniatura 40px, sovrapposta (passo 18px): la colonna immagini ha la larghezza della card più "piena" */
	--mp-img: 40px;
	--mp-img-step: 18px;
	--mp-imgs-col: calc(var(--mp-img) + (var(--mp-max-imgs, 1) - 1) * var(--mp-img-step));
	display: block;
	margin: 0 0 20px;
	width: 100%;
	box-sizing: border-box;
}

.tindal-mp .tindal-mp__title {
	margin: 0 0 10px;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.3;
}

.tindal-mp .tindal-mp__cards {
	display: grid;
	grid-template-columns: 1fr;
	gap: 10px;
}

/* Reset tipografico: il tema stilizza i <button> (maiuscolo, interlinea alta) */
.tindal-mp .tindal-mp__card {
	display: grid;
	grid-template-columns: var(--mp-imgs-col, 0) 1fr auto;
	grid-template-areas:
		"imgs name    price"
		"imgs content ship";
	column-gap: 12px;
	row-gap: 4px;
	align-items: center;
	width: 100%;
	height: auto;
	min-height: 0;
	margin: 0;
	padding: 12px 16px;
	box-sizing: border-box;
	border: 1.5px solid #e5e5e5;
	border-radius: 12px;
	background: #fff;
	color: #222;
	text-align: left;
	text-transform: none;
	letter-spacing: normal;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.3;
	white-space: normal;
	cursor: pointer;
	transition: border-color .15s, background-color .15s, box-shadow .15s;
}

.tindal-mp .tindal-mp__card span,
.tindal-mp .tindal-mp__card strong,
.tindal-mp .tindal-mp__card del {
	text-transform: none;
	letter-spacing: normal;
	line-height: 1.3;
}

.tindal-mp .tindal-mp__card:hover:not(:disabled) {
	border-color: #4757a2;
	background: #fafbfe;
}

.tindal-mp .tindal-mp__card.is-active {
	border-color: #4757a2;
	background: #f3f5fb;
	box-shadow: 0 0 0 1px #4757a2 inset;
}

.tindal-mp .tindal-mp__card:disabled {
	opacity: .5;
	cursor: not-allowed;
}

.tindal-mp .tindal-mp__name {
	grid-area: name;
	font-size: 16px;
	font-weight: 700;
}

.tindal-mp .tindal-mp__content {
	grid-area: content;
	font-size: 13px;
	color: #666;
}

/* Immagini prodotto, una per pack, sovrapposte */
.tindal-mp .tindal-mp__imgs {
	grid-area: imgs;
	display: flex;
	align-items: center;
	align-self: center;
	justify-self: start;
	width: calc(var(--mp-img) + (var(--mp-imgs, 1) - 1) * var(--mp-img-step));
}

.tindal-mp .tindal-mp__imgs .tindal-mp__img {
	flex: 0 0 var(--mp-img);
	width: var(--mp-img);
	height: var(--mp-img);
	max-width: none;
	margin: 0 0 0 calc(var(--mp-img-step) - var(--mp-img));
	padding: 0;
	box-sizing: border-box;
	object-fit: contain;
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 8px;
	box-shadow: 2px 0 4px rgba(0, 0, 0, .08);
}

.tindal-mp .tindal-mp__imgs .tindal-mp__img:first-child {
	margin-left: 0;
}

/* Unità e giorni su righe separate */
.tindal-mp .tindal-mp__content .tindal-mp__line {
	display: block;
}

.tindal-mp .tindal-mp__price {
	grid-area: price;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
	flex-wrap: wrap;
}

.tindal-mp .tindal-mp__price del {
	font-size: 13px;
	color: #999;
}

.tindal-mp .tindal-mp__price strong {
	font-size: 18px;
	font-weight: 700;
	color: #222;
}

.tindal-mp .tindal-mp__badge {
	padding: 2px 8px;
	border-radius: 20px;
	background: #4757a2;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
}

.tindal-mp .tindal-mp__ship {
	grid-area: ship;
	align-self: end;
	justify-self: end;
	font-size: 12px;
	color: #666;
	text-align: right;
}

.tindal-mp .tindal-mp__ship.is-free {
	color: #4757a2;
	font-weight: 600;
}

.tindal-mp .tindal-mp__soldout {
	grid-column: 1 / -1;
	font-size: 12px;
	color: #b32d2e;
}

.tindal-mp .tindal-mp__summary {
	margin: 8px 0 0;
	font-size: 13px;
	color: #4757a2;
}

.tindal-mp .tindal-mp__summary:empty {
	display: none;
}

@media (max-width: 480px) {
	.tindal-mp .tindal-mp__card {
		grid-template-columns: 1fr;
		grid-template-areas: "imgs" "name" "content" "price" "ship";
	}
	.tindal-mp .tindal-mp__imgs {
		margin-bottom: 4px;
	}
	.tindal-mp .tindal-mp__price,
	.tindal-mp .tindal-mp__ship {
		justify-content: flex-start;
		justify-self: start;
		text-align: left;
	}
}

/* ------------------------------------------------------------------------
 * Carrello / checkout a blocchi e mini-cart
 * ---------------------------------------------------------------------- */

/* Prezzo base barrato: il reset del tema (.price del, .product-price del) toglie la barratura */
del.tindal-mp-del,
.wc-block-components-product-price del.wc-block-components-product-price__regular,
.wc-block-cart-item__prices del,
.wc-block-components-order-summary-item__individual-prices del {
	text-decoration: line-through !important;
	opacity: .65;
}

/* Etichetta "Risparmia X €": con prezzo unitario non tondo mostra 1-2 centesimi di scarto.
   Al suo posto compare lo sconto % (dati articolo "Sconto", vedi inc/multipack.php). */
.wp-block-woocommerce-cart .wc-block-components-sale-badge,
.wp-block-woocommerce-checkout .wc-block-components-sale-badge,
.wc-block-cart-item__total .wc-block-components-product-badge {
	display: none !important;
}

/* Contatore quantità a blocchi: la cifra veniva tagliata in alto dagli stili input del tema */
.wc-block-components-quantity-selector input.wc-block-components-quantity-selector__input {
	box-sizing: border-box;
	height: auto !important;
	min-height: 0 !important;
	margin: 0;
	padding: 0 !important;
	align-self: center;
	line-height: 1.5 !important;
	font-size: 16px;
	text-align: center;
	overflow: visible;
}

/* Sconto % come badge, sotto il titolo nel carrello/checkout a blocchi */
.wc-block-components-product-details__sconto .wc-block-components-product-details__name {
	display: none;
}

.wc-block-components-product-details__sconto .wc-block-components-product-details__value {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 20px;
	background: #4757a2;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.4;
}


/* Prodotto raggruppato: elenco figli a tutta larghezza, "Aggiungi al carrello" e cuore sulla riga sotto.
   Il tema imposta form.cart come flex: qui si manda a capo la tabella dei figli. */
.single-product form.cart.grouped_form {
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.single-product form.cart.grouped_form .woocommerce-grouped-product-list {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    margin: 0;
}
