/* DrukDuivels icons everywhere: the core and WooCommerce blocks print their own SVGs and offer no icon slot, so each of
   those <svg> elements is painted with the matching file of the "DrukDuivels icons" collection (assets/icons/wp, the same
   files the Icon block offers). The SVG keeps its size and its accessible markup; its own paths are hidden and the
   collection drawing is a mask filled with currentColor. Loaded on the front end and in the editor.
   Line icons by default; the -fill versions only for active or selected states. Social logos stay core brand marks. */

:is(
	.wp-block-search__button svg,
	.wp-block-woocommerce-customer-account svg,
	.wc-block-product-gallery-dialog__close-button svg,
	.stars-wrapper .stars button svg,
	svg.wc-block-mini-cart__icon,
	.wp-block-navigation__responsive-container-open svg,
	.wp-block-navigation__responsive-container-close svg,
	.wp-block-navigation-overlay-close svg,
	.wp-block-navigation__submenu-icon svg,
	.wc-block-components-drawer__close svg,
	.wc-block-cart-item__remove-link svg,
	.wc-block-product-filters__open-overlay svg,
	.wc-block-product-filters__close-overlay svg,
	.wc-block-product-filter-removable-chips__remove svg,
	svg.wc-block-components-panel__button-icon,
	svg.wc-blocks-components-select__expand,
	svg.wc-block-components-chip__remove-icon,
	.wc-block-components-chip__remove svg,
	.wc-block-components-notice-banner__dismiss svg,
	.wc-block-components-checkout-return-to-cart-button svg,
	.wc-block-components-validation-error svg
) {
	background: currentColor;
	-webkit-mask: var(--dd-icon) center / contain no-repeat;
	mask: var(--dd-icon) center / contain no-repeat;
}
:is(
	.wp-block-search__button svg,
	.wp-block-woocommerce-customer-account svg,
	.wc-block-product-gallery-dialog__close-button svg,
	.stars-wrapper .stars button svg,
	svg.wc-block-mini-cart__icon,
	.wp-block-navigation__responsive-container-open svg,
	.wp-block-navigation__responsive-container-close svg,
	.wp-block-navigation-overlay-close svg,
	.wp-block-navigation__submenu-icon svg,
	.wc-block-components-drawer__close svg,
	.wc-block-cart-item__remove-link svg,
	.wc-block-product-filters__open-overlay svg,
	.wc-block-product-filters__close-overlay svg,
	.wc-block-product-filter-removable-chips__remove svg,
	svg.wc-block-components-panel__button-icon,
	svg.wc-blocks-components-select__expand,
	svg.wc-block-components-chip__remove-icon,
	.wc-block-components-chip__remove svg,
	.wc-block-components-notice-banner__dismiss svg,
	.wc-block-components-checkout-return-to-cart-button svg,
	.wc-block-components-validation-error svg
) > * { display: none; }

/* the drawing for each control */
.wp-block-search__button svg { --dd-icon: url(../icons/wp/magnifying-glass.svg); }
.wp-block-woocommerce-customer-account svg { --dd-icon: url(../icons/wp/user.svg); }
/* review form rating: line star, filled up to the hovered or chosen one */
.stars-wrapper .stars button svg { --dd-icon: url(../icons/wp/star.svg); }
.stars-wrapper .stars button:is(.is-hovered, .is-selected) svg { --dd-icon: url(../icons/wp/star-fill.svg); }
svg.wc-block-mini-cart__icon { --dd-icon: url(../icons/wp/basket.svg); }
.wp-block-navigation__responsive-container-open svg { --dd-icon: url(../icons/wp/list.svg); }
.wp-block-navigation__submenu-icon svg,
svg.wc-block-components-panel__button-icon,
svg.wc-blocks-components-select__expand { --dd-icon: url(../icons/wp/caret-down.svg); }
:is(
	.wp-block-navigation__responsive-container-close svg,
	.wp-block-navigation-overlay-close svg,
	.wc-block-components-drawer__close svg,
	.wc-block-product-gallery-dialog__close-button svg,
	.wc-block-product-filters__close-overlay svg,
	.wc-block-product-filter-removable-chips__remove svg,
	svg.wc-block-components-chip__remove-icon,
	.wc-block-components-chip__remove svg,
	.wc-block-components-notice-banner__dismiss svg
) { --dd-icon: url(../icons/wp/x.svg); }
.wc-block-cart-item__remove-link svg { --dd-icon: url(../icons/wp/trash.svg); }
.wc-block-product-filters__open-overlay svg { --dd-icon: url(../icons/wp/sliders-horizontal.svg); }
.wc-block-components-checkout-return-to-cart-button svg { --dd-icon: url(../icons/wp/arrow-left.svg); }
.wc-block-components-validation-error svg { --dd-icon: url(../icons/wp/warning.svg); }

/* one drawing for both panel states: the open panel turns the caret */
svg.wc-block-components-panel__button-icon { transition: transform var(--wp--custom--transition--fast); }
.wc-block-components-panel__button[aria-expanded="true"] svg.wc-block-components-panel__button-icon { transform: rotate(180deg); }
