/** DPM cart and checkout usability layer. */

body.woocommerce-cart,
body.woocommerce-checkout {
	--dpm-commerce-accent: #ff7a1a;
	--dpm-commerce-accent-hover: #e85f00;
	--dpm-commerce-border: #e2ddd7;
	--dpm-commerce-error: #b42318;
	--dpm-commerce-focus: #155eef;
	background: #faf8f3;
}

body.woocommerce-cart :where(a, button, input, select, textarea):focus-visible,
body.woocommerce-checkout :where(a, button, input, select, textarea):focus-visible {
	outline: 3px solid color-mix(in srgb, var(--dpm-commerce-focus) 42%, transparent);
	outline-offset: 2px;
}

body.woocommerce-cart .woocommerce-error,
body.woocommerce-checkout .woocommerce-error,
body.woocommerce-checkout .wc-block-components-validation-error {
	border-color: var(--dpm-commerce-error);
	color: var(--dpm-commerce-error);
}

body.woocommerce-checkout :where(input, select, textarea),
body.woocommerce-cart :where(input, select, textarea) {
	min-height: 46px;
	border-color: var(--dpm-commerce-border);
	border-radius: 8px;
	background: #fff;
}

body.woocommerce-checkout :where(input, select, textarea):focus,
body.woocommerce-cart :where(input, select, textarea):focus {
	border-color: var(--dpm-commerce-focus);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--dpm-commerce-focus) 14%, transparent);
}

body.woocommerce-checkout .woocommerce-checkout-payment,
body.woocommerce-checkout .wc-block-checkout__payment-method,
body.woocommerce-checkout .wc-block-components-checkout-step {
	border-color: var(--dpm-commerce-border);
	border-radius: 10px;
	background: #fff;
}

body.woocommerce-checkout #place_order,
body.woocommerce-checkout .wc-block-components-checkout-place-order-button,
body.woocommerce-cart .checkout-button,
body.woocommerce-cart .wc-block-cart__submit-button {
	min-height: 52px;
	border: 0;
	border-radius: 8px;
	background: var(--dpm-commerce-accent);
	color: #fff;
	font-weight: 800;
}

body.woocommerce-checkout #place_order:hover,
body.woocommerce-checkout .wc-block-components-checkout-place-order-button:hover,
body.woocommerce-cart .checkout-button:hover,
body.woocommerce-cart .wc-block-cart__submit-button:hover {
	background: var(--dpm-commerce-accent-hover);
	color: #fff;
}

body.woocommerce-checkout #place_order.is-dpm-processing {
	opacity: 0.72;
	pointer-events: none;
	cursor: wait;
}

body.woocommerce-checkout .payment_methods label,
body.woocommerce-checkout .wc-block-components-radio-control__label {
	cursor: pointer;
	font-weight: 700;
}

body.woocommerce-checkout .required {
	color: var(--dpm-commerce-error);
}

body.dpm-bd-express-checkout .woocommerce-billing-fields > h3 {
	margin-bottom: 1rem;
	padding-bottom: 0.65rem;
	border-bottom: 2px solid var(--dpm-commerce-accent);
}

body.dpm-bd-express-checkout form.checkout {
	max-width: 760px;
	margin-inline: auto;
}

body.dpm-bd-express-checkout form.checkout #order_review_heading {
	margin-top: 1.25rem;
}

body.dpm-bd-express-checkout .dpm-order-product-link {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	color: #15263d;
	font-weight: 750;
	text-decoration: none;
}

body.dpm-bd-express-checkout .dpm-order-product-link img {
	width: 52px;
	height: 52px;
	border-radius: 7px;
	object-fit: contain;
}

.dpm-checkout-quantity {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
}

.dpm-checkout-quantity button,
.dpm-checkout-quantity input {
	width: 34px;
	min-height: 34px !important;
	padding: 0;
	text-align: center;
}

.dpm-checkout-quantity :where(button:not(.dpm-checkout-remove), input) {
	border: 1px solid #cbd5e1;
	border-radius: 4px !important;
	background: #fff;
	color: #17211f;
}

.dpm-checkout-quantity .dpm-checkout-remove {
	margin-left: 0.35rem;
	border-color: transparent;
	background: transparent;
	color: #d92d20;
	font-size: 1.25rem;
	font-weight: 800;
	line-height: 1;
}

.dpm-checkout-quantity .dpm-checkout-remove:hover,
.dpm-checkout-quantity .dpm-checkout-remove:focus-visible {
	border-color: transparent;
	background: transparent;
	color: #b42318;
}

body.woocommerce-checkout .order-total {
	font-size: 1.08rem;
	font-weight: 850;
}

body.dpm-bd-express-checkout .dpm-order-product-link:hover,
body.dpm-bd-express-checkout .dpm-order-product-link:focus-visible {
	color: var(--dpm-commerce-accent-hover);
	text-decoration: underline;
}

body.dpm-bd-express-checkout .woocommerce-form-coupon-toggle {
	max-width: 760px;
	margin: 0 auto 0.65rem;
}

body.dpm-bd-express-checkout form.checkout_coupon {
	max-width: 760px;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 0.6rem;
	margin: 0 auto 1rem;
}

body.dpm-bd-express-checkout form.checkout_coupon,
body.dpm-bd-express-checkout .woocommerce-form-coupon-toggle {
	display: none !important;
}

body.dpm-bd-express-checkout form.checkout_coupon .form-row {
	float: none;
	width: auto;
	margin: 0;
}

body.dpm-bd-express-checkout form.checkout_coupon[hidden],
body.dpm-bd-express-checkout .woocommerce-form-coupon-toggle[hidden],
body.dpm-bd-express-checkout #customer_details .col-2[hidden] {
	display: none !important;
}

/* Keep the full checkout visually consistent with the compact popup checkout. */
body.dpm-bd-express-checkout form.woocommerce-checkout {
	grid-template-columns: minmax(0, 1fr) minmax(350px, 0.95fr);
	gap: 0.7rem;
	width: 100%;
	max-width: 1080px;
	margin: 0.65rem auto 1rem;
}

body.dpm-bd-express-checkout form.woocommerce-checkout #customer_details,
body.dpm-bd-express-checkout form.woocommerce-checkout #order_review {
	border: 1px solid #eadfd5;
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 10px 28px rgba(18, 42, 75, 0.06);
}

body.dpm-bd-express-checkout form.woocommerce-checkout #customer_details {
	padding: 0.75rem;
}

body.dpm-bd-express-checkout form.woocommerce-checkout #customer_details .col-1,
body.dpm-bd-express-checkout form.woocommerce-checkout #customer_details .col-2 {
	width: 100%;
}

body.dpm-bd-express-checkout form.woocommerce-checkout #customer_details .col-2[hidden] {
	padding: 0;
	border: 0;
	margin: 0;
}

body.dpm-bd-express-checkout form.woocommerce-checkout #customer_details h3,
body.dpm-bd-express-checkout form.woocommerce-checkout #order_review_heading {
	margin: 0 0 0.75rem;
	padding: 0 0 0.55rem;
	border-bottom: 2px solid var(--dpm-commerce-accent);
	font-size: 1.05rem;
	line-height: 1.35;
}

body.dpm-bd-express-checkout form.woocommerce-checkout #order_review_heading {
	top: 0.75rem;
	right: 0.75rem;
	width: calc((100% - 0.7rem) * 0.487 - 1.5rem);
	z-index: 2;
}

body.dpm-bd-express-checkout form.woocommerce-checkout #order_review {
	padding: 3.25rem 0.65rem 0.65rem;
}

body.dpm-bd-express-checkout form.woocommerce-checkout .form-row {
	margin-bottom: 0.5rem;
}

body.dpm-bd-express-checkout form.woocommerce-checkout :where(input, select, textarea) {
	min-height: 40px;
	padding-block: 0.55rem;
}

body.dpm-bd-express-checkout form.woocommerce-checkout #order_review table.shop_table thead,
body.dpm-bd-express-checkout form.woocommerce-checkout #order_review tr.cart-subtotal {
	display: none;
}

body.dpm-bd-express-checkout form.woocommerce-checkout #order_review table.shop_table tbody,
body.dpm-bd-express-checkout form.woocommerce-checkout #order_review table.shop_table tbody tr {
	display: block;
	width: 100% !important;
}

body.dpm-bd-express-checkout form.woocommerce-checkout #order_review table.shop_table {
	display: block;
	width: 100% !important;
}

body.dpm-bd-express-checkout form.woocommerce-checkout #order_review table.shop_table tbody tr {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 0.45rem 0.75rem;
	min-height: 0;
	padding: 0.5rem 0;
	border-bottom: 1px solid #ece5de;
}

body.dpm-bd-express-checkout form.woocommerce-checkout #order_review table.shop_table tbody td {
	padding: 0;
	border: 0;
}

body.dpm-bd-express-checkout form.woocommerce-checkout #order_review table.shop_table .product-name {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 0.35rem;
	width: auto;
	min-width: 0;
}

body.dpm-bd-express-checkout form.woocommerce-checkout .dpm-order-product-link {
	display: flex;
	width: 100%;
	font-size: 0.86rem;
	line-height: 1.3;
}

body.dpm-bd-express-checkout form.woocommerce-checkout .dpm-order-product-link img {
	flex: 0 0 40px;
	width: 40px;
	height: 40px;
}

body.dpm-bd-express-checkout form.woocommerce-checkout .dpm-checkout-quantity {
	position: static;
	margin-left: 48px;
}

body.dpm-bd-express-checkout form.woocommerce-checkout .dpm-checkout-quantity button,
body.dpm-bd-express-checkout form.woocommerce-checkout .dpm-checkout-quantity input {
	width: 26px;
	min-height: 26px !important;
	font-size: 0.78rem;
}

body.dpm-bd-express-checkout form.woocommerce-checkout #order_review table.shop_table .product-total {
	position: static;
	align-self: center;
	justify-self: end;
	width: auto;
	text-align: right;
	white-space: nowrap;
	font-weight: 800;
}

body.dpm-bd-express-checkout form.woocommerce-checkout #order_review table.shop_table tfoot {
	display: block;
	width: 100%;
}

body.dpm-bd-express-checkout form.woocommerce-checkout #order_review table.shop_table tfoot tr {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	width: 100%;
}

body.dpm-bd-express-checkout form.woocommerce-checkout #order_review table.shop_table tfoot tr.cart-subtotal {
	display: none !important;
}

body.dpm-bd-express-checkout form.woocommerce-checkout #order_review table.shop_table tfoot td {
	justify-self: end;
	width: auto;
	text-align: right;
}

body.dpm-bd-express-checkout form.woocommerce-checkout #order_review table.shop_table tfoot th,
body.dpm-bd-express-checkout form.woocommerce-checkout #order_review table.shop_table tfoot td {
	padding: 0.42rem 0;
	font-size: 0.84rem;
}

body.dpm-bd-express-checkout form.woocommerce-checkout #payment {
	margin-top: 0.6rem;
	padding: 0.6rem;
	border: 1px solid #f0e5db;
	border-radius: 12px;
}

body.dpm-bd-express-checkout form.woocommerce-checkout #payment ul.payment_methods {
	padding: 0;
}

body.dpm-bd-express-checkout form.woocommerce-checkout #place_order {
	width: 100%;
	min-height: 46px;
	margin-top: 0.35rem;
}

body.dpm-bd-express-checkout .dpm-normal-checkout-coupon {
	display: block;
	width: 100%;
	margin: 0.35rem 0 0;
	padding: 0.55rem;
	border: 1px solid #eadfd5;
	border-radius: 10px;
	background: #fff9f4;
}

body.dpm-bd-express-checkout .dpm-normal-checkout-coupon label {
	display: block;
	margin-bottom: 0.35rem;
	font-size: 0.82rem;
	font-weight: 750;
}

body.dpm-bd-express-checkout .dpm-normal-checkout-coupon > div {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 0.5rem;
}

body.dpm-bd-express-checkout .dpm-normal-checkout-coupon button {
	min-height: 40px;
	padding-inline: 1rem;
	border: 0;
	border-radius: 8px;
	background: var(--dpm-commerce-accent);
	color: #fff;
	font-weight: 800;
}

@media (min-width: 783px) {
	body.dpm-bd-express-checkout .dpm-section {
		padding-block: 1rem;
	}

	body.dpm-bd-express-checkout .dpm-entry {
		padding: 1rem;
	}

	body.dpm-bd-express-checkout .dpm-container {
		width: min(100% - 2rem, 1240px);
	}

	body.dpm-bd-express-checkout .entry-header {
		padding-bottom: 0.65rem;
	}

	body.dpm-bd-express-checkout .entry-title {
		font-size: 1.75rem;
	}

	body.dpm-bd-express-checkout .entry-title::after {
		margin-top: 0.4rem;
	}

	body.dpm-bd-express-checkout form.woocommerce-checkout .form-row label {
		margin-bottom: 0.25rem;
		font-size: 0.8rem;
	}

	body.dpm-bd-express-checkout form.woocommerce-checkout #payment ul.payment_methods {
		padding: 0.65rem;
	}

	body.dpm-bd-express-checkout form.woocommerce-checkout #payment div.payment_box {
		padding: 0.5rem;
		margin-top: 0.35rem;
	}
}

@media (max-width: 782px) {
	body.dpm-bd-express-checkout form.woocommerce-checkout {
		display: block;
		width: 100%;
		margin-top: 0.65rem;
	}

	body.dpm-bd-express-checkout form.woocommerce-checkout #customer_details,
	body.dpm-bd-express-checkout form.woocommerce-checkout #order_review {
		padding: 0.75rem;
	}

	body.dpm-bd-express-checkout form.woocommerce-checkout #order_review_heading {
		position: static;
		width: auto;
		margin-top: 0.8rem;
		padding: 0 0 0.5rem;
	}

	body.dpm-bd-express-checkout form.woocommerce-checkout #order_review {
		margin-top: 0;
	}

	body.dpm-bd-express-checkout .dpm-normal-checkout-coupon > div {
		grid-template-columns: minmax(0, 1fr) auto;
	}
}

@media (max-width: 640px) {
	body.dpm-bd-express-checkout form.checkout_coupon,
	.dpm-popup-checkout form.checkout_coupon {
		grid-template-columns: 1fr;
	}
	body.woocommerce-cart .dpm-entry,
	body.woocommerce-checkout .dpm-entry {
		padding-inline: 0.75rem;
	}

	body.woocommerce-checkout #place_order,
	body.woocommerce-checkout .wc-block-components-checkout-place-order-button,
	body.woocommerce-cart .checkout-button,
	body.woocommerce-cart .wc-block-cart__submit-button {
		width: 100%;
	}

	/* Keep the mobile cart focused: product summary and payable total only. */
	body.woocommerce-cart .woocommerce-cart-form .product-price,
	body.woocommerce-cart .woocommerce-cart-form .product-quantity,
	body.woocommerce-cart .woocommerce-cart-form .product-subtotal,
	body.woocommerce-cart .woocommerce-cart-form td.actions,
	body.woocommerce-cart .cart-collaterals .cart_totals .cart-subtotal,
	body.woocommerce-cart .cart-collaterals .cart_totals .woocommerce-shipping-totals,
	body.woocommerce-cart .cart-collaterals .cart_totals .tax-rate,
	body.woocommerce-cart .cart-collaterals .cart_totals .order-tax {
		display: none !important;
	}

	body.woocommerce-cart .cart-collaterals .cart_totals .order-total {
		display: table-row !important;
	}

	body.woocommerce-cart .cart-collaterals .cart_totals > h2 {
		display: none;
	}

	body.woocommerce-cart .woocommerce-cart-form tr.cart_item {
		display: grid;
		grid-template-columns: 28px 64px minmax(0, 1fr);
		align-items: center;
		gap: 0.65rem;
	}

	body.woocommerce-cart .woocommerce-cart-form td.product-remove,
	body.woocommerce-cart .woocommerce-cart-form td.product-thumbnail,
	body.woocommerce-cart .woocommerce-cart-form td.product-name {
		display: block !important;
		width: auto;
		padding: 0.65rem 0;
		border: 0;
		text-align: left !important;
	}

	body.woocommerce-cart .woocommerce-cart-form td.product-thumbnail::before,
	body.woocommerce-cart .woocommerce-cart-form td.product-name::before {
		display: none;
	}

	body.woocommerce-cart .woocommerce-cart-form td.product-thumbnail img {
		display: block;
		width: 60px;
		height: 60px;
		object-fit: contain;
	}
}
/* Cart quantities are managed by the existing cart controls; avoid an inactive duplicate action. */
body.woocommerce-cart .woocommerce-cart-form .product-quantity,
body.woocommerce-cart .woocommerce-cart-form button[name="update_cart"] {
	display: none;
}

body.woocommerce-cart .cart-collaterals .cart_totals .cart-subtotal {
	display: none;
}

body.woocommerce-cart .cart-collaterals .cart_totals > h2 {
	text-transform: capitalize;
}

body.woocommerce-cart .cart-collaterals .cart_totals .wc-proceed-to-checkout .checkout-button {
	border-color: var(--dpm-commerce-accent);
	background: var(--dpm-commerce-accent);
	color: #fff;
	box-shadow: 0 10px 22px rgba(232, 95, 0, 0.2);
}

body.woocommerce-cart .cart-collaterals .cart_totals .wc-proceed-to-checkout .checkout-button:hover,
body.woocommerce-cart .cart-collaterals .cart_totals .wc-proceed-to-checkout .checkout-button:focus-visible {
	border-color: var(--dpm-commerce-accent-hover);
	background: var(--dpm-commerce-accent-hover);
	color: #fff;
}
