/*
 * Cart, checkout, order-received, my account, sign-in (Theme My Login).
 * Loaded only on those screens (inc/commerce-ui.php). Restyles WooCommerce /
 * TML markup with dx tokens; checkout + order-received always render light.
 * Wrappers: .dm-co (cart/checkout/received), .dm-acc (account), .dm-auth (TML).
 * !important only where a plugin forces a value with !important (noted inline).
 */

/* ---------- PAGE SHELL ---------- */
.dm-co, .dm-acc, .dm-auth { padding-block: clamp(18px, 3vw, 32px) clamp(48px, 6vw, 80px); }
.dx .dm-co__title { font-size: clamp(28px, 3.4vw, 42px); margin-block: 6px 22px; }
:is(.dm-co, .dm-acc, .dm-auth) .woocommerce { font-size: 15px; color: var(--dm-text); }
:is(.dm-co, .dm-acc, .dm-auth) .woocommerce::before,
:is(.dm-co, .dm-acc, .dm-auth) .woocommerce::after { display: none; }

/* ---------- STEPS BAR ---------- */
.dx .dx-steps { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 14px; margin-block: 6px 12px; }
.dx-steps li { display: inline-flex; align-items: center; gap: 8px; color: var(--dm-muted); }
.dx-steps li + li::before { content: ""; width: 28px; height: 1px; background: var(--dm-hover-rule); margin-inline-end: 0; }
.dx-steps b { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--dm-subtle); color: var(--dm-text); font-size: 13px; border: 1px solid var(--dm-border); }
.dx-steps .on { color: var(--dm-text); font-weight: 700; }
.dx-steps .on b { background: var(--dm-btn-bg); color: var(--dm-btn-text); border-color: transparent; }
.dx-steps .done b { background: var(--dm-accent); color: var(--dm-on-accent); border-color: transparent; }
@media (max-width: 560px) {
	.dx-steps li:not(.on) > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
	.dx-steps li + li::before { width: 18px; }
}

/* ---------- PERKS (verified claims only) ---------- */
.dx .dx-perks { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-block-start: 28px; padding-block-start: 20px; border-block-start: 1px solid var(--dm-border); font-size: 13.5px; color: var(--dm-text-2); }
.dx-perks li { position: relative; padding-inline-start: 21px; }
.dx-perks li::before { content: ""; position: absolute; inset-inline-start: 0; top: .35em; width: 13px; height: 13px; background: url(../img/dimitris-star.png) center / contain no-repeat; }
.dx-perks a { white-space: nowrap; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* Empty cart: no steps, no perks (also after the last row is removed over AJAX). */
.dm-co--cart:has(.wc-empty-cart-message) :is(.dx-steps, .dx-perks) { display: none; }

/* ---------- NOTICES ---------- */
:is(.dm-co, .dm-acc, .dm-auth) .woocommerce-notices-wrapper:empty { display: none; }
.dx :is(.dm-co, .dm-acc) :is(.woocommerce-message, .woocommerce-info, .woocommerce-error) {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
	background: var(--dm-surface); color: var(--dm-text); border: 1px solid var(--dm-border); border-inline-start: 4px solid var(--dm-hover-rule);
	border-radius: 14px; padding: 14px 18px; margin: 0 0 16px; list-style: none; font-size: 14.5px; line-height: 1.5;
}
.dx :is(.dm-co, .dm-acc) :is(.woocommerce-message, .woocommerce-info, .woocommerce-error)::before { display: none; }
.dx :is(.dm-co, .dm-acc) .woocommerce-message { border-inline-start-color: var(--dm-ok); }
.dx :is(.dm-co, .dm-acc) .woocommerce-error { border-inline-start-color: var(--dm-accent); display: block; }
.dx :is(.dm-co, .dm-acc) .woocommerce-error li { margin: 0; padding-block: 2px; }
.dx :is(.dm-co, .dm-acc) :is(.woocommerce-message, .woocommerce-info) .button { order: 2; float: none; margin: 0; min-height: 40px; padding: 0 16px; font-size: 14px; }
.dx :is(.dm-co, .dm-acc) :is(.woocommerce-message, .woocommerce-info, .woocommerce-error) a:not(.button) { text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }

/* ---------- BUTTONS ---------- */
.dx :is(.dm-co, .dm-acc) .woocommerce :is(a.button, button.button, input.button):not(:where(li.product) *) {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 48px; padding: 0 24px; border: 0; border-radius: 999px;
	background: var(--dm-btn-bg); color: var(--dm-btn-text);
	font: inherit; font-size: 15px; font-weight: 600; line-height: 1.2; text-decoration: none; text-transform: none; letter-spacing: 0;
	box-shadow: none; cursor: pointer; transition: background .15s, color .15s;
}
.dx :is(.dm-co, .dm-acc) .woocommerce :is(a.button, button.button, input.button):not(:where(li.product) *):hover { background: var(--dm-btn-hover-bg); color: var(--dm-btn-hover-text); }
.dx :is(.dm-co, .dm-acc) .woocommerce :is(a.button, button.button, input.button):disabled { opacity: .45; cursor: not-allowed; }

/* ---------- FIELDS ---------- */
.dx :is(.dm-co, .dm-acc) .woocommerce form .form-row { padding: 0; margin: 0 0 14px; }
.dx :is(.dm-co, .dm-acc) .woocommerce form .form-row label:not(.checkbox):not(.woocommerce-form__label-for-checkbox) { display: block; font-size: 14px; font-weight: 600; line-height: 1.4; margin-block-end: 6px; color: var(--dm-text); }
.dx :is(.dm-co, .dm-acc) .woocommerce form .form-row .required { color: var(--dm-accent); text-decoration: none; border: 0; }
.dx :is(.dm-co, .dm-acc) .woocommerce form .form-row .optional { color: var(--dm-muted); font-weight: 400; }
.dx :is(.dm-co, .dm-acc) .woocommerce :is(input.input-text, textarea, select),
.dx :is(.dm-co, .dm-acc) .woocommerce .select2-container .select2-selection--single {
	width: 100%; min-height: 50px; margin: 0; padding: 10px 14px;
	background: var(--dm-card); color: var(--dm-text); border: 1px solid var(--dm-hover-rule); border-radius: 12px;
	font: inherit; font-size: 15px; line-height: 1.4; box-shadow: none;
}
.dx :is(.dm-co, .dm-acc) .woocommerce textarea { min-height: 96px; }
.dx :is(.dm-co, .dm-acc) .woocommerce :is(input.input-text, textarea, select):focus,
.dx :is(.dm-co, .dm-acc) .woocommerce .select2-container--focus .select2-selection--single,
.dx :is(.dm-co, .dm-acc) .woocommerce .select2-container--open .select2-selection--single { border-color: var(--dm-text); outline: 2px solid var(--dm-text); outline-offset: 0; }
.dx :is(.dm-co, .dm-acc) .woocommerce .select2-selection--single .select2-selection__rendered { padding: 0; line-height: 28px; color: var(--dm-text); }
.dx :is(.dm-co, .dm-acc) .woocommerce .select2-selection--single .select2-selection__arrow { top: 0; bottom: 0; height: auto; inset-inline-end: 10px; inset-inline-start: auto; }
.dx :is(.dm-co, .dm-acc) .woocommerce .select2-selection--single .select2-selection__arrow b { top: 50%; }
.dx :is(.dm-co, .dm-acc) .woocommerce .form-row.woocommerce-invalid :is(input.input-text, select, .select2-selection) { border-color: var(--dm-accent); }
.dx :is(.dm-co, .dm-acc) .woocommerce .checkout-inline-error-message { color: var(--dm-accent); font-size: 13px; font-weight: 600; margin-block-start: 6px; }
.dx :is(.dm-co, .dm-acc) .woocommerce :is(input[type=radio], input[type=checkbox]) { accent-color: var(--dm-text); width: 18px; height: 18px; margin: 0; margin-inline-end: 8px; vertical-align: -3px; }
.dx :is(.dm-co, .dm-acc) .woocommerce label.checkbox,
.dx :is(.dm-co, .dm-acc) .woocommerce .woocommerce-form__label-for-checkbox { display: inline-flex; align-items: center; gap: 0; font-weight: 600; cursor: pointer; }
/* select2 dropdown is appended to <body> */
.dx .select2-dropdown { background: var(--dm-card); color: var(--dm-text); border-color: var(--dm-hover-rule); border-radius: 12px; overflow: hidden; }
.dx .select2-search--dropdown .select2-search__field { background: var(--dm-card); color: var(--dm-text); border: 1px solid var(--dm-border); border-radius: 8px; min-height: 40px; padding: 6px 10px; }
.dx .select2-results__option { padding: 8px 14px; }
.dx .select2-container--default .select2-results__option--highlighted[aria-selected],
.dx .select2-container--default .select2-results__option--highlighted[data-selected] { background: var(--dm-btn-bg); color: var(--dm-btn-text); }

/* ---------- TOTALS TABLES (cart totals + checkout order review) ---------- */
.dx .dm-co :is(.cart_totals, #order_review) table.shop_table { display: block; border: 0; border-radius: 0; margin: 0; width: 100%; }
.dx .dm-co :is(.cart_totals, #order_review) table.shop_table :is(thead, tbody, tfoot) { display: block; }
.dx .dm-co :is(.cart_totals, #order_review) table.shop_table tr { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; padding-block: 12px; border-block-end: 1px solid var(--dm-border); }
.dx .dm-co :is(.cart_totals, #order_review) table.shop_table :is(th, td) { display: block; padding: 0; border: 0; background: none; color: var(--dm-text); text-align: start; font-weight: 400; line-height: 1.5; }
.dx .dm-co :is(.cart_totals, #order_review) table.shop_table :is(tfoot th, tbody th) { font-weight: 600; }
.dx .dm-co :is(.cart_totals, #order_review) table.shop_table td:last-child { text-align: end; margin-inline-start: auto; }
.dx .dm-co :is(.cart_totals, #order_review) table.shop_table tr.order-total { border-block-end: 0; padding-block-start: 16px; }
.dx .dm-co :is(.cart_totals, #order_review) table.shop_table tr.order-total :is(th, td) { font-size: 19px; font-weight: 700; }
.dx .dm-co :is(.cart_totals, #order_review) table.shop_table td::before { display: none; }
.dx .dm-co .woocommerce-Price-currencySymbol { color: inherit; }
/* Shipping row: label on its own line, methods full width as option tiles. */
.dx .dm-co :is(.cart_totals, #order_review) tr.woocommerce-shipping-totals > :is(th, td) { flex: 1 1 100%; text-align: start; margin: 0; }
.dx .dm-co ul#shipping_method { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 8px; }
.dx .dm-co ul#shipping_method li { display: flex; align-items: flex-start; gap: 0; margin: 0; padding: 12px 14px; border: 1.5px solid var(--dm-border); border-radius: 12px; background: var(--dm-card); line-height: 1.45; text-indent: 0; text-align: start; cursor: pointer; transition: border-color .15s; }
.dx .dm-co ul#shipping_method li:has(input:checked) { border-color: var(--dm-text); box-shadow: inset 0 0 0 1px var(--dm-text); }
.dx .dm-co ul#shipping_method li:only-child { cursor: default; }
.dx .dm-co ul#shipping_method li::before { display: none; }
.dx .dm-co ul#shipping_method input { flex: none; margin-block-start: 2px; }
.dx .dm-co ul#shipping_method label { display: inline; margin: 0; font-weight: 500; cursor: inherit; }
.dx .dm-co ul#shipping_method label .amount { font-weight: 700; white-space: nowrap; }
.dx .dm-co .woocommerce-shipping-destination,
.dx .dm-co .woocommerce-shipping-contents { font-size: 13px; color: var(--dm-muted); margin: 8px 0 0; line-height: 1.5; }
.dx .dm-co .woocommerce-shipping-calculator { margin-block-start: 8px; font-size: 14px; }
.dx .dm-co .shipping-calculator-button { text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
/* Free-shipping note row (mu-plugin dm-free-shipping-note): one quiet line. */
.dx .dm-co tr.dm-free-shipping-note { padding-block: 0 12px; }
.dx .dm-co tr.dm-free-shipping-note th { display: none; }
.dx .dm-co tr.dm-free-shipping-note td { flex: 1 1 100%; text-align: start; margin: 0; }
.dx .dm-co tr.dm-free-shipping-note .woocommerce-shipping-destination { margin: 0; display: flex; gap: 8px; align-items: center; color: var(--dm-text-2); }
.dx .dm-co tr.dm-free-shipping-note .woocommerce-shipping-destination::before { content: ""; flex: none; width: 12px; height: 12px; background: url(../img/dimitris-star.png) center / contain no-repeat; }
.dx .dm-co tr:has(+ tr.dm-free-shipping-note) { border-block-end: 0; }

/* ---------- CART ---------- */
/* Totals before cross-sells when stacked (mu-plugins force .cross-sells { order: 2 }). */
.dm-co--cart .cart-collaterals { display: flex; flex-direction: column; }
@media (min-width: 960px) {
	.dm-co--cart .woocommerce:has(.woocommerce-cart-form) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 380px); gap: 0 32px; align-items: start; }
	.dm-co--cart .woocommerce:has(.woocommerce-cart-form) > :not(.woocommerce-cart-form, .cart-collaterals) { grid-column: 1 / -1; }
	.dm-co--cart .woocommerce-cart-form { grid-column: 1; grid-row: 2; }
	.dm-co--cart .woocommerce .cart-collaterals { display: contents; }
	.dm-co--cart .cart-collaterals .cart_totals { grid-column: 2; grid-row: 2 / span 2; position: sticky; top: 96px; }
	.dm-co--cart .cart-collaterals .cross-sells { grid-column: 1; grid-row: 3; }
}
.dx .dm-co--cart .woocommerce-cart-form { background: var(--dm-card); border: 1px solid var(--dm-border); border-radius: 22px; padding: 4px clamp(14px, 2vw, 22px); margin: 0 0 20px; }
.dx .dm-co--cart table.shop_table.cart { display: block; border: 0; margin: 0; border-radius: 0; width: 100%; }
.dx .dm-co--cart table.shop_table.cart thead { display: none; }
.dx .dm-co--cart table.shop_table.cart tbody { display: block; }
.dx .dm-co--cart table.shop_table.cart tr.cart_item {
	display: grid; align-items: center; gap: 4px 18px; padding-block: 18px;
	grid-template-columns: 88px minmax(0, 1fr) auto minmax(84px, auto) 40px;
	grid-template-areas: "img name qty sub rm" "img price qty sub rm";
}
.dx .dm-co--cart table.shop_table.cart tr.cart_item + tr.cart_item { border-block-start: 1px solid var(--dm-border); }
.dx .dm-co--cart table.shop_table.cart tr.cart_item td { display: block; padding: 0; border: 0; background: none; text-align: start; color: var(--dm-text); }
.dx .dm-co--cart table.shop_table.cart tr.cart_item td::before { display: none; }
.dx .dm-co--cart td.product-thumbnail { grid-area: img; }
.dx .dm-co--cart td.product-thumbnail a { display: block; width: 88px; height: 88px; border-radius: 14px; overflow: hidden; background: var(--dm-well, var(--dm-subtle)); } /* --dm-well: shop.css card image ground */
.dx .dm-co--cart td.product-thumbnail img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; font-size: 0; color: transparent; } /* missing local images: no alt text spill */
.dx .dm-co--cart td.product-name { grid-area: name; align-self: end; font-size: 15px; line-height: 1.45; font-weight: 600; }
.dx .dm-co--cart td.product-name a:hover { text-decoration: underline; text-underline-offset: 3px; }
.dx .dm-co--cart td.product-name dl.variation { margin: 4px 0 0; font-size: 13px; font-weight: 400; color: var(--dm-muted); }
.dx .dm-co--cart td.product-name dl.variation :is(dt, dd) { display: inline; float: none; margin: 0; padding: 0; }
.dx .dm-co--cart td.product-name dl.variation dd p { display: inline; margin: 0; }
.dx .dm-co--cart td.product-name .backorder_notification { font-size: 13px; color: var(--dm-muted); margin-block-start: 4px; }
.dx .dm-co--cart td.product-price { grid-area: price; align-self: start; font-size: 13.5px; color: var(--dm-muted); }
.dx .dm-co--cart td.product-price .amount { color: var(--dm-muted); }
.dx .dm-co--cart td.product-quantity { grid-area: qty; }
.dx .dm-co--cart td.product-subtotal { grid-area: sub; text-align: end; font-weight: 700; white-space: nowrap; }
.dx .dm-co--cart td.product-remove { grid-area: rm; justify-self: end; }
.dx .dm-co--cart td.product-remove a.remove {
	--wc-red: var(--dm-muted); /* WooCommerce paints the × with color: var(--wc-red) !important */
	display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; font-size: 22px; font-weight: 400; line-height: 1;
	background: transparent; transition: background .15s;
}
.dx .dm-co--cart td.product-remove a.remove:hover { --wc-red: var(--dm-text); background: var(--dm-subtle); }
/* Actions row: coupons are off in WooCommerce and qty edits apply on their own
   (inc/cart.php presses the hidden Update cart button), so only a coupon would show here. */
.dx .dm-co--cart table.shop_table.cart tr:not(.cart_item) { display: block; }
.dx .dm-co--cart table.shop_table.cart td.actions { display: block; padding: 0; border: 0; background: none; }
.dx .dm-co--cart table.shop_table.cart td.actions:has(.coupon) { padding-block: 16px; border-block-start: 1px solid var(--dm-border); }
.dx .dm-co--cart td.actions button[name="update_cart"] { display: none; }
.dx .dm-co--cart td.actions .coupon { display: flex; flex-wrap: wrap; gap: 8px; float: none; }
.dx .dm-co--cart td.actions .coupon label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.dx .dm-co--cart td.actions .coupon #coupon_code { width: auto; flex: 1 1 180px; max-width: 260px; min-height: 48px; border-radius: 999px; padding-inline: 18px; }
.dx .dm-co--cart td.actions .coupon .button { background: transparent; color: var(--dm-text); border: 1.5px solid currentColor; }
/* Loading states toggled by inc/cart.php (row leaves at once on remove, totals dim while updating). */
.dx .dm-co--cart table.shop_table.cart tr.cart_item.dm-removing { display: none; }
/* Dimmed only: Proceed stays tappable mid-update (inc/cart.php flushes pending qty via dm_update_cart). */
.dx .dm-co--cart .cart_totals.dm-updating :is(table, h2) { opacity: .45; transition: opacity .15s; }
.dx .dm-co--cart td.product-remove a.remove.is-loading { pointer-events: none; color: transparent; position: relative; }
.dx .dm-co--cart td.product-remove a.remove.is-loading::after,
.dx .dm-co--cart a.checkout-button.is-loading::after { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--dm-border); border-top-color: var(--dm-accent); animation: dm-spin .7s linear infinite; }
.dx .dm-co--cart td.product-remove a.remove.is-loading::after { position: absolute; inset: 0; margin: auto; }
.dx .dm-co--cart a.checkout-button.is-loading { opacity: .75; pointer-events: none; }
/* Qty stepper (dm-product-ui.js; base look in legacy-features.css). */
.dx .dm-co--cart table.shop_table .quantity.dm-qty { height: 46px; }

/* Totals card */
.dx .dm-co--cart .cart-collaterals .cart_totals { width: 100%; float: none; background: var(--dm-card); border: 1px solid var(--dm-border); border-radius: 22px; padding: 22px; margin: 0 0 20px; }
.dx .dm-co--cart .cart_totals h2 { font-size: 20px; margin: 0 0 4px; }
.dx .dm-co--cart .wc-proceed-to-checkout { padding: 18px 0 0; }
.dx .dm-co--cart .wc-proceed-to-checkout a.checkout-button { display: flex; width: 100%; min-height: 56px; font-size: 17px; margin: 0; }
/* Cross-sells: mu-plugins force order / margin / padding / border-top with !important; only the rule colour is ours. */
.dx .dm-co--cart .cross-sells { border-top-color: var(--dm-border) !important; width: 100%; float: none; }
.dx .dm-co--cart .cross-sells > h2 { font-size: clamp(20px, 2vw, 24px); margin: 0 0 16px; }
.dx .dm-co--cart .cross-sells ul.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; margin: 0; padding: 0; }
.dx .dm-co--cart .cross-sells ul.products::before, .dx .dm-co--cart .cross-sells ul.products::after { display: none; }
.dx .dm-co--cart .cross-sells ul.products li.product { width: auto; float: none; margin: 0; }

@media (max-width: 700px) {
	.dx .dm-co--cart table.shop_table.cart tr.cart_item {
		grid-template-columns: 72px minmax(0, 1fr) auto; gap: 4px 12px; padding-block: 16px;
		grid-template-areas: "img name rm" "img price price" "qty qty sub";
	}
	.dx .dm-co--cart td.product-thumbnail a { width: 72px; height: 72px; }
	.dx .dm-co--cart td.product-name { align-self: start; font-size: 14.5px; }
	.dx .dm-co--cart td.product-remove { align-self: start; margin-block-start: -6px; margin-inline-end: -8px; }
	.dx .dm-co--cart td.product-quantity { margin-block-start: 10px; }
	.dx .dm-co--cart td.product-subtotal { align-self: center; margin-block-start: 10px; font-size: 16px; }
	.dx .dm-co--cart .cart-collaterals .cart_totals { padding: 18px; }
	.dx .dm-co--cart .cross-sells ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}

/* Empty cart */
.dx .dm-co--cart .wc-empty-cart-message { margin: 0; }
.dx .dm-co--cart .wc-empty-cart-message .cart-empty.woocommerce-info {
	display: block; text-align: center; background: var(--dm-surface); border: 1px dashed var(--dm-hover-rule); border-radius: 22px;
	padding: clamp(40px, 7vw, 72px) 20px 96px; margin: 0; font-size: clamp(17px, 1.6vw, 20px); font-weight: 600;
}
.dx .dm-co--cart .wc-empty-cart-message .cart-empty.woocommerce-info::before {
	content: ""; display: block; width: 44px; height: 44px; margin: 0 auto 16px; position: static;
	background: url(../img/dimitris-star.png) center / contain no-repeat;
}
.dx .dm-co--cart .return-to-shop { display: flex; justify-content: center; margin: -76px 0 0; position: relative; }
.dx .dm-co--cart .return-to-shop a.button { min-height: 52px; padding: 0 30px; }

/* ---------- CHECKOUT ---------- */
.dx .dm-co--checkout .woocommerce-form-login-toggle .woocommerce-info,
.dx .dm-co--checkout .woocommerce-form-coupon-toggle .woocommerce-info { justify-content: flex-start; font-size: 14px; }
.dx .dm-co--checkout form.woocommerce-form-login,
.dx .dm-co--checkout form.checkout_coupon { background: var(--dm-card); border: 1px solid var(--dm-border); border-radius: 18px; padding: 20px; margin: 0 0 16px; }
.dx .dm-co--checkout form.woocommerce-form-login .form-row { width: 100%; float: none; }
.dx .dm-co--checkout form.woocommerce-form-login .woocommerce-form-login__rememberme { margin-block-end: 12px; display: flex; }
.dx .dm-co--checkout form.woocommerce-form-login p:first-child { margin-block-end: 14px; color: var(--dm-text-2); }

/* Details left (spanning both rows), "Your order" heading + sticky review card right;
   the 1fr row soaks up the details' height. Checkout errors (prepended by WooCommerce) take a row on top. */
.dx .dm-co form.checkout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); grid-template-rows: auto 1fr; gap: 0 32px; align-items: start; }
.dx .dm-co form.checkout > * { grid-column: 1; }
.dx .dm-co form.checkout #customer_details { grid-row: 1 / 3; }
.dx .dm-co form.checkout #order_review_heading { grid-column: 2; grid-row: 1; margin: 0 0 12px; font-size: 20px; }
.dx .dm-co form.checkout #order_review { grid-column: 2; grid-row: 2; position: sticky; top: 24px; width: 100%; float: none; background: var(--dm-card); border: 1px solid var(--dm-border); border-radius: 22px; padding: 22px; }
.dx .dm-co form.checkout:has(> .woocommerce-NoticeGroup) { grid-template-rows: auto auto 1fr; }
.dx .dm-co form.checkout > .woocommerce-NoticeGroup { grid-column: 1 / -1; grid-row: 1; }
.dx .dm-co form.checkout:has(> .woocommerce-NoticeGroup) #customer_details { grid-row: 2 / 4; }
.dx .dm-co form.checkout:has(> .woocommerce-NoticeGroup) #order_review_heading { grid-row: 2; }
.dx .dm-co form.checkout:has(> .woocommerce-NoticeGroup) #order_review { grid-row: 3; }
.dx .dm-co #customer_details { display: block; }
.dx .dm-co #customer_details::before, .dx .dm-co #customer_details::after { display: none; }
.dx .dm-co #customer_details :is(.col-1, .col-2) { width: 100%; float: none; max-width: none; padding: 0; }
.dx .dm-co #customer_details :is(.woocommerce-billing-fields, .woocommerce-shipping-fields, .woocommerce-additional-fields, .woocommerce-account-fields:has(.form-row)) {
	background: var(--dm-card); border: 1px solid var(--dm-border); border-radius: 22px; padding: clamp(18px, 2.4vw, 24px); margin-block-end: 16px;
}
.dx .dm-co #customer_details .woocommerce-account-fields:not(:has(.form-row)) { display: none; }
.dx .dm-co #customer_details .woocommerce-shipping-fields:not(:has(*)) { display: none; }
.dx .dm-co #customer_details h3 { font-size: 20px; margin: 0 0 14px; }
.dx .dm-co #customer_details h3#ship-to-different-address { margin: 0; font-size: 16px; }
.dx .dm-co #customer_details .shipping_address { margin-block-start: 16px; }
.dx .dm-co #customer_details :is(.woocommerce-billing-fields__field-wrapper, .woocommerce-shipping-fields__field-wrapper) { display: flex; flex-wrap: wrap; gap: 0 14px; }
.dx .dm-co #customer_details .form-row { flex: 1 1 100%; width: auto; float: none; }
.dx .dm-co #customer_details :is(.form-row-first, .form-row-last) { flex: 1 1 calc(50% - 7px); min-width: 220px; }
.dx .dm-co #customer_details .woocommerce-account-fields .form-row { margin: 0; }
.dx .dm-co #customer_details .create-account { margin-block-start: 14px; }
/* custom-checkout-styles / custom-checkout.php force .form-row { margin-bottom: 20px !important }; the card padding already ends each box. */
.dx .dm-co #customer_details p.form-row:last-of-type { margin-block-end: 0 !important; }

/* Order review card */
.dx .dm-co #order_review table.shop_table thead { display: none; }
.dx .dm-co #order_review table.shop_table tbody tr.cart_item td.product-name { flex: 1 1 0; min-width: 0; font-size: 14px; line-height: 1.5; }
.dx .dm-co #order_review td.product-name .product-quantity { font-weight: 700; color: var(--dm-muted); white-space: nowrap; }
.dx .dm-co #order_review td.product-name dl.variation { margin: 2px 0 0; font-size: 12.5px; color: var(--dm-muted); }
.dx .dm-co #order_review td.product-name dl.variation :is(dt, dd) { display: inline; float: none; margin: 0; padding: 0; }
.dx .dm-co #order_review td.product-name dl.variation dd p { display: inline; margin: 0; }
.dx .dm-co #order_review td.product-total { white-space: nowrap; font-weight: 600; }

/* Payment methods */
.dx .dm-co #payment { background: transparent; border-radius: 0; margin-block-start: 18px; }
.dx .dm-co #payment ul.payment_methods { list-style: none; display: grid; gap: 8px; margin: 0 0 16px; padding: 0; border: 0; }
.dx .dm-co #payment ul.payment_methods::before, .dx .dm-co #payment ul.payment_methods::after { display: none; }
.dx .dm-co #payment ul.payment_methods li { display: flex; flex-wrap: wrap; align-items: center; margin: 0; padding: 14px 16px; list-style: none; line-height: 1.5; border: 1.5px solid var(--dm-border); border-radius: 14px; background: var(--dm-card); text-align: start; }
.dx .dm-co #payment ul.payment_methods li:has(> input:checked) { border-color: var(--dm-text); box-shadow: inset 0 0 0 1px var(--dm-text); }
.dx .dm-co #payment ul.payment_methods li::before { display: none; }
.dx .dm-co #payment ul.payment_methods li > input { flex: none; margin: 0; margin-inline-end: 10px; }
.dx .dm-co #payment ul.payment_methods li > div.payment_box { flex: 1 1 100%; }
.dx .dm-co #payment ul.payment_methods li > label { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-weight: 600; cursor: pointer; flex: 1 1 0; min-width: 0; margin: 0; }
.dx .dm-co #payment ul.payment_methods li > label img { display: inline-block; max-height: 22px; width: auto; margin: 0; float: none; vertical-align: middle; }
.dx .dm-co #payment ul.payment_methods li > label a.about_paypal { font-size: 12px; font-weight: 400; color: var(--dm-muted); float: none; line-height: inherit; margin: 0; }
.dx .dm-co #payment div.payment_box { background: var(--dm-surface); color: var(--dm-text-2); border-radius: 10px; margin: 12px 0 0; padding: 12px 14px; font-size: 14px; }
.dx .dm-co #payment div.payment_box::before { display: none; }
.dx .dm-co #payment div.payment_box :is(p, fieldset) { margin: 0; }
/* APS card fields / iframe container: never wider than the card. */
.dx .dm-co #payment :is(.payment_box iframe, .aps_payment_window, [class*="aps-"]) { max-width: 100%; }
.dx .dm-co #payment div.form-row.place-order { padding: 0; margin: 0; }
.dx .dm-co #payment .woocommerce-terms-and-conditions-wrapper,
.dx .dm-co #payment .woocommerce-privacy-policy-text { font-size: 13px; line-height: 1.5; color: var(--dm-muted); margin: 0 0 12px; }
.dx .dm-co #payment .woocommerce-privacy-policy-text a { text-decoration: underline; }
.dx .dm-co #payment #place_order { float: none; width: 100%; min-height: 56px; font-size: 17px; margin: 0; }
.dx .dm-co #payment .woocommerce-info { font-size: 14px; }

@media (max-width: 900px) {
	.dx .dm-co form.checkout, .dx .dm-co form.checkout:has(> .woocommerce-NoticeGroup) { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
	.dx .dm-co form.checkout > *,
	.dx .dm-co form.checkout:has(> #customer_details) > :is(#customer_details, #order_review_heading, #order_review) { grid-column: 1; grid-row: auto; }
	.dx .dm-co form.checkout #order_review { position: static; }
	.dx .dm-co form.checkout #order_review_heading { margin-block-start: 8px; }
	.dx .dm-co form.checkout #order_review { padding: 18px; }
}

/* ---------- ORDER RECEIVED / ORDER PAY ---------- */
.dx .dm-co--received .woocommerce-order { max-width: 860px; }
.dx .dm-co--received .woocommerce-thankyou-order-received { font-size: 17px; font-weight: 600; margin: 0 0 20px; }
.dx .dm-co--received ul.woocommerce-order-overview {
	display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0; margin: 0 0 28px; padding: 0;
	background: var(--dm-card); border: 1px solid var(--dm-border); border-radius: 22px; overflow: hidden;
}
.dx .dm-co--received ul.woocommerce-order-overview::before, .dx .dm-co--received ul.woocommerce-order-overview::after { display: none; }
.dx .dm-co--received ul.woocommerce-order-overview li {
	float: none; margin: 0; padding: 16px 20px; border: 0; border-inline-end: 1px solid var(--dm-border); border-block-end: 1px solid var(--dm-border); margin-block-end: -1px;
	font-size: 12px; text-transform: none; color: var(--dm-muted); line-height: 1.5;
}
.dx .dm-co--received ul.woocommerce-order-overview li strong { display: block; font-size: 15px; color: var(--dm-text); margin-block-start: 2px; overflow-wrap: break-word; }
.dx .dm-co--received .woocommerce-order-details,
.dx .dm-co--received .woocommerce-customer-details { background: var(--dm-card); border: 1px solid var(--dm-border); border-radius: 22px; padding: clamp(18px, 2.4vw, 26px); margin: 0 0 20px; }
.dx .dm-co--received :is(.woocommerce-order-details__title, .woocommerce-column__title) { font-size: 20px; margin: 0 0 12px; }
.dx :is(.dm-co--received, .dm-acc) table.shop_table { border: 0; border-radius: 0; margin: 0; width: 100%; border-collapse: collapse; }
.dx :is(.dm-co--received, .dm-acc) table.shop_table :is(th, td) { padding: 12px 0; border: 0; border-block-end: 1px solid var(--dm-border); background: none; color: var(--dm-text); text-align: start; line-height: 1.5; vertical-align: top; }
.dx :is(.dm-co--received, .dm-acc) table.shop_table :is(th, td):last-child { text-align: end; }
.dx :is(.dm-co--received, .dm-acc) table.shop_table tfoot tr:last-child :is(th, td) { border-block-end: 0; }
.dx :is(.dm-co--received, .dm-acc) table.shop_table tfoot td:has(.order-actions-button) { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.dx :is(.dm-co--received, .dm-acc) table.shop_table tfoot .order-actions-button { min-height: 40px; padding: 0 18px; font-size: 14px; margin: 0; }
.dx :is(.dm-co--received, .dm-acc) table.shop_table .product-quantity { color: var(--dm-muted); }
.dx :is(.dm-co--received, .dm-acc) .wc-item-meta { list-style: none; margin: 4px 0 0; padding: 0; font-size: 13px; color: var(--dm-muted); }
.dx :is(.dm-co--received, .dm-acc) .wc-item-meta :is(li, p, strong) { display: inline; margin: 0; font-weight: 400; }
.dx .dm-co--received .woocommerce-customer-details .col2-set { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.dx .dm-co--received .woocommerce-customer-details .col2-set > * { width: auto; float: none; padding: 0; }
.dx :is(.dm-co--received, .dm-acc) address { font-style: normal; line-height: 1.7; border: 0; padding: 0; color: var(--dm-text-2); }
.dx :is(.dm-co--received, .dm-acc) address p { margin: 4px 0 0; }
/* APS status banner (inc/commerce.php; base look in legacy-features.css) */
.dx .dm-co--received .dm-pay-banner { margin-block-end: 20px; }

/* ---------- MY ACCOUNT ---------- */
.dx .dm-acc__hero { background: var(--dm-inverse-bg); color: var(--dm-inverse-text); border: 1px solid var(--dm-band-edge); border-radius: 30px; padding: clamp(26px, 4vw, 52px); margin-block-end: 26px; display: grid; justify-items: start; gap: 6px; }
.dx .dm-acc__hero .dx-k { color: var(--dm-accent-ink); margin: 0; }
.dx .dm-acc__hero .dx-h1 { font-size: clamp(32px, 4vw, 52px); }
.dx .dm-acc__hero .dx-btn { margin-block-start: 12px; }
.dx .dm-acc .woocommerce:has(.woocommerce-MyAccount-navigation) { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; align-items: start; }
.dx .dm-acc .woocommerce-MyAccount-navigation,
.dx .dm-acc .woocommerce-MyAccount-content { float: none; width: auto; margin: 0; }
.dx .dm-acc .woocommerce-MyAccount-navigation { position: sticky; top: 96px; }
.dx .dm-acc .woocommerce-MyAccount-navigation ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.dx .dm-acc .woocommerce-MyAccount-navigation li { margin: 0; padding: 0; }
.dx .dm-acc .woocommerce-MyAccount-navigation a { display: flex; align-items: center; min-height: 48px; padding: 0 16px; border-radius: 14px; background: var(--dm-surface); border: 1px solid var(--dm-border); color: var(--dm-text); font-weight: 600; transition: background .15s; }
.dx .dm-acc .woocommerce-MyAccount-navigation a:hover { background: var(--dm-subtle); border-color: var(--dm-hover-rule); }
.dx .dm-acc .woocommerce-MyAccount-navigation .is-active a { background: var(--dm-btn-bg); color: var(--dm-btn-text); border-color: transparent; }
.dx .dm-acc .woocommerce-MyAccount-navigation-link--customer-logout a { color: var(--dm-muted); background: transparent; }
.dx .dm-acc .woocommerce-MyAccount-content { background: var(--dm-card); border: 1px solid var(--dm-border); border-radius: 26px; padding: clamp(20px, 3.5vw, 40px); min-width: 0; }
.dx .dm-acc .woocommerce-MyAccount-content > p { margin: 0 0 14px; line-height: 1.7; color: var(--dm-text-2); }
.dx .dm-acc .woocommerce-MyAccount-content > p:first-of-type { color: var(--dm-text); font-size: 17px; }
.dx .dm-acc .woocommerce-MyAccount-content a:not(.button) { text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.dx .dm-acc .woocommerce-MyAccount-content :is(h2, h3) { font-size: 20px; margin: 0 0 12px; }
.dx .dm-acc .woocommerce-MyAccount-content mark { background: var(--dm-subtle); color: var(--dm-text); padding: 0 4px; border-radius: 4px; }
.dx .dm-acc .woocommerce-orders-table .button,
.dx .dm-acc .woocommerce-MyAccount-content table .button { min-height: 40px; padding: 0 16px; font-size: 14px; margin: 2px; }
.dx .dm-acc .woocommerce-Addresses { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-block-start: 8px; }
.dx .dm-acc .woocommerce-Addresses::before, .dx .dm-acc .woocommerce-Addresses::after { display: none; }
.dx .dm-acc .woocommerce-Addresses .woocommerce-Address { width: auto; float: none; padding: 18px; border: 1px solid var(--dm-border); border-radius: 18px; background: var(--dm-surface); }
.dx .dm-acc .woocommerce-Address-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-block-end: 8px; }
.dx .dm-acc .woocommerce-Address-title::before, .dx .dm-acc .woocommerce-Address-title::after { display: none; }
.dx .dm-acc .woocommerce-Address-title :is(h2, h3) { margin: 0; font-size: 17px; }
.dx .dm-acc .woocommerce-Address-title .edit { float: none; font-size: 14px; }
.dx .dm-acc .woocommerce-MyAccount-content form :is(.woocommerce-address-fields__field-wrapper) { display: flex; flex-wrap: wrap; gap: 0 14px; }
.dx .dm-acc .woocommerce-MyAccount-content form .form-row { flex: 1 1 100%; width: auto; float: none; }
.dx .dm-acc .woocommerce-MyAccount-content form :is(.form-row-first, .form-row-last) { flex: 1 1 calc(50% - 7px); min-width: 200px; }
.dx .dm-acc .woocommerce-MyAccount-content form.edit-account { display: flex; flex-wrap: wrap; gap: 0 14px; }
.dx .dm-acc .woocommerce-MyAccount-content form.edit-account > .clear { display: none; }
.dx .dm-acc .woocommerce-MyAccount-content fieldset { flex: 1 1 100%; border: 1px solid var(--dm-border); border-radius: 18px; padding: 18px; margin: 8px 0 18px; }
.dx .dm-acc .woocommerce-MyAccount-content legend { font-weight: 700; padding: 0 6px; }
.dx .dm-acc .woocommerce-MyAccount-content em { display: block; font-size: 13px; color: var(--dm-muted); margin-block-start: 6px; font-style: normal; }
.dx .dm-acc .woocommerce-pagination { display: flex; gap: 8px; margin-block-start: 16px; }
.dx .dm-acc .woocommerce-MyAccount-content .woocommerce-info { margin-block-end: 0; }
/* Order status + view-order summary line */
.dx .dm-acc .woocommerce-orders-table__cell-order-status { color: var(--dm-text-2); }
.dx .dm-acc .woocommerce-orders-table td.woocommerce-orders-table__cell-order-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.dx .dm-acc .woocommerce-orders-table td.woocommerce-orders-table__cell-order-actions .button { margin: 0; }
.dx .dm-acc .woocommerce-MyAccount-content > p:has(mark.order-status) { font-size: 15px; }

@media (max-width: 820px) {
	.dx .dm-acc .woocommerce:has(.woocommerce-MyAccount-navigation) { grid-template-columns: minmax(0, 1fr); gap: 18px; }
	.dx .dm-acc .woocommerce-MyAccount-navigation { position: static; margin-inline: calc(-1 * clamp(16px, 3vw, 32px)); }
	.dx .dm-acc .woocommerce-MyAccount-navigation ul { display: flex; gap: 8px; overflow-x: auto; padding-inline: clamp(16px, 3vw, 32px); padding-block-end: 4px; scrollbar-width: none; }
	.dx .dm-acc .woocommerce-MyAccount-navigation ul::-webkit-scrollbar { display: none; }
	.dx .dm-acc .woocommerce-MyAccount-navigation a { white-space: nowrap; min-height: 44px; border-radius: 999px; }
	.dx .dm-acc__hero { border-radius: 24px; }
}
@media (max-width: 768px) {
	/* woocommerce-smallscreen.css turns these tables into labelled rows; keep them on the card ground. */
	.dx .dm-acc table.shop_table_responsive tr { border-block-end: 1px solid var(--dm-border); padding-block: 8px; }
	.dx .dm-acc table.shop_table_responsive tr td { border: 0; padding: 6px 0; background: none; }
	.dx .dm-acc table.shop_table_responsive tr:nth-child(2n) td { background: none; }
	/* WooCommerce hides the row-header cell (order number) on phones. */
	.dx .dm-acc table.shop_table_responsive tbody th { display: block; padding: 6px 0; border: 0; font-weight: 700; text-align: start; }
}

/* Guest lost-password endpoint (/my-account/lost-password/) */
.dx .dm-acc form.lost_reset_password { max-width: 460px; background: var(--dm-card); border: 1px solid var(--dm-border); border-radius: 22px; padding: 24px; }
.dx .dm-acc form.lost_reset_password .form-row { width: 100%; float: none; }
.dx .dm-acc form.lost_reset_password > p:first-child { margin-block-end: 14px; color: var(--dm-text-2); }

/* ---------- SIGN IN (Theme My Login) ---------- */
.dx .dm-auth { display: grid; place-items: start center; }
.dx .dm-auth__card { width: min(100%, 480px); background: var(--dm-card); border: 1px solid var(--dm-border); border-radius: 26px; padding: clamp(24px, 4vw, 40px); box-shadow: 0 18px 50px var(--dm-shadow-soft); }
.dx .dm-auth .dx-k { margin-block-end: 8px; }
.dx .dm-auth .dx-h1 { font-size: clamp(28px, 3vw, 38px); }
.dx .dm-auth__lead { color: var(--dm-text-2); margin-block-start: 8px; line-height: 1.6; }
.dx .dm-auth .tml { margin-block-start: 22px; max-width: none; }
.dx .dm-auth .tml form { display: grid; gap: 16px; }
.dx .dm-auth .tml-field-wrap { margin: 0; }
.dx .dm-auth .tml-label { display: block; font-size: 14px; font-weight: 600; margin-block-end: 6px; color: var(--dm-text); }
.dx .dm-auth .tml-field { width: 100%; min-height: 50px; margin: 0; padding: 10px 14px; background: var(--dm-card); color: var(--dm-text); border: 1px solid var(--dm-hover-rule); border-radius: 12px; font-size: 15px; box-shadow: none; }
.dx .dm-auth .tml-field:focus { border-color: var(--dm-text); outline: 2px solid var(--dm-text); outline-offset: 0; }
.dx .dm-auth .tml-pwd { position: relative; display: block; }
.dx .dm-auth .tml-pwd .tml-field { padding-inline-end: 52px; }
/* TML pins the eye button with physical right:0 / width:auto … !important, which stretches it across the field in RTL. */
.dx .dm-auth .tml-toggle-pwd {
	inset-inline-end: 3px !important; inset-inline-start: auto !important; width: 44px !important; height: 44px !important; padding: 0 !important;
	display: grid !important; place-items: center; border-radius: 10px; color: var(--dm-muted);
}
.dx .dm-auth .tml-toggle-pwd:hover { color: var(--dm-text); background: var(--dm-subtle) !important; }
.dx .dm-auth .tml-toggle-pwd .dashicons { font-size: 20px; width: 20px; height: 20px; }
.dx .dm-auth .tml-rememberme-wrap { display: flex; align-items: center; gap: 8px; }
.dx .dm-auth .tml-rememberme-wrap .tml-label { margin: 0; font-weight: 500; display: inline; }
.dx .dm-auth .tml-checkbox { accent-color: var(--dm-text); width: 18px; height: 18px; margin: 0; }
.dx .dm-auth .g-recaptcha { min-height: 70px; }
.dx .dm-auth .tml-message-wrap .tml-message { color: var(--dm-text-2); line-height: 1.6; margin: 0; padding: 0; background: none; border: 0; box-shadow: none; }
.dx .dm-auth .tml-description, .dx .dm-auth .tml-indicator-wrap, .dx .dm-auth .indicator-hint { font-size: 13px; color: var(--dm-muted); }
.dx .dm-auth .tml-button {
	width: 100%; min-height: 52px; margin: 0; padding: 0 24px; border: 0; border-radius: 999px;
	background: var(--dm-btn-bg); color: var(--dm-btn-text); font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s;
}
.dx .dm-auth .tml-button:hover { background: var(--dm-btn-hover-bg); color: var(--dm-btn-hover-text); }
.dx .dm-auth .tml .tml-submit-wrap button.dm-loading::after { border-color: var(--dm-muted); border-top-color: var(--dm-btn-text); }
.dx .dm-auth .tml-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; margin: 20px 0 0; padding: 18px 0 0; border-block-start: 1px solid var(--dm-border); list-style: none; font-size: 14px; }
.dx .dm-auth .tml-links a { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.dx .dm-auth .tml-alerts:empty { display: none; }
.dx .dm-auth .tml-alerts { margin: 0; }
.dx .dm-auth .tml-alerts :is(.tml-error, .tml-message, .tml-success) { padding: 12px 14px; border-radius: 12px; background: var(--dm-surface); border: 1px solid var(--dm-border); border-inline-start: 4px solid var(--dm-hover-rule); font-size: 14px; margin: 0 0 4px; color: var(--dm-text); box-shadow: none; }
.dx .dm-auth .tml-alerts .tml-error { border-inline-start-color: var(--dm-accent); }
.dx .dm-auth .tml-alerts .tml-success { border-inline-start-color: var(--dm-ok); }
