/*
 * Bundle-Seiten (Modul BundleKeyboardSelector): kompakte Liste "Enthalten:" und Keyboard-Auswahl.
 * Abstaende wie der Block "Add to Cart + Options" auf normalen Produktseiten (gemessen an Wonderful Christmas
 * vol. 4): Gruppe mit 16px Rand oben und unten, 8px zwischen Label und Inhalt, 0.5em zwischen den Pills.
 */

.ka-bundle-items,
.ka-bundle-keyboard {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.5rem;
	margin: 1rem 0;
}

.ka-bundle-keyboard[hidden] {
	display: none;
}

.ka-bundle-keyboard .wc-block-product-filter-chips {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5em;
}

/*
 * Liste: je Item kleines Thumbnail und Titel. Praefix form.cart.bundle_form .ka-bundle-items .ka-bundle-items__list,
 * damit die Regeln die von Product Bundles schlagen (blocktheme.css bis 0,5,2, .small_width bis 0,6,2).
 */

.ka-bundle-items__list {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	width: 100%;
}

form.cart.bundle_form .ka-bundle-items .ka-bundle-items__list div.bundled_product_summary {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin: 0;
	padding: 0;
	border: 0;
}

/* Clearfix von Product Bundles waere sonst ein leeres Flex-Element. */
form.cart.bundle_form .ka-bundle-items .ka-bundle-items__list div.bundled_product_summary::before,
form.cart.bundle_form .ka-bundle-items .ka-bundle-items__list div.bundled_product_summary::after {
	content: none;
}

/* flex-basis statt width: .small_width (Product Bundles, schmale Formulare) setzt width 100% und max-width 50%. */
form.cart.bundle_form .ka-bundle-items .ka-bundle-items__list div.bundled_product_summary div.bundled_product_images {
	flex: 0 0 48px;
	margin: 0;
}

form.cart.bundle_form .ka-bundle-items .ka-bundle-items__list div.bundled_product_summary div.bundled_product_images img {
	margin: 0;
}

form.cart.bundle_form .ka-bundle-items .ka-bundle-items__list div.bundled_product_summary div.details {
	flex: 1 1 0;
	min-width: 0;
	padding: 0;
}

form.cart.bundle_form .ka-bundle-items .ka-bundle-items__list .bundled_product_excerpt {
	display: none;
}

/* Titel als Link zur Einzelseite: der Permalink von Product Bundles deckt den ganzen Titel ab, ohne Symbol. */
form.cart.bundle_form .ka-bundle-items .ka-bundle-items__list div.bundled_product_summary h4.bundled_product_title {
	position: relative;
	margin: 0;
	font-size: inherit;
}

form.cart.bundle_form .ka-bundle-items .ka-bundle-items__list .bundled_product_title .bundled_product_title_link {
	margin: 0;
}

form.cart.bundle_form .ka-bundle-items .ka-bundle-items__list .bundled_product_title a.bundled_product_permalink {
	position: static;
	display: inline;
	width: auto;
	height: auto;
	min-width: 0;
	min-height: 0;
}

form.cart.bundle_form .ka-bundle-items .ka-bundle-items__list .bundled_product_title a.bundled_product_permalink::before {
	content: none;
}

form.cart.bundle_form .ka-bundle-items .ka-bundle-items__list .bundled_product_title a.bundled_product_permalink::after {
	content: "";
	position: absolute;
	inset: 0;
}

form.cart.bundle_form .ka-bundle-items .ka-bundle-items__list .bundled_product_title:has(a.bundled_product_permalink):hover .bundled_product_title_inner {
	text-decoration: underline;
}

form.cart.bundle_form .ka-bundle-items .ka-bundle-items__list .bundled_product_title:has(a.bundled_product_permalink:focus-visible) {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

form.cart.bundle_form .ka-bundle-items .ka-bundle-items__list .bundled_product_title a.bundled_product_permalink:focus-visible {
	outline: none;
}

/* Keyboard-Zeilen und "Zuruecksetzen" der Items, erst wenn das Skript die gemeinsame Auswahl aktiviert hat. */
.ka-bundle-keyboard-active .bundled_item_cart_content tr.attribute_options:has(select[data-attribute_name="attribute_pa_keyboard"]),
.ka-bundle-keyboard-active .bundled_item_cart_content .reset_variations {
	display: none;
}

/*
 * Variationsdetails der Items (sonst rueckt die Liste beim Waehlen um 8px) und die Sammelmeldung "Bitte waehle
 * Produktoptionen" von Product Bundles, ebenfalls nur mit Skript. !important, weil WooCommerce und Product Bundles
 * beide per jQuery mit display im style-Attribut einblenden.
 */
.ka-bundle-keyboard-active .ka-bundle-items__list .single_variation,
.ka-bundle-keyboard-active .bundle_error {
	display: none !important;
}
