:root {
	--ks-storefront-radius: 4px;
}

/* Keep the storefront's button treatments consistent across themes and plugins. */
body.single-product .wd-sticky-btn button.single_add_to_cart_button,
body.woocommerce-checkout button#place_order,
body :is(
	.btn,
	.button,
	.wp-element-button,
	.elementor-button,
	.wpcf7-submit,
	button:not([class]),
	button[type="submit"],
	input[type="submit"],
	input[type="reset"]
) {
	border-radius: var(--ks-storefront-radius) !important;
}

/* Keep resting cards flat and reserve shadows for floating surfaces. */
body :is(.product-grid-item .product-wrapper, .category-grid-item .wrapp-category, .blog-post-loop) {
	box-shadow: none !important;
}

body :is(.ks-shop-panel, .ks-shop-panel .ks-shop-group > ul, .wd-dropdown-menu, .wd-dropdown, .select2-dropdown) {
	box-shadow: 0 4px 12px rgba(25, 22, 19, 0.10) !important;
}

body :is(.wd-popup, .modal-window, .wd-side-hidden.wd-opened) {
	box-shadow: 0 6px 20px rgba(25, 22, 19, 0.12) !important;
}

body :is(
	input:not([type]),
	input:is([type="text"], [type="search"], [type="email"], [type="tel"], [type="url"], [type="password"], [type="number"], [type="date"]),
	select,
	textarea,
	.select2-container .select2-selection,
	.select2-dropdown,
	.product-grid-item,
	.product-grid-item :is(.product-wrapper, .product-element-top, .product-image-link, .product-image-link img, .hover-img, .hover-img img, .wd-buttons),
	.category-grid-item,
	.category-grid-item :is(.wrapp-category, .category-image-wrapp, .category-image, .category-image img),
	.product_list_widget :is(.widget-product-wrap, .widget-product-img, img),
	.single-product :is(.woocommerce-product-gallery, .woocommerce-product-gallery__image, .woocommerce-product-gallery__image img, .wd-gallery-thumb, .wd-gallery-thumb img, .wd-swatches-product .wd-swatch.wd-text),
	.promo-banner,
	.promo-banner :is(.main-wrapp-img, .banner-image),
	.blog-post-loop,
	.blog-post-loop :is(.entry-thumbnail, .post-img-wrapp, .post-img-wrapp img, .post-image-mask),
	.recent-posts-thumbnail img,
	.woodmart-archive-shop.page .wd-shop-tools,
	.ks-shop-panel,
	.ks-shop-panel .ks-shop-group > ul,
	.wd-dropdown-menu,
	.wd-dropdown,
	.wd-side-hidden,
	.wd-cookies-popup,
	.modal-window,
	.wd-popup,
	.woocommerce-MyAccount-content,
	.woocommerce-form-login,
	.woocommerce-form-register,
	.woocommerce-message,
	.woocommerce-info,
	.woocommerce-error,
	.woocommerce-checkout-review-order,
	.woocommerce-checkout-payment,
	.woocommerce-form-coupon,
	.cart-totals-inner
) {
	border-radius: var(--ks-storefront-radius) !important;
}

/* The Elementor wrappers paint the cart border and checkout backgrounds. */
body.woocommerce-cart .elementor-element-637f73d5,
body.woocommerce-checkout .e-con:has(> .wd-order-table),
body.woocommerce-checkout .wd-order-table > .elementor-widget-container,
body .woocommerce-cart-form .product-thumbnail img,
body .wd-checkout-prod-img img,
body.single-product :is(.summary-inner, .wd-product-brands > a, .single-product-sidebar) {
	border-radius: var(--ks-storefront-radius) !important;
}

/* Match the product summary shadow on the in-page recommendations panel. */
@media (min-width: 1025px) {
	body.single-product .full-height-sidebar-wrap > .single-product-sidebar {
		box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
	}
}

/* Sidebar titles must fit next to the fixed-width product thumbnails. */
body.single-product .single-product-sidebar .widget-product-info {
	min-width: 0;
}

body.single-product .single-product-sidebar .widget-product-info .wd-entities-title {
	overflow-wrap: anywhere;
	hyphens: auto;
}

/* The three quantity inputs share a single outline. */
body .quantity:has(> .minus):has(> .plus) > .minus {
	border-radius: var(--ks-storefront-radius) 0 0 var(--ks-storefront-radius) !important;
}

body .quantity:has(> .minus):has(> .plus) > .qty {
	border-radius: 0 !important;
}

body .quantity:has(> .minus):has(> .plus) > .plus {
	border-radius: 0 var(--ks-storefront-radius) var(--ks-storefront-radius) 0 !important;
}

/* Contact panels, article cards and the labels painted inside them. */
body :is(.kingsence-delivery-detailed-item, .kingsence-benefit-item,
	.blog-post-loop .article-inner, .blog-post-loop .post-date.wd-style-with-bg,
	.labels-rectangular .product-label) {
	border-radius: var(--ks-storefront-radius) !important;
}

body .kingsence-delivery-detailed-header {
	border-radius: var(--ks-storefront-radius) var(--ks-storefront-radius) 0 0 !important;
}

body .blog-post-loop .article-body-container,
body .category-grid-item.cat-design-alt .hover-mask {
	border-radius: 0 0 var(--ks-storefront-radius) var(--ks-storefront-radius) !important;
}
