/* Pagina carrello (override woocommerce/cart.php) — stessa struttura
   visiva di shop/scheda prodotto (topbar, card, bottoni pillola). */

.ept-cart-page {
	max-width: 1200px;
	margin: 0 auto;
	padding: 32px 32px 80px;
}

.ept-cart-title {
	font-size: 1.75rem;
	font-weight: 800;
	color: var(--c-primary-dark);
	margin: 0 0 24px;
}

/* ─── Stato vuoto ─── */
.ept-cart-empty {
	max-width: 440px;
	margin: 60px auto;
	text-align: center;
	color: var(--c-medium-gray);
}
.ept-cart-empty svg {
	margin-bottom: 16px;
}
.ept-cart-empty h1 {
	font-size: 1.375rem;
	font-weight: 800;
	color: var(--c-primary-dark);
	margin: 0 0 8px;
}
.ept-cart-empty p {
	margin: 0 0 24px;
}
.ept-cart-empty-cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 48px;
	padding: 0 26px;
	border-radius: 999px;
	background: var(--c-primary-dark);
	color: #fff;
	font-weight: 700;
	text-decoration: none;
	transition: opacity 150ms;
}
.ept-cart-empty-cta:hover {
	opacity: 0.9;
}

/* ─── Layout a 2 colonne ─── */
.ept-cart-layout {
	display: grid;
	grid-template-columns: 1fr 340px;
	gap: 32px;
	align-items: start;
}

/* ─── Righe prodotto ─── */
.ept-cart-items {
	background: #fff;
	border: 1.5px solid var(--c-light-gray);
	border-radius: 16px;
	overflow: hidden;
}
.ept-cart-item {
	display: grid;
	grid-template-columns: 64px 1fr auto auto 32px;
	align-items: center;
	gap: 16px;
	padding: 16px 20px;
}
.ept-cart-item + .ept-cart-item {
	border-top: 1px solid var(--c-light-gray);
}
.ept-cart-item-img {
	width: 64px;
	height: 64px;
	border-radius: 10px;
	overflow: hidden;
	background: var(--c-off-white);
	display: block;
	flex-shrink: 0;
}
.ept-cart-item-img img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}
.ept-cart-item-body {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.ept-cart-item-name {
	font-size: 0.9375rem;
	font-weight: 700;
	color: var(--c-almost-black);
	text-decoration: none;
}
.ept-cart-item-name:hover {
	color: var(--c-primary);
}
.ept-cart-item-meta {
	font-size: 0.75rem;
	color: var(--c-medium-gray);
}
.ept-cart-item-price {
	font-size: 0.8125rem;
	color: var(--c-medium-gray);
}
.ept-cart-item-qty-input {
	width: 60px;
	height: 40px;
	text-align: center;
	border: 1.5px solid var(--c-light-gray);
	border-radius: 8px;
	font-size: 0.9375rem;
}
.ept-cart-item-subtotal {
	font-size: 0.9375rem;
	font-weight: 700;
	color: var(--c-primary-dark);
	white-space: nowrap;
}
.ept-cart-item-remove {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	color: var(--c-medium-gray);
	transition: background 150ms, color 150ms;
}
.ept-cart-item-remove:hover {
	background: #fdeceb;
	color: #c0392b;
}

.ept-cart-form-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	padding: 16px 20px;
}
.ept-cart-coupon {
	display: flex;
	gap: 8px;
}
.ept-cart-coupon-input {
	height: 44px;
	padding: 0 14px;
	border: 1.5px solid var(--c-light-gray);
	border-radius: 999px;
	font-size: 0.875rem;
	width: 200px;
}
/* !important: <button type="submit"> nativo (Aggiorna carrello/Applica),
   colpito dallo stile globale "Bottoni" di Elementor senza questa
   protezione — stesso bug già documentato più volte in questo progetto. */
.ept-btn-outline {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 44px;
	padding: 0 22px;
	border-radius: 999px;
	background: none !important;
	border: 1.5px solid var(--c-primary-dark) !important;
	color: var(--c-primary-dark) !important;
	font-family: var(--font-body);
	font-size: 0.875rem;
	font-weight: 700;
	cursor: pointer;
	transition: background 150ms, color 150ms;
}
.ept-btn-outline:hover {
	background: var(--c-primary-dark) !important;
	color: #fff !important;
}

/* ─── Riepilogo ─── */
.ept-cart-summary {
	background: var(--c-primary-light);
	border-radius: 16px;
	padding: 24px;
	position: sticky;
	top: 96px;
}
.ept-cart-summary h2 {
	font-size: 1.0625rem;
	font-weight: 800;
	color: var(--c-primary-dark);
	margin: 0 0 16px;
}
.ept-cart-summary-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 0.875rem;
	color: var(--c-dark-gray);
	padding: 8px 0;
	border-bottom: 1px solid rgba(19, 65, 105, 0.08);
}
.ept-cart-summary-row--coupon {
	color: var(--c-accent-dark);
}
.ept-cart-summary-row--total {
	border-bottom: none;
	padding-top: 14px;
	font-size: 1.0625rem;
	font-weight: 800;
	color: var(--c-primary-dark);
}
.ept-cart-checkout-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 52px;
	margin-top: 18px;
	border-radius: 999px;
	background: var(--c-accent);
	color: #fff;
	font-weight: 700;
	text-decoration: none;
	transition: background 150ms;
}
.ept-cart-checkout-btn:hover {
	background: var(--c-accent-dark);
}

/* ─── Messaggi dinamici offerte (sopra la tabella carrello) ─── */
.ept-cart-page .eptmo-nudge--cart {
	margin: 0 0 20px;
}

/* ─── Cross-sell ─── */
.ept-cart-crosssell {
	margin-top: 48px;
	border-radius: 20px;
}

/* Sempre 3 card affiancate da desktop (non il grid auto-fill della scheda
   prodotto, pensato per mostrarne anche 8) — richiesta esplicita
   2026-10-04. Da mobile diventa un carosello a scorrimento orizzontale
   invece di impilarle una sotto l'altra, vedi media query sotto. */
.ept-related-grid--cart {
	grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 900px) {
	.ept-cart-layout {
		grid-template-columns: 1fr;
	}
	.ept-cart-summary {
		position: static;
	}
	/* Riga prodotto mobile — PRIMA qty e subtotale erano impilati su righe
	   separate (grid-column:2 su entrambi, auto-posizionati su righe
	   diverse) ma il bottone "rimuovi" copriva solo le prime 2 righe
	   (grid-row:1/3): risultato, contenuto a 3 righe con un bottone alto
	   solo 2, tutto schiacciato (bug reale segnalato dal cliente
	   2026-10-04, screenshot). Con grid-template-areas esplicite invece,
	   qty e subtotale stanno sulla STESSA riga (fianco a fianco) — 2 righe
	   totali, che è esattamente quanto "rimuovi" deve coprire. */
	.ept-cart-item {
		display: grid;
		grid-template-columns: 56px 1fr auto 32px;
		grid-template-areas:
			"img  body body   remove"
			"img  qty  subtotal remove";
		column-gap: 16px;
		row-gap: 8px;
	}
	.ept-cart-item-img     { grid-area: img; }
	.ept-cart-item-body    { grid-area: body; }
	.ept-cart-item-qty     { grid-area: qty; }
	.ept-cart-item-subtotal { grid-area: subtotal; justify-self: end; align-self: center; }
	.ept-cart-item-remove  { grid-area: remove; align-self: start; }

	/* Tablet (640-900px): 3 colonne strette sono cramped, 2 ci stanno bene
	   finché non si passa al carosello sotto i 640px. */
	.ept-related-grid--cart {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 640px) {
	/* Carosello: ogni card prende ~78% di larghezza (si intravede la
	   successiva, invito a scorrere), scroll-snap per fermarsi allineata
	   invece che a metà. Nessun JS: scroll nativo touch del browser. */
	.ept-related-grid--cart {
		display: flex;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		gap: 14px;
		padding-bottom: 4px;
		-webkit-overflow-scrolling: touch;
	}
	.ept-related-grid--cart .ept-related-card {
		flex: 0 0 78%;
		scroll-snap-align: start;
	}
}

@media (max-width: 600px) {
	.ept-cart-page {
		padding: 20px 20px 60px;
	}
	.ept-cart-coupon-input {
		width: 140px;
	}
}
