/**
 * Intersections Tickets — Cart Multi Coupon
 *
 * Layout a due colonne + N accordion coupon nella colonna destra.
 * Attivo su `body.intersections-cart-tickets`.
 */

/* ───────────────────────────────────────────────────────────────────
 * CSS Custom Properties (sovrascrivibili dal tema)
 * ─────────────────────────────────────────────────────────────────── */
.intersections-cart-tickets {
	--it-cart-text:           #1a1a1a;
	--it-cart-muted:          #6b6b6b;
	--it-cart-border:         #e5e5e5;
	--it-cart-border-strong:  #1a1a1a;
	--it-cart-bg:             #ffffff;
	--it-cart-subtle-bg:      #fafafa;
	--it-cart-accent:         var(--intersections-accent, #d94389);
	--it-cart-purple:         var(--intersections-purple, #341457);
	--it-cart-discount:       #2e7d32;
}

/* ───────────────────────────────────────────────────────────────────
 * Wrapper principale
 * ─────────────────────────────────────────────────────────────────── */
.intersections-cart-tickets .wp-block-woocommerce-cart,
.intersections-cart-tickets .woocommerce-cart {
	background: transparent;
}

.it-cart-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
	gap: 3rem;
	align-items: start;
	max-width: 1200px;
	margin: 0 auto;
	padding: 1rem 0 4rem;
}

@media ( max-width: 900px ) {
	.it-cart-layout {
		grid-template-columns: 1fr;
		gap: 2rem;
	}
}

/* ───────────────────────────────────────────────────────────────────
 * Colonna sinistra: header + lista prodotti
 * ─────────────────────────────────────────────────────────────────── */
.it-cart-back {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	color: var(--it-cart-accent);
	text-decoration: none;
	font-weight: 500;
	margin-bottom: 2rem;
}
.it-cart-back:hover { text-decoration: underline; }
.it-cart-back__arrow { font-size: 1.1em; }

.it-cart-title {
	font-size: clamp( 2.2rem, 4vw, 3rem );
	font-weight: 600;
	margin: 0 0 1.5rem;
	color: var(--it-cart-text);
	font-family: 'Panel Sans', 'Space Grotesk', sans-serif;
}

.it-cart-items {
	list-style: none;
	margin: 0;
	padding: 0;
	border-top: 1px solid var(--it-cart-border);
}

.it-cart-item {
	display: grid;
	grid-template-columns: 110px minmax(0, 1fr) auto auto;
	column-gap: 1.25rem;
	row-gap: 0.5rem;
	align-items: center;
	padding: 1.25rem 0;
	border-bottom: 1px solid var(--it-cart-border);
}

.it-cart-item__thumb img {
	display: block;
	width: 100%;
	height: auto;
	max-width: 110px;
	border-radius: 4px;
	object-fit: cover;
}

.it-cart-item__info { min-width: 0; }

.it-cart-item__name {
	font-size: 1.05rem;
	font-weight: 600;
	color: var(--it-cart-text);
	margin: 0 0 0.25rem;
}
.it-cart-item__name a {
	color: inherit;
	text-decoration: none;
}
.it-cart-item__name a:hover { text-decoration: underline; }

.it-cart-item__unit-price {
	font-size: 0.9rem;
	color: var(--it-cart-muted);
	margin-bottom: 0.75rem;
}
.it-cart-item__unit-suffix { opacity: 0.7; }

.it-cart-item__qty .quantity { display: inline-flex; align-items: center; }

.it-cart-item__qty .quantity input.qty {
	width: 3rem;
	text-align: center;
	border: none;
	background: transparent;
	font-size: 0.95rem;
	padding: 0.25rem;
	-moz-appearance: textfield;
}
.it-cart-item__qty .quantity input.qty::-webkit-inner-spin-button,
.it-cart-item__qty .quantity input.qty::-webkit-outer-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.it-cart-item__qty .quantity .minus,
.it-cart-item__qty .quantity .plus {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border: 1px solid var(--it-cart-border);
	background: var(--it-cart-bg);
	border-radius: 50%;
	cursor: pointer;
	font-size: 1rem;
	line-height: 1;
	color: var(--it-cart-text);
	padding: 0;
}
.it-cart-item__qty .quantity .minus:hover,
.it-cart-item__qty .quantity .plus:hover {
	border-color: var(--it-cart-border-strong);
}

.it-cart-item__row-total {
	font-size: 1.05rem;
	font-weight: 600;
	color: var(--it-cart-text);
	text-align: right;
	white-space: nowrap;
}

.it-cart-item__actions { text-align: right; }

.it-cart-item__remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	color: var(--it-cart-muted);
	background: transparent;
	border: none;
	border-radius: 4px;
	text-decoration: none;
}
.it-cart-item__remove:hover {
	color: #c62828;
	background: rgba( 198, 40, 40, 0.05 );
}

/* Responsive cart items */
@media ( max-width: 600px ) {
	.it-cart-item {
		grid-template-columns: 80px minmax(0, 1fr) auto;
		grid-template-areas:
			"thumb info actions"
			"thumb info actions"
			"total total total";
	}
	.it-cart-item__thumb   { grid-area: thumb; }
	.it-cart-item__info    { grid-area: info; }
	.it-cart-item__actions { grid-area: actions; }
	.it-cart-item__row-total {
		grid-area: total;
		text-align: left;
		margin-top: 0.5rem;
	}
}

.it-cart-form__actions {
	margin-top: 1rem;
	display: flex;
	justify-content: flex-end;
}

.it-cart-update {
	background: transparent;
	border: 1px solid var(--it-cart-border);
	color: var(--it-cart-text);
	padding: 0.65rem 1.25rem;
	border-radius: 4px;
	cursor: pointer;
	font-size: 0.9rem;
	font-weight: 500;
	transition: border-color 0.15s;
}
.it-cart-update:hover { border-color: var(--it-cart-border-strong); }
.it-cart-update[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ───────────────────────────────────────────────────────────────────
 * Colonna destra: riepilogo ordine
 * ─────────────────────────────────────────────────────────────────── */
.it-cart-layout__side .cart-collaterals,
.it-cart-layout__side .it-cart-collaterals {
	width: 100%;
	margin: 0;
}

/* Nasconde eventuali cross-sell renderizzati dall'hook collaterals */
.it-cart-layout__side .cross-sells { display: none; }

.it-order-summary {
	background: var(--it-cart-bg);
	padding: 0;
	border-radius: 0;
}

.it-order-summary__title {
	font-size: 1.4rem;
	font-weight: 700;
	margin: 0 0 1.5rem;
	color: var(--it-cart-text);
	font-family: 'Panel Sans', 'Space Grotesk', sans-serif;
}

.it-cart-breakdown {
	list-style: none;
	margin: 0 0 1rem;
	padding: 0;
}
.it-cart-breakdown__row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	padding: 0.45rem 0;
	font-size: 0.95rem;
	color: var(--it-cart-text);
}
.it-cart-breakdown__label { font-weight: 400; }
.it-cart-breakdown__value {
	font-weight: 500;
	white-space: nowrap;
	padding-left: 1rem;
}

.it-order-summary__row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	padding: 0.75rem 0;
	font-size: 1rem;
	border-top: 1px solid var(--it-cart-border);
}
.it-order-summary__row:first-of-type { border-top: 1px solid var(--it-cart-border); }

.it-order-summary__label { color: var(--it-cart-text); }
.it-order-summary__value {
	font-weight: 600;
	white-space: nowrap;
	padding-left: 1rem;
}

.it-order-summary__row--subtotal .it-order-summary__label,
.it-order-summary__row--subtotal .it-order-summary__value {
	font-weight: 700;
}

.it-order-summary__row--discount {
	color: var(--it-cart-accent);
}
.it-order-summary__row--discount .it-order-summary__label,
.it-order-summary__row--discount .it-order-summary__value {
	color: var(--it-cart-accent);
}

.it-order-summary__row--total .it-order-summary__label,
.it-order-summary__row--total .it-order-summary__value {
	font-size: 1.15rem;
	font-weight: 700;
}

.it-order-summary__checkout {
	margin-top: 1.25rem;
}

.it-order-summary__checkout .checkout-button,
.it-order-summary__checkout a.button {
	display: block;
	width: 100%;
	text-align: center;
	background: linear-gradient( 90deg, var(--it-cart-purple) 0%, var(--it-cart-accent) 100% );
	color: #fff;
	padding: 1rem 1.5rem;
	font-size: 1.05rem;
	font-weight: 600;
	border: none;
	border-radius: 4px;
	text-decoration: none;
	cursor: pointer;
	transition: opacity 0.2s;
}
.it-order-summary__checkout .checkout-button:hover,
.it-order-summary__checkout a.button:hover {
	opacity: 0.92;
}

/* ───────────────────────────────────────────────────────────────────
 * Multi-coupon accordion slots
 * ─────────────────────────────────────────────────────────────────── */
.it-multi-coupon {
	margin: 0.25rem 0 0.25rem;
}

.it-coupon-slot {
	border-top: 1px solid var(--it-cart-border);
}
.it-coupon-slot:last-child {
	border-bottom: 1px solid var(--it-cart-border);
}

.it-coupon-slot__toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 0.9rem 0;
	background: transparent;
	border: none;
	cursor: pointer;
	text-align: left;
	font-size: 1rem;
	font-weight: 500;
	color: var(--it-cart-text);
	font-family: inherit;
}
.it-coupon-slot__toggle:hover { color: var(--it-cart-accent); }

.it-coupon-slot__label { flex: 1; }

.it-coupon-slot__chevron {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.2s ease;
	color: var(--it-cart-muted);
	margin-left: 0.5rem;
}
.it-coupon-slot.is-open .it-coupon-slot__chevron {
	transform: rotate( 180deg );
}

.it-coupon-slot__body {
	padding: 0 0 1rem;
}

.it-coupon-slot__row {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.it-coupon-slot__input {
	flex: 1;
	min-width: 0;
	padding: 0.6rem 0;
	font-size: 0.95rem;
	border: none;
	border-bottom: 1px solid var(--it-cart-border-strong);
	background: transparent;
	color: var(--it-cart-text);
	border-radius: 0;
	box-shadow: none;
	outline: none;
	letter-spacing: 0.02em;
}
.it-coupon-slot__input::placeholder {
	color: var(--it-cart-muted);
	opacity: 1;
}
.it-coupon-slot__input:focus {
	border-bottom-color: var(--it-cart-accent);
}
.it-coupon-slot__input[readonly] {
	color: var(--it-cart-text);
	font-weight: 600;
	letter-spacing: 0.05em;
}

.it-coupon-slot__btn {
	flex: 0 0 auto;
	padding: 0.55rem 1.25rem;
	font-size: 0.9rem;
	font-weight: 500;
	background: #fff;
	color: var(--it-cart-text);
	border: 1px solid var(--it-cart-border-strong);
	border-radius: 4px;
	cursor: pointer;
	transition: background-color 0.15s, color 0.15s;
	font-family: inherit;
	line-height: 1;
}
.it-coupon-slot__btn:hover {
	background: var(--it-cart-text);
	color: #fff;
}
.it-coupon-slot__btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.it-coupon-slot__btn--remove {
	background: #fff;
	color: var(--it-cart-text);
}

.it-coupon-slot.is-applied .it-coupon-slot__toggle { color: var(--it-cart-text); }

.it-coupon-slot__message {
	min-height: 1.2em;
	margin-top: 0.5rem;
	font-size: 0.85rem;
	color: #c62828;
}
.it-coupon-slot__message.is-success {
	color: var(--it-cart-discount);
}

.it-coupon-slot.is-loading .it-coupon-slot__btn {
	opacity: 0.6;
	pointer-events: none;
}
