/**
 * WC Attendee Info - attendee rows in the cart, checkout and mini cart.
 *
 * Each attendee is a dt/dd pair in WooCommerce's <dl class="variation">.
 * Rows are matched through the .wc-attendee-info-cart-value wrapper in the
 * dd, so other item data (e.g. variation attributes) keeps its usual style.
 *
 * The .woocommerce td.product-name selectors outrank WooCommerce's
 * "float: left" rule for the cart and checkout tables.
 */

/*
 * Menu Cart widget: Elementor lays the dl out as a "max-content auto" grid, so a
 * row spanning both columns would size them to its unwrapped text and overflow.
 * A shrinkable second column lets the attendee details wrap; label/value rows
 * for other item data keep their two-column look.
 */
dl.variation:has(.wc-attendee-info-cart-value) {
	grid-template-columns: max-content minmax(0, 1fr);
}

dl.variation dd:has(.wc-attendee-info-cart-value) {
	min-width: 0;
	overflow-wrap: anywhere;
}

/* "Udeleženec N:" - bold, on its own line, across the whole width (mini cart is a 2-column grid). */
dl.variation dt:has(+ dd .wc-attendee-info-cart-value),
.woocommerce td.product-name dl.variation dt:has(+ dd .wc-attendee-info-cart-value) {
	float: none;
	clear: both;
	display: block;
	grid-column: 1 / -1;
	margin: 0;
	font-weight: 700;
}

/* Space between attendees. */
dl.variation dd + dt:has(+ dd .wc-attendee-info-cart-value),
.woocommerce td.product-name dl.variation dd + dt:has(+ dd .wc-attendee-info-cart-value) {
	margin-top: 0.5em;
}

/* Details on the line below the label. */
dl.variation dd:has(.wc-attendee-info-cart-value),
.woocommerce td.product-name dl.variation dd:has(.wc-attendee-info-cart-value) {
	display: block;
	grid-column: 1 / -1;
	margin: 0;
	padding: 0;
}

dl.variation dd:has(.wc-attendee-info-cart-value) p {
	margin: 0;
}
