/**
 * Hafez cart page (body.hafez-cart-page) and thank-you page
 * (body.hafez-thankyou-page), the same look as the Hafez checkout.
 *
 * Colours: visual identity cards «شخصی‌سازی صفحه سبد خرید» / «شخصی‌سازی صفحه
 * تشکر از خرید» (--hafez-dp-*, printed on the body class) → site palette
 * (--hafez-color-*) → fixed fallback.
 */

body.hafez-cart-page,
body.hafez-thankyou-page,
body.hafez-payfail-page {
	--hafez-co-accent: var(--hafez-dp-primary-bg, var(--hafez-color-primary, #f15a24));
	--hafez-co-on-accent: var(--hafez-dp-primary-text, #fff);
	--hafez-co-accent-hover: var(--hafez-dp-primary-hover-bg, var(--hafez-color-primary-hover, #d4471a));
	--hafez-co-on-accent-hover: var(--hafez-dp-primary-hover-text, var(--hafez-co-on-accent));
	--hafez-co-ink: var(--hafez-dp-primary-ink, var(--hafez-co-accent));
	--hafez-co-box: var(--hafez-dp-box-bg, var(--hafez-color-surface, #fff));
	--hafez-co-border: var(--hafez-dp-box-border-color, var(--hafez-color-border, #e6dfda));
	--hafez-co-text: var(--hafez-dp-field-text, var(--hafez-color-text, #2c2624));
	--hafez-co-label: var(--hafez-dp-label, var(--hafez-co-text));
	--hafez-co-muted: var(--hafez-dp-help, var(--hafez-color-text-muted, #6e6560));
	--hafez-co-soft: color-mix(in srgb, var(--hafez-co-accent) 7%, var(--hafez-co-box));
	--hafez-co-line: color-mix(in srgb, var(--hafez-co-border) 75%, transparent);
	--hafez-co-success: var(--hafez-color-success, #16a34a);
	--hafez-co-danger: var(--hafez-color-danger, #dc2626);
	--hafez-co-radius: var(--hafez-dp-radius-box, 16px);
	--hafez-co-radius-button: var(--hafez-dp-radius-button, 10px);
	--hafez-co-radius-field: var(--hafez-dp-radius-field, 10px);
	--hafez-co-shadow: 0 1px 2px rgba(20, 12, 6, 0.04), 0 8px 24px rgba(20, 12, 6, 0.05);
}

/* Shared: primary and secondary buttons. */
body.hafez-cart-page .woocommerce :is(.checkout-button, .return-to-shop .button),
body.hafez-thankyou-page .woocommerce-order :is(.hafez-ty__btn--primary, .woocommerce-thankyou-order-failed-actions .button.pay:first-child) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-height: 50px;
	margin: 0;
	padding: 0 24px;
	color: var(--hafez-co-on-accent) !important;
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
	text-decoration: none;
	text-transform: none;
	letter-spacing: 0;
	background: var(--hafez-co-accent) !important;
	border: 0;
	border-radius: var(--hafez-co-radius-button);
	box-shadow: 0 6px 16px color-mix(in srgb, var(--hafez-co-accent) 26%, transparent);
	transition: background-color 0.15s ease, transform 0.15s ease;
}

body.hafez-cart-page .woocommerce :is(.checkout-button, .return-to-shop .button):hover,
body.hafez-thankyou-page .woocommerce-order .hafez-ty__btn--primary:hover {
	color: var(--hafez-co-on-accent-hover) !important;
	background: var(--hafez-co-accent-hover) !important;
}

body.hafez-thankyou-page .woocommerce-order .hafez-ty__btn:not(.hafez-ty__btn--primary),
body.hafez-thankyou-page .woocommerce-order .woocommerce-thankyou-order-failed-actions .button.pay + .button.pay {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-height: 50px;
	margin: 0;
	padding: 0 24px;
	color: var(--hafez-co-text);
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	background: var(--hafez-co-box);
	border: 1px solid var(--hafez-co-border);
	border-radius: var(--hafez-co-radius-button);
}

body.hafez-thankyou-page .woocommerce-order .hafez-ty__btn:not(.hafez-ty__btn--primary):hover {
	color: var(--hafez-co-ink);
	background: var(--hafez-co-soft);
	border-color: color-mix(in srgb, var(--hafez-co-accent) 40%, var(--hafez-co-border));
}

/* ===========================================================================
 * Cart
 * ======================================================================== */

/* Two columns from Hafez_Shop_Pages wrappers (cart/cart.php hooks): products
   first (right in RTL), the totals box beside them. */
body.hafez-cart-page .hafez-cart-layout {
	display: flex;
	gap: 28px;
	align-items: flex-start;
}

body.hafez-cart-page .hafez-cart-layout__main {
	flex: 1 1 auto;
	min-width: 0;
}

body.hafez-cart-page .hafez-cart-layout__main > form.woocommerce-cart-form {
	margin: 0;
}

body.hafez-cart-page .hafez-cart-layout__aside {
	position: sticky;
	top: 24px;
	flex: 0 0 380px;
	align-self: flex-start;
	max-width: 400px;
	min-width: 0;
}

body.admin-bar.hafez-cart-page .hafez-cart-layout__aside {
	top: 56px;
}

body.hafez-cart-page .hafez-cart-layout__aside > .cart-collaterals {
	float: none;
	width: 100%;
	margin: 0;
}

/* The total is the one number that matters here: no «جمع جزء» row. */
body.hafez-cart-page .cart-collaterals .cart_totals table.shop_table tr.cart-subtotal {
	display: none;
}

body.hafez-cart-page .woocommerce > .woocommerce-notices-wrapper:empty {
	display: none;
}

/* Items: the table becomes a list of cards. */
body.hafez-cart-page table.shop_table.cart {
	display: block;
	width: 100%;
	margin: 0;
	color: var(--hafez-co-text);
	background: transparent;
	border: 0;
	border-radius: 0;
}

body.hafez-cart-page table.shop_table.cart thead {
	display: none;
}

body.hafez-cart-page table.shop_table.cart tbody {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

body.hafez-cart-page table.shop_table.cart tr.cart_item {
	position: relative;
	display: grid;
	grid-template-columns: 96px minmax(0, 1fr) auto;
	grid-template-areas:
		"thumb name remove"
		"thumb price price"
		"thumb qty subtotal";
	gap: 4px 16px;
	align-items: center;
	padding: 16px;
	background: var(--hafez-co-box);
	border: 1px solid var(--hafez-co-border);
	border-radius: var(--hafez-co-radius);
	box-shadow: var(--hafez-co-shadow);
}

body.hafez-cart-page table.shop_table.cart tr.cart_item td {
	display: block;
	padding: 0;
	text-align: start;
	background: transparent !important;
	border: 0 !important;
}

body.hafez-cart-page table.shop_table.cart tr.cart_item td::before {
	display: none !important;
}

body.hafez-cart-page table.shop_table.cart td.product-thumbnail {
	grid-area: thumb;
	align-self: start;
}

body.hafez-cart-page table.shop_table.cart td.product-thumbnail img {
	display: block;
	box-sizing: border-box;
	width: 96px !important;
	max-width: none;
	height: 96px !important;
	object-fit: cover;
	background: var(--hafez-co-soft);
	border: 1px solid var(--hafez-co-line);
	border-radius: 12px;
}

body.hafez-cart-page table.shop_table.cart td.product-name {
	grid-area: name;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.6;
}

body.hafez-cart-page table.shop_table.cart td.product-name a {
	color: var(--hafez-co-text);
	text-decoration: none;
}

body.hafez-cart-page table.shop_table.cart td.product-name a:hover {
	color: var(--hafez-co-ink);
}

body.hafez-cart-page table.shop_table.cart td.product-name :is(dl.variation, .backorder_notification) {
	margin: 4px 0 0;
	color: var(--hafez-co-muted);
	font-size: 12.5px;
	font-weight: 400;
}

body.hafez-cart-page table.shop_table.cart td.product-name dl.variation :is(dt, dd, p) {
	display: inline;
	margin: 0;
	padding: 0;
}

body.hafez-cart-page table.shop_table.cart td.product-price {
	grid-area: price;
	color: var(--hafez-co-muted);
	font-size: 13px;
}

body.hafez-cart-page table.shop_table.cart td.product-quantity {
	grid-area: qty;
	margin-top: 6px;
}

body.hafez-cart-page table.shop_table.cart td.product-subtotal {
	grid-area: subtotal;
	margin-top: 6px;
	font-size: 16px;
	font-weight: 700;
	text-align: end;
	white-space: nowrap;
}

body.hafez-cart-page table.shop_table.cart td.product-remove {
	grid-area: remove;
	align-self: start;
}

body.hafez-cart-page table.shop_table.cart td.product-remove a.remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	color: var(--hafez-co-muted) !important;
	font-size: 20px;
	font-weight: 400;
	line-height: 1;
	text-decoration: none;
	background: transparent !important;
	border: 1px solid var(--hafez-co-line);
	border-radius: 999px;
	transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

body.hafez-cart-page table.shop_table.cart td.product-remove a.remove:hover {
	color: var(--hafez-co-danger) !important;
	background: color-mix(in srgb, var(--hafez-co-danger) 8%, var(--hafez-co-box)) !important;
	border-color: color-mix(in srgb, var(--hafez-co-danger) 35%, var(--hafez-co-border));
}

/* Quantity stepper (shop-pages.js adds the buttons). */
body.hafez-cart-page .woocommerce-cart-form .quantity {
	display: inline-flex;
	align-items: stretch;
	margin: 0;
	overflow: hidden;
	background: var(--hafez-co-box);
	border: 1px solid var(--hafez-co-border);
	border-radius: var(--hafez-co-radius-field);
}

body.hafez-cart-page .woocommerce-cart-form .quantity input.qty {
	box-sizing: border-box;
	width: 48px;
	height: 40px;
	margin: 0;
	padding: 0;
	color: var(--hafez-co-text);
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	text-align: center;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	-moz-appearance: textfield;
}

body.hafez-cart-page .woocommerce-cart-form .quantity input.qty::-webkit-outer-spin-button,
body.hafez-cart-page .woocommerce-cart-form .quantity input.qty::-webkit-inner-spin-button {
	margin: 0;
	-webkit-appearance: none;
}

body.hafez-cart-page .hafez-qty__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	min-width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	color: var(--hafez-co-ink);
	font: inherit;
	font-size: 18px;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	background: var(--hafez-co-soft);
	border: 0;
	border-radius: 0;
	transition: background-color 0.15s ease, color 0.15s ease;
}

body.hafez-cart-page .hafez-qty__btn:hover,
body.hafez-cart-page .hafez-qty__btn:focus-visible {
	color: var(--hafez-co-on-accent);
	background: var(--hafez-co-accent);
}

/* Coupon row under the items; the cart updates by itself, so no update button. */
body.hafez-cart-page table.shop_table.cart tr:not(.cart_item) {
	display: block;
}

body.hafez-cart-page table.shop_table.cart td.actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	padding: 16px;
	background: var(--hafez-co-box);
	border: 1px dashed color-mix(in srgb, var(--hafez-co-accent) 35%, var(--hafez-co-border)) !important;
	border-radius: var(--hafez-co-radius);
}

body.hafez-cart-page table.shop_table.cart td.actions .coupon {
	display: flex;
	flex: 1 1 320px;
	gap: 8px;
	float: none;
	margin: 0;
}

body.hafez-cart-page table.shop_table.cart td.actions .coupon label {
	display: none;
}

body.hafez-cart-page table.shop_table.cart td.actions .coupon input.input-text {
	box-sizing: border-box;
	flex: 1 1 auto;
	width: auto;
	min-width: 0;
	height: 46px;
	margin: 0;
	padding: 0 14px;
	color: var(--hafez-co-text);
	font: inherit;
	font-size: 14px;
	background: var(--hafez-co-box);
	border: 1px solid var(--hafez-co-border);
	border-radius: var(--hafez-co-radius-field);
	box-shadow: none;
}

body.hafez-cart-page table.shop_table.cart td.actions .coupon input.input-text:focus {
	border-color: var(--hafez-co-accent);
	outline: none;
}

body.hafez-cart-page table.shop_table.cart td.actions .coupon .button {
	flex: 0 0 auto;
	height: 46px;
	margin: 0;
	padding: 0 20px;
	color: var(--hafez-co-ink);
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	white-space: nowrap;
	background: var(--hafez-co-soft);
	border: 1px solid color-mix(in srgb, var(--hafez-co-accent) 40%, var(--hafez-co-border));
	border-radius: var(--hafez-co-radius-button);
}

body.hafez-cart-page table.shop_table.cart td.actions .coupon .button:hover {
	color: var(--hafez-co-on-accent);
	background: var(--hafez-co-accent);
	border-color: var(--hafez-co-accent);
}

body.hafez-cart-page table.shop_table.cart td.actions > .button[name="update_cart"] {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
}

/* Totals card. */
body.hafez-cart-page .cart-collaterals .cart_totals {
	float: none;
	box-sizing: border-box;
	width: 100%;
	padding: 24px;
	color: var(--hafez-co-text);
	background: var(--hafez-co-box);
	border: 1px solid var(--hafez-co-border);
	border-radius: var(--hafez-co-radius);
	box-shadow: var(--hafez-co-shadow);
}

body.hafez-cart-page .cart-collaterals .cart_totals h2 {
	margin: 0 0 12px;
	padding: 0;
	color: var(--hafez-co-text);
	font-size: 17px;
	font-weight: 700;
	line-height: 1.5;
}

body.hafez-cart-page .cart-collaterals .cart_totals table.shop_table {
	width: 100%;
	margin: 0 0 20px;
	font-size: 14px;
	line-height: 1.7;
	background: transparent;
	border: 0;
	border-collapse: collapse;
	border-radius: 0;
}

body.hafez-cart-page .cart-collaterals .cart_totals table.shop_table :is(th, td) {
	padding: 10px 0;
	color: inherit;
	font-weight: 400;
	vertical-align: middle;
	background: transparent !important;
	border: 0 !important;
}

body.hafez-cart-page .cart-collaterals .cart_totals table.shop_table th {
	width: auto;
	color: var(--hafez-co-muted);
	text-align: start;
}

body.hafez-cart-page .cart-collaterals .cart_totals table.shop_table td {
	font-weight: 600;
	text-align: end;
}

body.hafez-cart-page .cart-collaterals .cart_totals table.shop_table td::before {
	display: none !important;
}

body.hafez-cart-page .cart-collaterals .cart_totals tr.cart-discount :is(th, td) {
	color: var(--hafez-co-success);
}

body.hafez-cart-page .cart-collaterals .cart_totals tr.order-total :is(th, td) {
	padding-top: 16px;
	color: var(--hafez-co-text);
	font-size: 16px;
	font-weight: 700;
	border-top: 1px solid var(--hafez-co-border) !important;
}

body.hafez-cart-page .cart-collaterals .cart_totals tr.order-total td strong {
	color: var(--hafez-co-ink);
	font-size: 19px;
}

body.hafez-cart-page .cart-collaterals .cart_totals tr.order-total td small {
	display: block;
	color: var(--hafez-co-muted);
	font-size: 12px;
	font-weight: 400;
}

body.hafez-cart-page .cart-collaterals .cart_totals #shipping_method {
	display: grid;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
	text-align: start;
}

body.hafez-cart-page .cart-collaterals .cart_totals #shipping_method input {
	accent-color: var(--hafez-co-accent);
}

body.hafez-cart-page .cart-collaterals .cart_totals :is(.woocommerce-shipping-destination, .shipping-calculator-button) {
	margin: 6px 0 0;
	color: var(--hafez-co-muted);
	font-size: 12px;
	font-weight: 400;
}

body.hafez-cart-page .cart-collaterals .cart_totals .shipping-calculator-button {
	color: var(--hafez-co-ink);
}

body.hafez-cart-page .cart-collaterals .wc-proceed-to-checkout {
	padding: 0;
}

body.hafez-cart-page .cart-collaterals .wc-proceed-to-checkout .checkout-button {
	display: flex;
	width: 100%;
	min-height: 52px;
	margin: 0;
}

/* Cross-sells under the cart. */
body.hafez-cart-page .woocommerce > .cross-sells {
	float: none;
	width: 100%;
	margin: 12px 0 0;
}

body.hafez-cart-page .woocommerce > .cross-sells > h2 {
	margin: 0 0 16px;
	font-size: 18px;
	font-weight: 700;
}

/* Empty cart. */
body.hafez-cart-page .woocommerce:has(.wc-empty-cart-message) {
	display: flex;
	flex-direction: column;
	gap: 16px;
	align-items: center;
	box-sizing: border-box;
	max-width: 560px;
	margin-right: auto;
	margin-left: auto;
	padding: 48px 24px;
	text-align: center;
	background: var(--hafez-co-box);
	border: 1px solid var(--hafez-co-border);
	border-radius: var(--hafez-co-radius);
	box-shadow: var(--hafez-co-shadow);
}

body.hafez-cart-page .wc-empty-cart-message {
	width: 100%;
}

body.hafez-cart-page .wc-empty-cart-message .cart-empty {
	display: flex;
	flex-direction: column;
	gap: 14px;
	align-items: center;
	margin: 0;
	padding: 0;
	color: var(--hafez-co-text);
	font-size: 17px;
	font-weight: 700;
	background: transparent;
	border: 0;
}

body.hafez-cart-page .wc-empty-cart-message .cart-empty::before {
	content: "";
	position: static;
	display: block;
	width: 72px;
	height: 72px;
	margin: 0;
	background-color: var(--hafez-co-soft);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 7h12l-1.2 10.2a2 2 0 0 1-2 1.8H9.2a2 2 0 0 1-2-1.8L6 7Z'/%3E%3Cpath d='M9 7V6a3 3 0 0 1 6 0v1'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 34px;
	border-radius: 999px;
}

body.hafez-cart-page .return-to-shop {
	margin: 0;
}

@media (max-width: 960px) {
	body.hafez-cart-page .hafez-cart-layout {
		flex-direction: column;
		align-items: stretch;
	}

	body.hafez-cart-page .hafez-cart-layout__aside {
		position: static;
		flex: 1 1 auto;
		align-self: stretch;
		max-width: none;
	}
}

@media (max-width: 600px) {
	body.hafez-cart-page table.shop_table.cart tr.cart_item {
		grid-template-columns: 72px minmax(0, 1fr) auto;
		gap: 4px 12px;
		padding: 12px;
	}

	body.hafez-cart-page table.shop_table.cart td.product-thumbnail img {
		width: 72px !important;
		height: 72px !important;
	}

	body.hafez-cart-page table.shop_table.cart td.product-name {
		font-size: 14px;
	}

	body.hafez-cart-page .cart-collaterals .cart_totals {
		padding: 18px 16px;
	}
}

/* ===========================================================================
 * Thank-you page
 * ======================================================================== */

body.hafez-thankyou-page .woocommerce-order {
	display: flex;
	flex-direction: column;
	gap: 20px;
	box-sizing: border-box;
	max-width: 920px;
	margin-right: auto;
	margin-left: auto;
	color: var(--hafez-co-text);
}

body.hafez-thankyou-page .woocommerce-order > * {
	margin-top: 0;
	margin-bottom: 0;
}

/* Hero: icon, heading and text. */
body.hafez-thankyou-page .woocommerce-order .woocommerce-thankyou-order-received {
	display: flex;
	flex-direction: column;
	gap: 8px;
	align-items: center;
	margin: 0;
	padding: 36px 24px 32px;
	text-align: center;
	background: linear-gradient(180deg, var(--hafez-co-soft), var(--hafez-co-box) 70%);
	border: 1px solid var(--hafez-co-border);
	border-radius: var(--hafez-co-radius);
	box-shadow: var(--hafez-co-shadow);
}

body.hafez-thankyou-page .woocommerce-order .woocommerce-thankyou-order-received::before {
	display: none;
}

body.hafez-thankyou-page .hafez-ty__icon {
	position: relative;
	display: block;
	width: 76px;
	height: 76px;
	margin-bottom: 8px;
	background: var(--hafez-co-success);
	border-radius: 999px;
	box-shadow: 0 0 0 10px color-mix(in srgb, var(--hafez-co-success) 14%, transparent);
	animation: hafez-ty-pop 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.3) both;
}

body.hafez-thankyou-page .hafez-ty__icon::after {
	content: "";
	position: absolute;
	top: 22px;
	left: 28px;
	width: 18px;
	height: 30px;
	border-right: 4px solid #fff;
	border-bottom: 4px solid #fff;
	transform: rotate(45deg);
}

@keyframes hafez-ty-pop {
	from {
		opacity: 0;
		transform: scale(0.6);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

body.hafez-thankyou-page .hafez-ty__title {
	color: var(--hafez-co-text);
	font-size: 22px;
	font-weight: 800;
	line-height: 1.5;
}

body.hafez-thankyou-page .hafez-ty__text {
	max-width: 560px;
	color: var(--hafez-co-muted);
	font-size: 14px;
	font-weight: 400;
	line-height: 1.9;
}

/* Failed payment. */
body.hafez-thankyou-page .woocommerce-order .woocommerce-thankyou-order-failed {
	margin: 0;
	padding: 20px 24px;
	color: var(--hafez-co-danger);
	font-weight: 600;
	line-height: 1.9;
	background: color-mix(in srgb, var(--hafez-co-danger) 6%, var(--hafez-co-box));
	border: 1px solid color-mix(in srgb, var(--hafez-co-danger) 30%, var(--hafez-co-border));
	border-radius: var(--hafez-co-radius);
}

body.hafez-thankyou-page .woocommerce-order .woocommerce-thankyou-order-failed-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0;
	padding: 0;
	background: transparent;
	border: 0;
}

/* Overview: order number, date, email, total, payment method as tiles. */
body.hafez-thankyou-page .woocommerce-order ul.woocommerce-order-overview {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
	border: 0;
}

body.hafez-thankyou-page .woocommerce-order ul.woocommerce-order-overview::before,
body.hafez-thankyou-page .woocommerce-order ul.woocommerce-order-overview::after {
	display: none;
}

body.hafez-thankyou-page .woocommerce-order ul.woocommerce-order-overview li {
	display: flex;
	flex-direction: column;
	gap: 6px;
	float: none;
	box-sizing: border-box;
	min-width: 0;
	margin: 0;
	padding: 14px 16px;
	color: var(--hafez-co-muted);
	font-size: 12.5px;
	line-height: 1.6;
	text-transform: none;
	background: var(--hafez-co-box);
	border: 1px solid var(--hafez-co-border);
	border-radius: 12px;
}

body.hafez-thankyou-page .woocommerce-order ul.woocommerce-order-overview li strong {
	overflow-wrap: anywhere;
	color: var(--hafez-co-text);
	font-size: 15px;
	font-weight: 700;
}

body.hafez-thankyou-page .woocommerce-order ul.woocommerce-order-overview li.total strong {
	color: var(--hafez-co-ink);
}

/* Order details and addresses as cards. */
body.hafez-thankyou-page .woocommerce-order :is(.woocommerce-order-details, .woocommerce-customer-details, .woocommerce-bacs-bank-details) {
	box-sizing: border-box;
	margin: 0;
	padding: 24px;
	background: var(--hafez-co-box);
	border: 1px solid var(--hafez-co-border);
	border-radius: var(--hafez-co-radius);
	box-shadow: var(--hafez-co-shadow);
}

body.hafez-thankyou-page .woocommerce-order :is(.woocommerce-order-details__title, .woocommerce-column__title, .woocommerce-customer-details > h2, .wc-bacs-bank-details-heading) {
	margin: 0 0 14px;
	padding: 0;
	color: var(--hafez-co-text);
	font-size: 17px;
	font-weight: 700;
	line-height: 1.5;
}

body.hafez-thankyou-page .woocommerce-order table.order_details {
	width: 100%;
	margin: 0;
	font-size: 14px;
	line-height: 1.7;
	background: transparent;
	border: 0;
	border-collapse: collapse;
	border-radius: 0;
}

body.hafez-thankyou-page .woocommerce-order table.order_details :is(th, td) {
	padding: 11px 0;
	color: inherit;
	font-weight: 400;
	text-align: start;
	vertical-align: middle;
	background: transparent !important;
	border: 0 !important;
}

body.hafez-thankyou-page .woocommerce-order table.order_details thead th {
	padding-top: 0;
	color: var(--hafez-co-muted);
	font-size: 12.5px;
	border-bottom: 1px solid var(--hafez-co-border) !important;
}

body.hafez-thankyou-page .woocommerce-order table.order_details :is(td.product-total, thead th.product-total, tfoot td) {
	padding-inline-start: 12px;
	font-weight: 600;
	text-align: end;
	white-space: nowrap;
}

body.hafez-thankyou-page .woocommerce-order table.order_details tbody td {
	border-bottom: 1px solid var(--hafez-co-line) !important;
}

body.hafez-thankyou-page .woocommerce-order table.order_details td.product-name a {
	color: var(--hafez-co-text);
	font-weight: 600;
	text-decoration: none;
}

body.hafez-thankyou-page .woocommerce-order table.order_details td.product-name .product-quantity {
	margin-inline-start: 4px;
	color: var(--hafez-co-muted);
	font-weight: 600;
}

body.hafez-thankyou-page .woocommerce-order table.order_details td.product-name .wc-item-meta {
	margin: 4px 0 0;
	padding: 0;
	color: var(--hafez-co-muted);
	font-size: 12px;
	list-style: none;
}

body.hafez-thankyou-page .woocommerce-order table.order_details td.product-name .wc-item-meta li {
	display: block;
	margin: 2px 0 0;
}

body.hafez-thankyou-page .woocommerce-order table.order_details td.product-name .wc-item-meta li :is(p, strong) {
	display: inline;
	margin: 0;
	font-weight: 400;
}

body.hafez-thankyou-page .woocommerce-order table.order_details tfoot th {
	color: var(--hafez-co-muted);
}

body.hafez-thankyou-page .woocommerce-order table.order_details tfoot tr:first-child :is(th, td) {
	padding-top: 14px;
}

/* WooCommerce gives these rows no classes, so none is singled out as the total. */
body.hafez-thankyou-page .woocommerce-order table.order_details tfoot td {
	color: var(--hafez-co-text);
}

body.hafez-thankyou-page .woocommerce-order .woocommerce-customer-details .woocommerce-columns--addresses {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 16px;
	margin: 0;
}

body.hafez-thankyou-page .woocommerce-order .woocommerce-customer-details .woocommerce-column {
	float: none;
	width: auto;
	max-width: none;
	margin: 0;
	padding: 0;
}

body.hafez-thankyou-page .woocommerce-order .woocommerce-customer-details .woocommerce-columns--addresses::before,
body.hafez-thankyou-page .woocommerce-order .woocommerce-customer-details .woocommerce-columns--addresses::after {
	display: none;
}

body.hafez-thankyou-page .woocommerce-order .woocommerce-customer-details address {
	margin: 0;
	padding: 14px 16px;
	color: var(--hafez-co-text);
	font-size: 14px;
	font-style: normal;
	line-height: 2;
	background: color-mix(in srgb, var(--hafez-co-text) 2.5%, var(--hafez-co-box));
	border: 1px solid var(--hafez-co-line);
	border-radius: 12px;
}

body.hafez-thankyou-page .woocommerce-order .woocommerce-customer-details address p {
	margin: 6px 0 0;
	padding: 0;
}

body.hafez-thankyou-page .woocommerce-order .woocommerce-customer-details address p::before {
	display: none;
}

/* Actions: track the order, back to the shop. */
body.hafez-thankyou-page .hafez-ty__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
}

@media (max-width: 600px) {
	body.hafez-thankyou-page .woocommerce-order :is(.woocommerce-order-details, .woocommerce-customer-details, .woocommerce-bacs-bank-details) {
		padding: 18px 16px;
	}

	body.hafez-thankyou-page .woocommerce-order ul.woocommerce-order-overview {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	body.hafez-thankyou-page .woocommerce-order table.order_details {
		table-layout: fixed;
	}

	body.hafez-thankyou-page .woocommerce-order table.order_details :is(th, td) {
		overflow-wrap: anywhere;
	}

	body.hafez-thankyou-page .woocommerce-order table.order_details :is(td.product-total, thead th.product-total, tfoot td) {
		width: 42%;
		white-space: normal;
	}

	body.hafez-thankyou-page .hafez-ty__actions .button {
		flex: 1 1 100%;
	}
}

body.hafez-cart-page .hafez-qty__btn:disabled {
	color: var(--hafez-co-muted);
	cursor: not-allowed;
	opacity: 0.45;
}

body.hafez-cart-page .hafez-qty__btn:disabled:hover {
	color: var(--hafez-co-muted);
	background: var(--hafez-co-soft);
}

/* At least 15px from the screen edges at every width, as the Hafez checkout. */
@media all {
	body.hafez-cart-page .woocommerce:is(:has(form.woocommerce-cart-form), :has(.wc-empty-cart-message)),
	body.hafez-thankyou-page .woocommerce-order {
		box-sizing: border-box;
		width: min(100%, calc(100vw - 30px));
		margin-right: auto;
		margin-left: auto;
	}

	body.hafez-cart-page .woocommerce:has(form.woocommerce-cart-form) > * {
		width: auto;
		max-width: 100%;
	}
}

/* ===========================================================================
 * «پرداخت ناموفق» (body.hafez-thankyou-page.hafez-payfail-page,
 * core/woocommerce/templates/payment-failed.php): the thank-you layout with a
 * failure message; colours from «شخصی‌سازی صفحه پرداخت ناموفق».
 * ======================================================================== */

body.hafez-payfail-page .woocommerce-order .hafez-pf__hero {
	background: linear-gradient(180deg, color-mix(in srgb, var(--hafez-co-danger) 7%, var(--hafez-co-box)), var(--hafez-co-box) 70%);
	border-color: color-mix(in srgb, var(--hafez-co-danger) 22%, var(--hafez-co-border));
}

body.hafez-payfail-page .hafez-ty__icon.hafez-pf__icon {
	background: var(--hafez-co-danger);
	box-shadow: 0 0 0 10px color-mix(in srgb, var(--hafez-co-danger) 13%, transparent);
}

/* An «×» instead of the thank-you check mark. */
body.hafez-payfail-page .hafez-ty__icon.hafez-pf__icon::before,
body.hafez-payfail-page .hafez-ty__icon.hafez-pf__icon::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 34px;
	height: 4px;
	background: #fff;
	border: 0;
	border-radius: 2px;
	transform: translate(-50%, -50%) rotate(45deg);
}

body.hafez-payfail-page .hafez-ty__icon.hafez-pf__icon::before {
	transform: translate(-50%, -50%) rotate(-45deg);
}

body.hafez-payfail-page .woocommerce-order ul.woocommerce-order-overview li.hafez-pf__status strong {
	color: var(--hafez-co-danger);
}

body.hafez-payfail-page .woocommerce-order ul.woocommerce-order-overview li.total strong {
	color: var(--hafez-co-text);
}

/* The gateway's reason (WooCommerce notices) above the card. */
body.hafez-payfail-page .hafez-pf__notices:empty,
body.hafez-payfail-page .hafez-pf__notices:not(:has(*)) {
	display: none;
}

body.hafez-payfail-page .hafez-pf__notices :is(.woocommerce-error, .woocommerce-message, .woocommerce-info) {
	margin: 0;
	border-radius: 12px;
}

/* The actions come right after the overview here, before the order details. */
body.hafez-payfail-page .woocommerce-order > .hafez-ty__actions {
	justify-content: center;
}

/* WooCommerce's «عملیات‌ها» row (pay / cancel) repeats «پرداخت دوباره» above. */
body.hafez-payfail-page .woocommerce-order table.order_details tfoot tr:has(.order-actions-button) {
	display: none;
}

/* ---------------------------------------------------------------------------
 * Stock problems (Hafez_Shop_Pages::cart_issues()): the item, a summary above
 * the products, and «ادامه جهت تسویه حساب» on hold until they are fixed.
 * ------------------------------------------------------------------------ */

body.hafez-cart-page table.shop_table.cart tr.cart_item.hafez-cart-item--issue {
	border-color: color-mix(in srgb, var(--hafez-co-danger) 55%, var(--hafez-co-border));
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--hafez-co-danger) 10%, transparent);
}

body.hafez-cart-page table.shop_table.cart tr.cart_item.hafez-cart-item--issue td.product-thumbnail img {
	opacity: 0.55;
	filter: grayscale(0.6);
}

body.hafez-cart-page .hafez-cart-issue {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 10px;
	align-items: center;
	margin: 8px 0 0;
	padding: 8px 10px;
	color: var(--hafez-co-danger);
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1.8;
	background: color-mix(in srgb, var(--hafez-co-danger) 7%, var(--hafez-co-box));
	border-radius: 8px;
}

body.hafez-cart-page .hafez-cart-issue__fix {
	margin: 0;
	padding: 2px 10px;
	color: var(--hafez-co-danger);
	font: inherit;
	font-size: 12px;
	font-weight: 700;
	cursor: pointer;
	background: var(--hafez-co-box);
	border: 1px solid color-mix(in srgb, var(--hafez-co-danger) 40%, var(--hafez-co-border));
	border-radius: 999px;
}

body.hafez-cart-page .hafez-cart-issue__fix:hover {
	color: #fff;
	background: var(--hafez-co-danger);
	border-color: var(--hafez-co-danger);
}

body.hafez-cart-page .hafez-cart-alert {
	margin: 0 0 12px;
	padding: 12px 16px;
	color: var(--hafez-co-danger);
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.9;
	background: color-mix(in srgb, var(--hafez-co-danger) 6%, var(--hafez-co-box));
	border: 1px solid color-mix(in srgb, var(--hafez-co-danger) 30%, var(--hafez-co-border));
	border-radius: var(--hafez-co-radius);
}

body.hafez-cart-page .cart-collaterals .hafez-cart-proceed-note {
	margin: 0 0 10px;
	color: var(--hafez-co-danger);
	font-size: 12.5px;
	line-height: 1.8;
}

body.hafez-cart-page .cart-collaterals .wc-proceed-to-checkout .checkout-button.is-disabled {
	cursor: not-allowed;
	opacity: 0.5;
	box-shadow: none;
	pointer-events: none;
}

/* Chosen options of a variation under the product name (Hafez_Shop_Pages::cart_item_attributes()). */
body.hafez-cart-page .hafez-cart-attrs {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 8px;
	margin: 6px 0 0;
}

body.hafez-cart-page .hafez-cart-attr {
	display: inline-flex;
	gap: 6px;
	align-items: center;
	padding: 3px 10px;
	color: var(--hafez-co-text);
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1.7;
	background: color-mix(in srgb, var(--hafez-co-text) 4%, var(--hafez-co-box));
	border: 1px solid var(--hafez-co-line);
	border-radius: 999px;
}

body.hafez-cart-page .hafez-cart-attr__label {
	color: var(--hafez-co-muted);
	font-weight: 400;
}

body.hafez-cart-page .hafez-cart-attr__swatch {
	flex: 0 0 auto;
	width: 14px;
	height: 14px;
	border: 1px solid color-mix(in srgb, var(--hafez-co-text) 18%, transparent);
	border-radius: 50%;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

/* «ترکیب‌های موجود این کالا» under an item that cannot be bought as it is. */
body.hafez-cart-page .hafez-cart-alts {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 8px 0 0;
}

body.hafez-cart-page .hafez-cart-alts__title {
	color: var(--hafez-co-muted);
	font-size: 12px;
	font-weight: 600;
}

body.hafez-cart-page .hafez-cart-alts__list {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
}

body.hafez-cart-page .hafez-cart-alt {
	display: inline-flex;
	gap: 5px;
	align-items: center;
	min-height: 32px;
	margin: 0;
	padding: 0 12px;
	color: var(--hafez-co-text);
	font: inherit;
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1.4;
	cursor: pointer;
	background: var(--hafez-co-box);
	border: 1px solid var(--hafez-co-border);
	border-radius: 999px;
	transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

body.hafez-cart-page .hafez-cart-alt:hover,
body.hafez-cart-page .hafez-cart-alt:focus-visible {
	color: var(--hafez-co-ink);
	background: var(--hafez-co-soft);
	border-color: var(--hafez-co-accent);
}

body.hafez-cart-page .hafez-cart-alt__sep {
	color: var(--hafez-co-muted);
	font-weight: 400;
}

body.hafez-cart-page .hafez-cart-alts.is-busy .hafez-cart-alt {
	cursor: progress;
	opacity: 0.5;
}

body.hafez-cart-page .hafez-cart-alts.is-busy .hafez-cart-alt.is-picked {
	opacity: 1;
	border-color: var(--hafez-co-accent);
}

body.hafez-cart-page .hafez-cart-alts__more {
	color: var(--hafez-co-ink);
	font-size: 12px;
}
