/**
 * ECB Commerce Core — component styles.
 *
 * Reuses the child theme's design tokens where they exist, with fallbacks so
 * the plugin still renders correctly if it is ever used with another theme.
 * Status is never conveyed by colour alone: every state also carries an icon,
 * a text label and screen-reader text.
 */

:root {
	--ecb-cc-plum: var(--ecb-plum, #4A1834);
	--ecb-cc-gold: var(--ecb-gold, #C5A060);
	--ecb-cc-ivory: var(--ecb-ivory, #FBF8F3);
	--ecb-cc-charcoal: var(--ecb-charcoal, #211E20);
	--ecb-cc-muted: var(--ecb-muted, #75606A);
	--ecb-cc-line: rgba(74, 24, 52, .16);
	/* M6: the child theme owns the radius ladder; these stay only as
	   standalone fallbacks for use with another theme. */
	--ecb-cc-radius: var(--ecb-radius-ctl, 10px);
}

/* ------------------------------------------------------------------ bKash */

.ecb-bkash {
	margin: 2rem 0;
	padding: 1.5rem;
	border: 1px solid var(--ecb-cc-line);
	border-radius: var(--ecb-cc-radius);
	background: var(--ecb-cc-ivory);
}

.ecb-bkash__title {
	margin: 0 0 1rem;
	font-size: 1.15rem;
	color: var(--ecb-cc-plum);
}

.ecb-bkash__amount { font-size: 1.05rem; }

.ecb-bkash__warn {
	padding: .75rem 1rem;
	border-left: 4px solid var(--ecb-cc-gold);
	background: #fff;
	border-radius: 0 6px 6px 0;
}

.ecb-bkash__merchant strong { letter-spacing: .04em; }
.ecb-bkash__merchant-label { color: var(--ecb-cc-muted); }

.ecb-bkash__qr img {
	max-width: 220px;
	height: auto;
	border: 1px solid var(--ecb-cc-line);
	border-radius: 8px;
	background: #fff;
	padding: .5rem;
}

.ecb-bkash__bn { color: var(--ecb-cc-charcoal); }

.ecb-bkash__never {
	margin-top: 1rem;
	font-size: .875rem;
	color: var(--ecb-cc-muted);
}

.ecb-bkash__status {
	padding: .85rem 1rem;
	border-radius: 8px;
	font-weight: 600;
}
.ecb-bkash__status--ok { background: #e3f4e9; color: #1f6b3a; }
.ecb-bkash__status--pending { background: #e3edfa; color: #1d4e89; }
.ecb-bkash__status-bn { color: var(--ecb-cc-muted); }

.ecb-bkash__error {
	margin: 0 0 1rem;
	padding: .85rem 1rem;
	border-radius: 8px;
	background: #fdecea;
	color: #8a1f1a;
	border: 1px solid #f2c2be;
}

.ecb-bkash__form { margin-top: 1.25rem; }
.ecb-bkash__field { margin: 0 0 1rem; display: flex; flex-direction: column; }
.ecb-bkash__field label { font-weight: 600; margin-bottom: .35rem; }
.ecb-bkash__field input {
	padding: .7rem .8rem;
	border: 1px solid var(--ecb-cc-line);
	border-radius: 8px;
	font-size: 1rem;
	background: #fff;
}
.ecb-bkash__field input:focus-visible {
	outline: 2px solid var(--ecb-cc-plum);
	outline-offset: 1px;
}
.ecb-bkash__hint { font-size: .85rem; color: var(--ecb-cc-muted); margin-top: .3rem; }

/* ----------------------------------------------------------------- lookup */

.ecb-lookup__form {
	margin: 1.5rem 0;
	padding: 1.5rem;
	border: 1px solid var(--ecb-cc-line);
	border-radius: var(--ecb-cc-radius);
	background: #fff;
}
.ecb-lookup__field { margin: 0 0 1rem; display: flex; flex-direction: column; }
.ecb-lookup__field label { font-weight: 600; margin-bottom: .35rem; }
.ecb-lookup__field input {
	padding: .7rem .8rem;
	border: 1px solid var(--ecb-cc-line);
	border-radius: 8px;
	font-size: 1rem;
}
.ecb-lookup__hint { font-size: .85rem; color: var(--ecb-cc-muted); margin-top: .3rem; }

.ecb-lookup__error {
	margin: 0 0 1.25rem;
	padding: 1rem 1.15rem;
	border-radius: var(--ecb-cc-radius);
	background: #fdecea;
	color: #8a1f1a;
	border: 1px solid #f2c2be;
}

/* ------------------------------------------------------------ status card */

.ecb-card {
	--tone: var(--ecb-cc-plum);
	--tone-soft: #f3e7ef;
	margin: 0 0 1.5rem;
	padding: 1.5rem;
	border: 1px solid var(--ecb-cc-line);
	border-top: 4px solid var(--tone);
	border-radius: var(--ecb-cc-radius);
	background: #fff;
}

.ecb-card--wait  { --tone: #a8690a; --tone-soft: #fdf1dc; }
.ecb-card--check { --tone: #1d4e89; --tone-soft: #e3edfa; }
.ecb-card--ok    { --tone: #1f6b3a; --tone-soft: #e3f4e9; }
.ecb-card--ship  { --tone: #4a1834; --tone-soft: #f3e7ef; }
.ecb-card--done  { --tone: #14663a; --tone-soft: #dff3e6; }
.ecb-card--stop  { --tone: #8a1f1a; --tone-soft: #fdecea; }

.ecb-card__head { margin-bottom: .9rem; }

.ecb-card__badge {
	display: inline-flex;
	align-items: center;
	gap: .5rem;
	padding: .4rem .85rem;
	border-radius: 999px;
	background: var(--tone-soft);
	color: var(--tone);
	font-weight: 700;
	font-size: .9rem;
	border: 1px solid color-mix(in srgb, var(--tone) 25%, transparent);
}
.ecb-card__icon { font-size: 1rem; line-height: 1; }

.ecb-card__sentence { margin: 0 0 .35rem; font-size: 1.05rem; }
.ecb-card__sentence-bn { margin: 0 0 1rem; color: var(--ecb-cc-muted); }

/* progress */
.ecb-progress {
	list-style: none;
	margin: 1.25rem 0 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: .25rem;
}
.ecb-progress__step {
	position: relative;
	padding-top: 1.4rem;
	text-align: center;
	font-size: .78rem;
	color: var(--ecb-cc-muted);
}
/* connector */
.ecb-progress__step::before {
	content: "";
	position: absolute;
	top: .43rem;
	left: 0;
	right: 0;
	height: 2px;
	background: var(--ecb-cc-line);
}
.ecb-progress__step:first-child::before { left: 50%; }
.ecb-progress__step:last-child::before { right: 50%; }

.ecb-progress__dot {
	position: absolute;
	top: 0;
	left: 50%;
	transform: translateX(-50%);
	width: .9rem;
	height: .9rem;
	border-radius: 50%;
	background: #fff;
	border: 2px solid var(--ecb-cc-line);
}
.ecb-progress__step.is-done .ecb-progress__dot,
.ecb-progress__step.is-current .ecb-progress__dot {
	background: var(--tone);
	border-color: var(--tone);
}
.ecb-progress__step.is-done::before { background: var(--tone); }
.ecb-progress__step.is-current .ecb-progress__label { color: var(--tone); font-weight: 700; }
/* Current step also gets a ring, so the "you are here" cue is not colour-only. */
.ecb-progress__step.is-current .ecb-progress__dot {
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--tone) 25%, transparent);
}

.ecb-card__facts {
	margin: 1.35rem 0 0;
	padding: 1rem 0 0;
	border-top: 1px solid var(--ecb-cc-line);
	display: grid;
	gap: .6rem;
}
.ecb-card__fact { display: flex; justify-content: space-between; gap: 1rem; }
.ecb-card__fact dt { color: var(--ecb-cc-muted); margin: 0; }
.ecb-card__fact dd { margin: 0; font-weight: 600; text-align: right; }

.ecb-card__cta { margin: 1.25rem 0 0; }

/* checkout */
.ecb-delivery-district.ecb-district-unset select { border-color: var(--ecb-cc-gold); }
.ecb-bkash-advance-hint { margin: .5rem 0 0; font-size: .9rem; }

/* ------------------------------------------------------------ responsive */

@media (max-width: 640px) {
	.ecb-bkash, .ecb-lookup__form, .ecb-card { padding: 1.15rem; }

	.ecb-progress {
		grid-template-columns: 1fr;
		gap: 0;
	}
	.ecb-progress__step {
		padding: .45rem 0 .45rem 1.75rem;
		text-align: left;
	}
	/* vertical connector on narrow screens */
	.ecb-progress__step::before {
		top: 0;
		bottom: 0;
		left: .43rem;
		right: auto;
		width: 2px;
		height: auto;
	}
	.ecb-progress__step:first-child::before { top: 50%; left: .43rem; }
	.ecb-progress__step:last-child::before { bottom: 50%; top: 0; }
	.ecb-progress__dot { top: 50%; left: .43rem; transform: translate(-50%, -50%); }

	.ecb-card__fact { flex-direction: column; gap: .15rem; }
	.ecb-card__fact dd { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
	.ecb-card, .ecb-progress__step { transition: none !important; }
}

/* ==========================================================================
   M2 — signed amounts, savings, coupon, totals
   ========================================================================== */

/* Signed amounts. The sign is a real character in the DOM, so meaning never
   depends on colour alone; the colour is a secondary cue only. */
.ecb-amt { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ecb-amt__sign { font-weight: 700; }
.ecb-amt--plus  { color: var(--ecb-cc-charcoal); }
.ecb-amt--minus { color: #1f6b3a; }

@media (forced-colors: active) {
	.ecb-amt--plus, .ecb-amt--minus { color: CanvasText; }
}

/* Totals rows */
.woocommerce-cart-form + .cart-collaterals .order-total th,
.shop_table .order-total th,
.shop_table .order-total td { font-size: 1.05em; }

.shop_table .cart-subtotal th,
.shop_table .woocommerce-shipping-totals th,
.shop_table .cart-discount th { font-weight: 500; }

.shop_table .cart-discount td,
.shop_table .woocommerce-shipping-totals td { font-variant-numeric: tabular-nums; }

/* the shipping row now holds only an amount, so right-align it like the rest */
.woocommerce-shipping-totals .woocommerce-shipping-methods,
.woocommerce-shipping-totals ul#shipping_method {
	list-style: none;
	margin: 0;
	padding: 0;
}
.woocommerce-shipping-totals ul#shipping_method li { margin: 0; padding: 0; }

/* Savings */
.ecb-savings-row th {
	padding-top: .85rem !important;
	border-top: 1px dashed var(--ecb-cc-line);
}
.ecb-savings {
	display: inline-flex;
	align-items: center;
	gap: .45rem;
	padding: .35rem .75rem;
	border-radius: 999px;
	background: #e3f4e9;
	color: #1f6b3a;
	font-weight: 600;
	font-size: .92rem;
}
.ecb-savings::before {
	content: "\2713";
	font-weight: 700;
}

/* Coupon */
.ecb-coupon-prompt {
	margin: 0 0 1rem;
	padding: .7rem .9rem;
	border-left: 3px solid var(--ecb-cc-gold);
	background: var(--ecb-cc-ivory);
	font-size: .92rem;
	color: var(--ecb-cc-muted);
}

.coupon .input-text,
.checkout_coupon .input-text {
	padding: .65rem .8rem;
	border: 1px solid var(--ecb-cc-line);
	border-radius: 8px;
}

.ecb-coupon-remove {
	margin-left: .5rem;
	font-size: .82rem;
	text-decoration: underline;
	color: var(--ecb-cc-muted);
}
.ecb-coupon-remove:hover,
.ecb-coupon-remove:focus-visible { color: #8a1f1a; }

/* Reserve the discount row's height so applying a coupon does not jolt the
   page; the row appears in space that was already accounted for. */
.woocommerce-checkout-review-order-table { contain: layout style; }

@media (max-width: 640px) {
	.ecb-savings { width: 100%; justify-content: center; }
	.shop_table .cart-discount td,
	.shop_table .woocommerce-shipping-totals td { text-align: right; }
}

/* ==========================================================================
   M4 — premium order summary, totals, coupon and payment cards

   Presentation only. Every figure still comes from WooCommerce; nothing here
   changes a calculation, a hook or the semantic table/form structure that
   assistive technology relies on.
   ========================================================================== */

:root {
	--ecb-cc-radius-card: var(--ecb-radius-card, 16px);
	--ecb-cc-radius-ctl: var(--ecb-radius-ctl, 10px);
	--ecb-cc-surface: #FFFFFF;
	--ecb-cc-surface-2: var(--ecb-cc-ivory, #FBF8F3);
	--ecb-cc-border: rgba(74, 24, 52, .14);
	--ecb-cc-border-strong: rgba(74, 24, 52, .28);
	--ecb-cc-shadow: var(--ecb-shadow-md, 0 4px 16px rgba(74, 24, 52, .07));
	--ecb-cc-pos: #7a4a00;   /* addition — paired with a "+" glyph, never alone */
	--ecb-cc-neg: #1f6b3a;   /* deduction — paired with a "−" glyph */
}

/* ---------------------------------------------------------------- the card */

.ecb-summary {
	position: relative;
	padding: clamp(1.25rem, 3vw, 1.9rem);
	background: var(--ecb-cc-surface);
	border: 1px solid var(--ecb-cc-border);
	border-radius: var(--ecb-cc-radius-card);
	box-shadow: var(--ecb-cc-shadow);
}

/* The heading WooCommerce prints inside the card. */
.ecb-summary #order_review_heading,
#order_review_heading {
	margin: 0 0 1.15rem;
	padding-bottom: .85rem;
	border-bottom: 1px solid var(--ecb-cc-border);
	font-size: clamp(1.05rem, 2vw, 1.25rem);
	letter-spacing: .01em;
	color: var(--ecb-cc-plum);
}

.ecb-summary #order_review,
.ecb-summary .woocommerce-checkout-review-order {
	margin: 0;
}

/* ------------------------------------------------------- the summary table */

.woocommerce-checkout-review-order-table {
	width: 100%;
	margin: 0;
	border-collapse: collapse;
	table-layout: auto;
}

.woocommerce-checkout-review-order-table thead th {
	padding: 0 0 .6rem;
	border-bottom: 1px solid var(--ecb-cc-border);
	font-size: .72rem;
	font-weight: 600;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--ecb-cc-muted);
}

.woocommerce-checkout-review-order-table thead th.product-name { text-align: left; }
.woocommerce-checkout-review-order-table thead th.product-total { text-align: right; }

/* ---- product rows ---- */

.woocommerce-checkout-review-order-table tbody td {
	padding: .95rem 0;
	border-bottom: 1px solid var(--ecb-cc-border);
	vertical-align: top;
}

.woocommerce-checkout-review-order-table tbody td.product-total {
	text-align: right;
	white-space: nowrap;
	width: 1%;
	padding-left: 1rem;
	font-variant-numeric: tabular-nums;
	font-weight: 600;
	color: var(--ecb-cc-charcoal);
}

.ecb-summary__item {
	display: flex;
	align-items: flex-start;
	gap: .85rem;
}

.ecb-summary__thumb {
	flex: 0 0 auto;
	width: 56px;
	height: 70px;
	overflow: hidden;
	border-radius: 8px;
	background: var(--ecb-cc-surface-2);
	border: 1px solid var(--ecb-cc-border);
}

.ecb-summary__thumb-img,
.ecb-summary__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center top;
}

.ecb-summary__meta {
	display: flex;
	flex-direction: column;
	gap: .28rem;
	min-width: 0;
}

.ecb-summary__name {
	font-weight: 500;
	line-height: 1.35;
	color: var(--ecb-cc-charcoal);
}

.ecb-summary__name a {
	color: inherit;
	text-decoration: none;
	border-bottom: 1px solid transparent;
}

.ecb-summary__name a:hover,
.ecb-summary__name a:focus-visible {
	border-bottom-color: var(--ecb-cc-gold);
}

/* Variation / item meta sits beneath the name, quieter than it. */
.ecb-summary__variation,
.ecb-summary__variation .wc-item-meta,
.ecb-summary__variation dl.variation {
	margin: 0;
	font-size: .84rem;
	line-height: 1.45;
	color: var(--ecb-cc-muted);
}

.ecb-summary__variation dl.variation dt,
.ecb-summary__variation dl.variation dd,
.ecb-summary__variation .wc-item-meta li {
	display: inline;
	margin: 0;
	font-weight: 400;
}

.ecb-summary__variation dl.variation dd { margin-right: .5rem; }
.ecb-summary__variation p { margin: 0; }

.ecb-summary__qty {
	align-self: flex-start;
	margin-top: .1rem;
	padding: .12rem .5rem;
	border-radius: 999px;
	background: var(--ecb-cc-surface-2);
	border: 1px solid var(--ecb-cc-border);
	font-size: .78rem;
	font-weight: 600;
	color: var(--ecb-cc-muted);
	white-space: nowrap;
}

/* ---- totals ---- */

.woocommerce-checkout-review-order-table tfoot th,
.woocommerce-checkout-review-order-table tfoot td {
	padding: .6rem 0;
	border: 0;
	font-weight: 400;
}

.woocommerce-checkout-review-order-table tfoot th {
	text-align: left;
	color: var(--ecb-cc-muted);
	font-weight: 500;
}

/* Shrink the value column to its content so amounts sit hard against the
   right edge no matter how long the label beside them runs. */
.woocommerce-checkout-review-order-table tfoot td {
	text-align: right;
	white-space: nowrap;
	width: 1%;
	padding-left: 1rem;
	font-variant-numeric: tabular-nums;
	color: var(--ecb-cc-charcoal);
	font-weight: 600;
}

.woocommerce-checkout-review-order-table tfoot tr:first-child th,
.woocommerce-checkout-review-order-table tfoot tr:first-child td {
	padding-top: 1rem;
}

.ecb-amt--plus  { color: var(--ecb-cc-pos); }
.ecb-amt--minus { color: var(--ecb-cc-neg); }

/* ---- total emphasis ---- */

.woocommerce-checkout-review-order-table tfoot tr.order-total th,
.woocommerce-checkout-review-order-table tfoot tr.order-total td,
.cart_totals tr.order-total th,
.cart_totals tr.order-total td {
	padding-top: .95rem;
	padding-bottom: .95rem;
	border-top: 1px solid var(--ecb-cc-border-strong);
	background: linear-gradient(0deg, rgba(74, 24, 52, .045), rgba(74, 24, 52, .045));
	color: var(--ecb-cc-plum);
	font-weight: 700;
}

.woocommerce-checkout-review-order-table tfoot tr.order-total th,
.cart_totals tr.order-total th {
	border-radius: var(--ecb-cc-radius-ctl) 0 0 var(--ecb-cc-radius-ctl);
	padding-left: .8rem;
	font-size: .95rem;
	letter-spacing: .02em;
}

.woocommerce-checkout-review-order-table tfoot tr.order-total td,
.cart_totals tr.order-total td {
	border-radius: 0 var(--ecb-cc-radius-ctl) var(--ecb-cc-radius-ctl) 0;
	padding-right: .8rem;
	font-size: 1.15rem;
}

.woocommerce-checkout-review-order-table tfoot tr.order-total .woocommerce-Price-amount,
.cart_totals tr.order-total .woocommerce-Price-amount { font-weight: 700; }

/* ---- savings pill ---- */

.ecb-savings-row th {
	padding: .7rem 0 0 !important;
	border: 0 !important;
	text-align: center !important;
	background: none !important;
}

/* ---- payment breakdown ---- */

.ecb-paybreak-row td {
	padding: .9rem 0 0 !important;
	border: 0 !important;
	background: none !important;
}

.ecb-paybreak {
	padding: .85rem 1rem;
	border: 1px dashed var(--ecb-cc-border-strong);
	border-radius: var(--ecb-cc-radius-ctl);
	background: var(--ecb-cc-surface-2);
}

.ecb-paybreak__row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
}

.ecb-paybreak__row + .ecb-paybreak__row {
	margin-top: .45rem;
	padding-top: .45rem;
	border-top: 1px solid var(--ecb-cc-border);
}

.ecb-paybreak__label { color: var(--ecb-cc-muted); font-size: .92rem; }

.ecb-paybreak__value {
	font-weight: 700;
	color: var(--ecb-cc-plum);
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

/* ----------------------------------------------------------------- coupon */

.checkout_coupon,
.woocommerce-form-coupon {
	margin: 0 0 1.25rem;
	padding: 1rem;
	border: 1px solid var(--ecb-cc-border);
	border-radius: var(--ecb-cc-radius-ctl);
	background: var(--ecb-cc-surface-2);
}

.checkout_coupon .form-row,
.woocommerce-form-coupon .form-row { margin: 0; }

.checkout_coupon p:first-child,
.woocommerce-form-coupon p:first-child { margin-top: 0; }

.woocommerce-form-coupon-toggle .woocommerce-info {
	margin: 0 0 1rem;
	padding: .7rem 1rem;
	border: 1px solid var(--ecb-cc-border);
	border-left: 3px solid var(--ecb-cc-gold);
	border-radius: var(--ecb-cc-radius-ctl);
	background: var(--ecb-cc-surface-2);
	color: var(--ecb-cc-charcoal);
	font-size: .92rem;
}

.woocommerce-form-coupon-toggle .woocommerce-info::before { display: none; }

/* Applied coupon reads as a removable chip. */
tr.cart-discount th {
	color: var(--ecb-cc-neg) !important;
	font-weight: 600 !important;
}

.ecb-coupon-remove {
	display: inline-block;
	margin-left: .5rem;
	padding: .05rem .45rem;
	border-radius: 999px;
	border: 1px solid var(--ecb-cc-border);
	background: var(--ecb-cc-surface);
	font-size: .74rem;
	line-height: 1.6;
	text-decoration: none;
	color: var(--ecb-cc-muted);
}

.ecb-coupon-remove:hover,
.ecb-coupon-remove:focus-visible {
	color: #8a1f1a;
	border-color: #e3b6b2;
}

/* -------------------------------------------------------- payment methods */

#payment,
.woocommerce-checkout #payment {
	margin-top: 1.35rem;
	padding: 0;
	background: none;
	border-radius: 0;
}

#payment ul.payment_methods {
	margin: 0 0 1rem;
	padding: 0;
	list-style: none;
	border: 0;
	display: grid;
	gap: .6rem;
}

#payment ul.payment_methods li {
	margin: 0;
	padding: .9rem 1rem;
	border: 1px solid var(--ecb-cc-border);
	border-radius: var(--ecb-cc-radius-ctl);
	background: var(--ecb-cc-surface);
	transition: border-color .18s ease, background-color .18s ease;
}

#payment ul.payment_methods li:hover { border-color: var(--ecb-cc-border-strong); }

/* Selected state: border + tint + weight, so it does not depend on colour. */
#payment ul.payment_methods li:has(input[type="radio"]:checked) {
	border-color: var(--ecb-cc-plum);
	background: var(--ecb-cc-surface-2);
	box-shadow: inset 0 0 0 1px var(--ecb-cc-plum);
}

#payment ul.payment_methods li:has(input[type="radio"]:checked) label {
	font-weight: 700;
	color: var(--ecb-cc-plum);
}

#payment ul.payment_methods li input[type="radio"] {
	margin: 0 .55rem 0 0;
	accent-color: var(--ecb-cc-plum);
	width: 1rem;
	height: 1rem;
	vertical-align: -2px;
}

#payment ul.payment_methods li label {
	display: inline;
	font-weight: 500;
	color: var(--ecb-cc-charcoal);
	cursor: pointer;
}

#payment ul.payment_methods li img { max-height: 24px; margin-left: .5rem; vertical-align: middle; }

/* Description: tight, and gone entirely when empty — no dead space. */
#payment div.payment_box {
	margin: .6rem 0 0;
	padding: .65rem .8rem;
	border-radius: 8px;
	background: var(--ecb-cc-surface-2);
	color: var(--ecb-cc-muted);
	font-size: .88rem;
	line-height: 1.5;
}

#payment div.payment_box::before { display: none; }
#payment div.payment_box p:last-child { margin-bottom: 0; }
#payment div.payment_box:empty { display: none; margin: 0; padding: 0; }

#payment .place-order { padding: 0; margin-top: 1rem; }
#payment .woocommerce-terms-and-conditions-wrapper { margin-bottom: .75rem; }

/* ------------------------------------------------- consistent surfaces */

.cart_totals,
.woocommerce-order-details,
.woocommerce-column--order-details,
.woocommerce-customer-details {
	padding: clamp(1.1rem, 2.5vw, 1.5rem);
	background: var(--ecb-cc-surface);
	border: 1px solid var(--ecb-cc-border);
	border-radius: var(--ecb-cc-radius-card);
	box-shadow: var(--ecb-cc-shadow);
}

.cart_totals h2,
.woocommerce-order-details h2,
.woocommerce-column--order-details h2 {
	margin-top: 0;
	padding-bottom: .7rem;
	border-bottom: 1px solid var(--ecb-cc-border);
	font-size: 1.1rem;
	color: var(--ecb-cc-plum);
}

.woocommerce-table--order-details tfoot th {
	text-align: left;
	font-weight: 500;
	color: var(--ecb-cc-muted);
}

.woocommerce-table--order-details tfoot td {
	text-align: right;
	white-space: nowrap;
	width: 1%;
	font-variant-numeric: tabular-nums;
	font-weight: 600;
}

.woocommerce-table--order-details tfoot tr:last-child th,
.woocommerce-table--order-details tfoot tr:last-child td {
	padding-top: .8rem;
	border-top: 1px solid var(--ecb-cc-border-strong);
	color: var(--ecb-cc-plum);
	font-weight: 700;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 782px) {
	.ecb-summary { border-radius: 14px; padding: 1.15rem; }

	.woocommerce-checkout-review-order-table tbody td { padding: .8rem 0; }

	.ecb-summary__thumb { width: 48px; height: 60px; }

	/* Labels and values must never collide; let long labels wrap while the
	   amount stays on its own line, still right-aligned and still adjacent. */
	.woocommerce-checkout-review-order-table tfoot th { padding-right: .5rem; }
	.woocommerce-checkout-review-order-table tfoot td { padding-left: .5rem; }

	#payment ul.payment_methods li { padding: .8rem .9rem; }
	#payment .button, .checkout_coupon .button { min-height: 44px; }

	.cart_totals, .woocommerce-order-details,
	.woocommerce-column--order-details, .woocommerce-customer-details {
		border-radius: 14px;
	}
}

@media (max-width: 420px) {
	.ecb-paybreak__row { flex-direction: column; align-items: flex-start; gap: .15rem; }
	.ecb-paybreak__row + .ecb-paybreak__row { margin-top: .6rem; padding-top: .6rem; }
}

/* --------------------------------------------------------- accessibility */

.ecb-summary a:focus-visible,
.ecb-summary button:focus-visible,
.ecb-summary input:focus-visible,
#payment input[type="radio"]:focus-visible,
#payment label:focus-visible,
.ecb-coupon-remove:focus-visible,
.checkout_coupon input:focus-visible,
.checkout_coupon button:focus-visible {
	outline: 2px solid var(--ecb-cc-plum);
	outline-offset: 2px;
	border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
	#payment ul.payment_methods li,
	.ecb-summary__name a { transition: none; }
}

@media (forced-colors: active) {
	.ecb-summary,
	#payment ul.payment_methods li,
	.ecb-paybreak { border: 1px solid CanvasText; }
	.ecb-amt--plus, .ecb-amt--minus,
	.ecb-paybreak__value { color: CanvasText; }
}

/* Older engines without :has() still get a usable selected state. */
@supports not (selector(:has(*))) {
	#payment ul.payment_methods li { border-left: 3px solid var(--ecb-cc-border); }
}

/* Variation attributes split out of the product title. */
.ecb-summary__attrs {
	display: block;
	font-size: .84rem;
	line-height: 1.45;
	color: var(--ecb-cc-muted);
}

/* ==========================================================================
   M6 — visible savings on the line, and a repaired cart totals block
   ========================================================================== */

/* ---- was / now / save ---------------------------------------------------
   Shown only where WooCommerce reports a genuine sale. <del> and <ins> carry
   the meaning semantically and each is prefixed with screen-reader text, so
   the saving is never conveyed by the strike-through alone.               */

.ecb-price {
	display: inline-flex;
	flex-direction: column;
	align-items: flex-end;
	gap: .1rem;
	line-height: 1.35;
}

.ecb-price__was {
	text-decoration: line-through;
	text-decoration-thickness: 1px;
	opacity: .7;
	font-size: .82em;
	font-weight: 400;
	color: var(--ecb-cc-muted);
}

.ecb-price__now {
	text-decoration: none;
	font-weight: 700;
	color: var(--ecb-cc-charcoal);
}

.ecb-price__save {
	margin-top: .1rem;
	padding: .1rem .45rem;
	border-radius: 999px;
	background: #e3f4e9;
	color: #1f6b3a;
	font-size: .72em;
	font-weight: 700;
	letter-spacing: .01em;
	white-space: nowrap;
}

/* In the cart's product table the cell is wider, so let it read on one line. */
.woocommerce-cart-form .product-subtotal .ecb-price,
.woocommerce-table--order-details .ecb-price {
	flex-direction: row;
	align-items: baseline;
	gap: .45rem;
	flex-wrap: wrap;
	justify-content: flex-end;
}

@media (forced-colors: active) {
	.ecb-price__save { border: 1px solid CanvasText; }
}

/* ---- cart totals block --------------------------------------------------
   The cart totals table ships with .shop_table_responsive, whose rule
   `tbody td { display:block }` collapses the two columns into a stack. That
   is right for the wide line-item table on a phone, but here it turns a
   simple label/amount pair into a broken box. Restore the pairing.        */

.cart_totals table.shop_table {
	width: 100%;
	table-layout: auto;
	border-collapse: collapse;
}

.cart_totals table.shop_table tbody th,
.cart_totals table.shop_table tbody td {
	display: table-cell;          /* undo shop_table_responsive */
	padding: .65rem 0;
	border: 0;
	vertical-align: middle;
	background: none;             /* kill the stray tinted block */
}

.cart_totals table.shop_table tbody th {
	width: auto;
	text-align: left;
	font-weight: 500;
	color: var(--ecb-cc-muted);
	white-space: normal;
}

.cart_totals table.shop_table tbody td {
	width: 1%;
	text-align: right;
	white-space: nowrap;
	padding-left: 1rem;
	font-variant-numeric: tabular-nums;
	font-weight: 600;
	color: var(--ecb-cc-charcoal);
}

/* the responsive pseudo-label would duplicate the <th> */
.cart_totals table.shop_table tbody td::before { content: none !important; }

/* ---- cart shipping row (label + amount, then destination beneath) ---- */

.cart_totals .woocommerce-shipping-totals > td {
	display: block !important;
	width: auto !important;
	text-align: left !important;
	white-space: normal !important;
	padding-left: 0 !important;
}

.cart_totals .woocommerce-shipping-totals .ct-shipping-heading {
	display: inline-block;
	margin: 0;
	font-weight: 500;
	color: var(--ecb-cc-muted);
}

.cart_totals .woocommerce-shipping-totals ul#shipping_method {
	display: inline-block;
	float: right;
	margin: 0;
	padding: 0;
	list-style: none;
	text-align: right;
	font-variant-numeric: tabular-nums;
	font-weight: 600;
}

.cart_totals .woocommerce-shipping-totals ul#shipping_method li { margin: 0; padding: 0; }
.cart_totals .woocommerce-shipping-totals ul#shipping_method label { margin: 0; font-weight: 600; white-space: nowrap; }

/* Destination + "change address" drop below, full width and quieter, instead
   of competing with the amount for horizontal room. */
.cart_totals .woocommerce-shipping-destination {
	clear: both;
	display: block;
	margin: .5rem 0 0;
	padding-top: .5rem;
	border-top: 1px dashed var(--ecb-cc-line);
	font-size: .85rem;
	line-height: 1.5;
	color: var(--ecb-cc-muted);
	white-space: normal;
}

.cart_totals .woocommerce-shipping-destination strong { font-weight: 600; }

.cart_totals .shipping-calculator-button {
	display: inline-block;
	margin-top: .2rem;
	font-size: .85rem;
	color: var(--ecb-cc-plum);
	text-decoration: underline;
}

.cart_totals .shipping-calculator-form {
	margin-top: .6rem;
	padding-top: .6rem;
	border-top: 1px solid var(--ecb-cc-line);
}

/* total row keeps its emphasis inside the repaired table */
.cart_totals table.shop_table tbody tr.order-total th,
.cart_totals table.shop_table tbody tr.order-total td {
	padding-top: .95rem;
	padding-bottom: .95rem;
	border-top: 1px solid var(--ecb-cc-border-strong);
	background: rgba(74, 24, 52, .045);
	color: var(--ecb-cc-plum);
	font-weight: 700;
}

.cart_totals table.shop_table tbody tr.ecb-savings-row th {
	display: block !important;
	width: auto !important;
	text-align: center !important;
	background: none !important;
}

/* ---- WooCommerce's AJAX overlay must not sit on top of a totals row ---- */
.woocommerce-checkout-review-order .blockUI.blockOverlay,
.cart_totals .blockUI.blockOverlay {
	border-radius: var(--ecb-cc-radius-card);
}

.woocommerce-checkout-review-order-table .blockUI.blockOverlay,
.cart_totals table .blockUI.blockOverlay { display: none !important; }

@media (max-width: 640px) {
	.cart_totals .woocommerce-shipping-totals ul#shipping_method { float: none; display: block; margin-top: .3rem; text-align: left; }
	.cart_totals table.shop_table tbody th { padding-right: .5rem; }
	.ecb-price { align-items: flex-end; }
}

/* ==========================================================================
   M5.1 — quieter, more confident totals

   The theme styles every table.shop_table <th> as an 11px uppercase bold
   column heading. That is right for PRODUCT / QUANTITY / SUBTOTAL across the
   top of the basket, but it also caught the totals rows, so "PRODUCTS
   SUBTOTAL", "DELIVERY CHARGE" and "TOTAL" all shouted in a narrow column and
   wrapped. Column headings keep the treatment; totals labels read as plain
   sentence case, which is what makes a summary look composed rather than busy.
   ========================================================================== */

.cart_totals table.shop_table tbody th,
.woocommerce-checkout-review-order-table tfoot th,
.woocommerce-table--order-details tfoot th {
	font-family: inherit;
	font-size: .95rem;
	font-weight: 500;
	letter-spacing: 0;
	text-transform: none;
	color: var(--ecb-cc-muted);
	line-height: 1.4;
}

/* the emphasised final row stays emphatic, just not shouty */
.cart_totals table.shop_table tbody tr.order-total th,
.woocommerce-checkout-review-order-table tfoot tr.order-total th {
	font-size: 1rem;
	font-weight: 700;
	text-transform: none;
	letter-spacing: 0;
	color: var(--ecb-cc-plum);
}

/* Lighter than the earlier tinted band: a firm rule carries the emphasis and
   the number does the rest. */
.cart_totals table.shop_table tbody tr.order-total th,
.cart_totals table.shop_table tbody tr.order-total td,
.woocommerce-checkout-review-order-table tfoot tr.order-total th,
.woocommerce-checkout-review-order-table tfoot tr.order-total td {
	background: transparent;
	border-top: 2px solid var(--ecb-cc-border-strong);
	border-radius: 0;
	padding-left: 0;
	padding-right: 0;
}

.cart_totals table.shop_table tbody tr.order-total td,
.woocommerce-checkout-review-order-table tfoot tr.order-total td {
	font-size: 1.2rem;
	font-weight: 700;
	color: var(--ecb-cc-plum);
}

/* ---- savings: one compact line, never a three-line block ---- */

.ecb-savings-row th { padding: .6rem 0 0 !important; }

.ecb-savings {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	width: auto;
	max-width: 100%;
	padding: .3rem .7rem;
	font-size: .85rem;
	font-weight: 600;
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ecb-savings::before { font-size: .9em; }

/* ---- shipping destination: present, not dominant ---- */

.cart_totals .woocommerce-shipping-destination {
	font-size: .8rem;
	line-height: 1.45;
	font-weight: 400;
	color: var(--ecb-cc-muted);
}

.cart_totals .woocommerce-shipping-destination strong {
	font-weight: 500;
	color: var(--ecb-cc-muted);
}

.cart_totals .shipping-calculator-button {
	font-size: .8rem;
	font-weight: 500;
	text-decoration: underline;
	text-underline-offset: 2px;
	color: var(--ecb-cc-muted);
}

.cart_totals .shipping-calculator-button:hover,
.cart_totals .shipping-calculator-button:focus-visible { color: var(--ecb-cc-plum); }

/* ---- line price block: wrap gracefully in the basket's narrow column ---- */

.woocommerce-cart-form .product-subtotal .ecb-price {
	row-gap: .2rem;
}

.woocommerce-cart-form .product-subtotal .ecb-price__save {
	font-size: .7em;
}

@media (max-width: 480px) {
	.ecb-savings { white-space: normal; text-overflow: clip; }
	.cart_totals table.shop_table tbody th,
	.woocommerce-checkout-review-order-table tfoot th { font-size: .9rem; }
}

/* ==========================================================================
   Phase M9 — Manual bKash customer interface
   Built on the M6 theme tokens through the --ecb-cc-* aliases already defined
   at the top of this file. No new palette, no new radius scale, no !important.
   ========================================================================== */

/* ---- Checkout: the two payment choices ---------------------------------- */
.ecb-bkplan {
	display: grid;
	gap: .5rem;
	margin: .75rem 0;
}

.ecb-bkplan__card {
	display: flex;
	align-items: flex-start;
	gap: .7rem;
	padding: .8rem .9rem;
	border: 1px solid var(--ecb-cc-border);
	border-radius: var(--ecb-cc-radius-ctl);
	background: var(--ecb-cc-surface);
	cursor: pointer;
	transition: border-color 200ms ease, background-color 200ms ease;
}

.ecb-bkplan__card:hover {
	border-color: var(--ecb-cc-border-strong);
}

/* The card reflects the radio rather than replacing it: the input keeps its
   own focus ring and its own semantics for assistive technology. */
.ecb-bkplan__card:has(input:checked) {
	border-color: var(--ecb-cc-plum);
	background: var(--ecb-cc-surface-2);
}

.ecb-bkplan__card:has(input:focus-visible) {
	outline: 2px solid var(--ecb-cc-plum);
	outline-offset: 2px;
}

.ecb-bkplan__card input {
	margin: .2rem 0 0;
	flex: 0 0 auto;
	min-width: 18px;
	min-height: 18px;
}

.ecb-bkplan__body { display: block; width: 100%; }

.ecb-bkplan__head {
	display: block;
	font-weight: 500;
	color: var(--ecb-cc-charcoal);
	margin-bottom: .35rem;
}

/* "Pay now" against "on delivery", side by side, so the choice is a comparison
   rather than two separate claims the customer has to hold in their head. */
.ecb-bkplan__amounts {
	display: flex;
	flex-wrap: wrap;
	gap: .25rem 1.5rem;
}

.ecb-bkplan__now,
.ecb-bkplan__later { display: flex; flex-direction: column; }

.ecb-bkplan__lbl {
	font-size: .75rem;
	color: var(--ecb-cc-muted);
}

.ecb-bkplan__val {
	font-size: .95rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	color: var(--ecb-cc-charcoal);
}

.ecb-bkplan__now .ecb-bkplan__val { color: var(--ecb-cc-plum); }

.ecb-bkplan__note {
	font-size: .8rem;
	color: var(--ecb-cc-muted);
	margin: .25rem 0 .5rem;
}

/* ---- Order screen: amounts, merchant number, QR -------------------------- */
.ecb-bkpay {
	display: grid;
	gap: .1rem;
	margin: 0 0 1rem;
	padding: .75rem .9rem;
	border: 1px solid var(--ecb-cc-border);
	border-radius: var(--ecb-cc-radius-ctl);
	background: var(--ecb-cc-surface-2);
}

.ecb-bkpay__row {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: .25rem 0;
	font-size: .9rem;
}

.ecb-bkpay__lbl { color: var(--ecb-cc-muted); }
.ecb-bkpay__val { font-variant-numeric: tabular-nums; font-weight: 500; }

.ecb-bkpay__row--now .ecb-bkpay__val {
	color: var(--ecb-cc-plum);
	font-weight: 600;
	font-size: 1.05rem;
}

.ecb-bkmerch {
	display: grid;
	gap: .25rem;
	margin: 0 0 1rem;
}

.ecb-bkmerch__lbl {
	font-size: .75rem;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--ecb-cc-muted);
}

.ecb-bkmerch__row {
	display: flex;
	align-items: stretch;
	gap: .5rem;
	flex-wrap: wrap;
}

.ecb-bkmerch__num {
	flex: 1 1 auto;
	min-width: 0;
	padding: .55rem .7rem;
	border: 1px solid var(--ecb-cc-border);
	border-radius: var(--ecb-cc-radius-ctl);
	background: var(--ecb-cc-surface);
	font-size: 1.05rem;
	font-weight: 600;
	letter-spacing: .04em;
	color: var(--ecb-cc-charcoal);
	overflow-wrap: anywhere;
}

.ecb-bkmerch__copy {
	flex: 0 0 auto;
	min-height: 44px;
	padding: 0 1rem;
	border: 1px solid var(--ecb-cc-plum);
	border-radius: var(--ecb-cc-radius-ctl);
	background: var(--ecb-cc-plum);
	color: #fff;
	font-size: .85rem;
	font-weight: 500;
	cursor: pointer;
	transition: background-color 200ms ease;
}

.ecb-bkmerch__copy:hover { background: var(--ecb-cc-charcoal); border-color: var(--ecb-cc-charcoal); }

/* Confirmation is text, not only a colour change. */
.ecb-bkmerch__copy.is-copied::after { content: " \2713"; }

.ecb-bkmerch__name { font-size: .85rem; color: var(--ecb-cc-muted); }

.ecb-bkmerch__live {
	position: absolute;
	width: 1px; height: 1px;
	margin: -1px; padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* QR is capped so it never dominates a phone screen. */
.ecb-bkash__qr img {
	display: block;
	width: 100%;
	max-width: 220px;
	height: auto;
	border: 1px solid var(--ecb-cc-border);
	border-radius: var(--ecb-cc-radius-ctl);
	background: #fff;
	padding: .5rem;
}

@media (max-width: 380px) {
	.ecb-bkmerch__copy { width: 100%; }
	.ecb-bkplan__amounts { gap: .25rem 1rem; }
}

@media (prefers-reduced-motion: reduce) {
	.ecb-bkplan__card,
	.ecb-bkmerch__copy { transition: none; }
}

@media (forced-colors: active) {
	.ecb-bkplan__card,
	.ecb-bkmerch__num,
	.ecb-bkpay { border: 1px solid CanvasText; }
	.ecb-bkmerch__copy { border: 1px solid ButtonText; }
}
