/**
 * DPD logo next to every DPD shipping rate. Always on since 120 (no setting); developers
 * can turn it off with the `woo_dpd_show_checkout_logo` filter.
 * Loaded on the cart and checkout only.
 */

/*
 * The logo is the "dpd" wordmark alone (no red cube, owner 2026-11-06). Its viewBox is
 * 115.8 × 67.4, so 18 px high is 31 px wide. It is painted in the label's own text colour
 * through a mask, so it reads on light and dark themes alike; a browser without CSS masks
 * gets the grey (#393536) SVG as a plain background instead.
 *
 * Classic cart/checkout: the <span> CheckoutLogo::prependLogo() puts in front of the label.
 * Block cart/checkout: the Store API renders the rate title as plain text, so the logo is
 * drawn before it, keyed on the rate id WooCommerce puts in the radio input's value
 * (`wpdpd_home:3`, `wpdpd_parcelshop:1`, since 092 `wpdpd_shop:5` / `wpdpd_locker:6`).
 */
.wpdpd-rate-logo,
.wc-block-components-radio-control__input[value="wpdpd_home"] + .wc-block-components-radio-control__option-layout .wc-block-components-radio-control__label::before,
.wc-block-components-radio-control__input[value^="wpdpd_home:"] + .wc-block-components-radio-control__option-layout .wc-block-components-radio-control__label::before,
.wc-block-components-radio-control__input[value="wpdpd_parcelshop"] + .wc-block-components-radio-control__option-layout .wc-block-components-radio-control__label::before,
.wc-block-components-radio-control__input[value^="wpdpd_parcelshop:"] + .wc-block-components-radio-control__option-layout .wc-block-components-radio-control__label::before,
.wc-block-components-radio-control__input[value="wpdpd_shop"] + .wc-block-components-radio-control__option-layout .wc-block-components-radio-control__label::before,
.wc-block-components-radio-control__input[value^="wpdpd_shop:"] + .wc-block-components-radio-control__option-layout .wc-block-components-radio-control__label::before,
.wc-block-components-radio-control__input[value="wpdpd_locker"] + .wc-block-components-radio-control__option-layout .wc-block-components-radio-control__label::before,
.wc-block-components-radio-control__input[value^="wpdpd_locker:"] + .wc-block-components-radio-control__option-layout .wc-block-components-radio-control__label::before {
	content: "";
	display: inline-block;
	width: 31px;
	height: 18px;
	margin: 0 0.5em 0 0;
	vertical-align: middle;
	background: url("../img/dpd-wordmark.svg") no-repeat left center / contain;
}

@supports (mask-image: url("")) or (-webkit-mask-image: url("")) {
	.wpdpd-rate-logo,
	.wc-block-components-radio-control__input[value="wpdpd_home"] + .wc-block-components-radio-control__option-layout .wc-block-components-radio-control__label::before,
	.wc-block-components-radio-control__input[value^="wpdpd_home:"] + .wc-block-components-radio-control__option-layout .wc-block-components-radio-control__label::before,
	.wc-block-components-radio-control__input[value="wpdpd_parcelshop"] + .wc-block-components-radio-control__option-layout .wc-block-components-radio-control__label::before,
	.wc-block-components-radio-control__input[value^="wpdpd_parcelshop:"] + .wc-block-components-radio-control__option-layout .wc-block-components-radio-control__label::before,
	.wc-block-components-radio-control__input[value="wpdpd_shop"] + .wc-block-components-radio-control__option-layout .wc-block-components-radio-control__label::before,
	.wc-block-components-radio-control__input[value^="wpdpd_shop:"] + .wc-block-components-radio-control__option-layout .wc-block-components-radio-control__label::before,
	.wc-block-components-radio-control__input[value="wpdpd_locker"] + .wc-block-components-radio-control__option-layout .wc-block-components-radio-control__label::before,
	.wc-block-components-radio-control__input[value^="wpdpd_locker:"] + .wc-block-components-radio-control__option-layout .wc-block-components-radio-control__label::before {
		background: currentColor;
		-webkit-mask: url("../img/dpd-wordmark.svg") no-repeat left center / contain;
		mask: url("../img/dpd-wordmark.svg") no-repeat left center / contain;
	}
}
