:root {
	--rqc-accent: #ff8a00;
	--rqc-accent-hover: #e87900;
	--rqc-text: #171717;
	--rqc-muted: #6b7280;
	--rqc-border: #e7e7e7;
	--rqc-surface: #ffffff;
	--rqc-soft: #f8f8f8;
}

/* سایدکارت داخلی BeTheme با مودال افزونه جایگزین می‌شود. */
body:not(.rqc-embed-checkout) .mfn-cart-holder,
body:not(.rqc-embed-checkout) .mfn-cart-overlay {
	display: none !important;
}

html.rqc-is-open,
html.rqc-is-open body {
	overflow: hidden !important;
}

.rqc-modal {
	position: fixed;
	inset: 0;
	z-index: 1000000;
	display: grid;
	place-items: center;
	padding: 22px;
	direction: rtl;
	font-family: inherit;
	visibility: hidden;
	opacity: 0;
	pointer-events: none;
	transition: opacity 180ms ease, visibility 180ms ease;
}

.rqc-modal[aria-hidden="false"] {
	visibility: visible;
	opacity: 1;
	pointer-events: auto;
}

.rqc-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(10, 12, 16, 0.68);
	backdrop-filter: blur(5px);
}

.rqc-dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min(960px, 100%);
	height: min(840px, calc(100dvh - 44px));
	max-height: calc(100vh - 44px);
	background: var(--rqc-surface);
	border: 1px solid rgba(255, 255, 255, 0.5);
	border-radius: 24px;
	box-shadow: 0 30px 90px rgba(0, 0, 0, 0.3);
	overflow: hidden;
	transform: translateY(14px) scale(0.985);
	transition: transform 180ms ease;
	outline: 0;
}

.rqc-modal[aria-hidden="false"] .rqc-dialog {
	transform: translateY(0) scale(1);
}

.rqc-header {
	position: relative;
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 72px;
	padding: 16px 70px;
	border-bottom: 1px solid var(--rqc-border);
	background: #fff;
}

.rqc-header h2 {
	margin: 0 !important;
	font-size: 21px !important;
	line-height: 1.5 !important;
	color: var(--rqc-text) !important;
}

.rqc-close {
	position: absolute;
	top: 50%;
	left: 22px;
	transform: translateY(-50%);
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0 !important;
	margin: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: var(--rqc-soft) !important;
	color: #333 !important;
	font-size: 30px !important;
	font-weight: 300 !important;
	line-height: 1 !important;
	cursor: pointer;
}

.rqc-close:hover {
	background: #eeeeee !important;
}

.rqc-body {
	position: relative;
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.rqc-cart-items {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	padding: 22px;
}

.rqc-cart-item {
	display: grid;
	grid-template-columns: 92px minmax(0, 1fr) auto;
	gap: 18px;
	align-items: center;
	padding: 16px;
	margin-bottom: 14px;
	background: var(--rqc-soft);
	border: 1px solid #f0f0f0;
	border-radius: 16px;
}

.rqc-product-image img {
	display: block;
	width: 92px;
	height: 92px;
	object-fit: contain;
	background: #fff;
	border-radius: 12px;
}

.rqc-product-info h3 {
	margin: 0 0 8px !important;
	font-size: 16px !important;
	line-height: 1.7 !important;
	color: var(--rqc-text) !important;
}

.rqc-product-info dl,
.rqc-product-info p {
	margin: 0 0 6px;
	font-size: 13px;
	color: var(--rqc-muted);
}

.rqc-line-price {
	font-size: 15px;
	font-weight: 700;
	color: var(--rqc-accent);
}

.rqc-item-actions {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
}

.rqc-quantity {
	display: grid;
	grid-template-columns: 36px 42px 36px;
	align-items: center;
	border: 1px solid var(--rqc-border);
	border-radius: 10px;
	background: #fff;
	overflow: hidden;
}

.rqc-quantity button {
	width: 36px !important;
	height: 38px !important;
	min-width: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	color: #222 !important;
	font-size: 20px !important;
	line-height: 1 !important;
	cursor: pointer;
}

.rqc-quantity button:hover {
	background: #f0f0f0 !important;
}

.rqc-quantity button:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.rqc-quantity span {
	text-align: center;
	font-weight: 700;
}

.rqc-remove,
.rqc-text-button {
	padding: 0 !important;
	border: 0 !important;
	background: transparent !important;
	color: var(--rqc-muted) !important;
	font-size: 13px !important;
	cursor: pointer;
}

.rqc-remove:hover,
.rqc-text-button:hover {
	color: #b42318 !important;
}

.rqc-cart-footer {
	flex: 0 0 auto;
	padding: 18px 22px 20px;
	border-top: 1px solid var(--rqc-border);
	background: #fff;
}

.rqc-total-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	margin-bottom: 14px;
	font-size: 16px;
}

.rqc-total-row strong {
	font-size: 19px;
	color: var(--rqc-text);
}

.rqc-primary-button,
.rqc-secondary-button {
	display: block !important;
	width: 100% !important;
	min-height: 50px;
	padding: 13px 22px !important;
	margin: 0 0 12px !important;
	border: 0 !important;
	border-radius: 12px !important;
	background: var(--rqc-accent) !important;
	color: #fff !important;
	font: inherit !important;
	font-weight: 700 !important;
	text-align: center;
	cursor: pointer;
	transition: background-color 150ms ease;
}

.rqc-primary-button:hover,
.rqc-secondary-button:hover {
	background: var(--rqc-accent-hover) !important;
}

.rqc-text-button {
	display: block;
	margin: 0 auto !important;
}

.rqc-loading,
.rqc-empty,
.rqc-error {
	margin: auto;
	padding: 30px;
	text-align: center;
}

.rqc-spinner {
	display: inline-block;
	width: 34px;
	height: 34px;
	border: 3px solid #ededed;
	border-top-color: var(--rqc-accent);
	border-radius: 50%;
	animation: rqc-spin 700ms linear infinite;
}

.rqc-updating::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 5;
	background: rgba(255, 255, 255, 0.65);
}

.rqc-checkout-frame {
	width: 100%;
	height: 100%;
	border: 0;
	background: #fff;
}

.rqc-iframe-loader {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: grid;
	place-items: center;
	background: #fff;
}

.rqc-payment-notice {
	position: absolute;
	inset: 0;
	z-index: 20;
	display: grid;
	place-items: center;
	padding: 24px;
	direction: rtl;
}

.rqc-notice-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 18, 22, 0.72);
	backdrop-filter: blur(4px);
}

.rqc-notice-card {
	position: relative;
	width: min(500px, 100%);
	padding: 34px;
	border-radius: 20px;
	background: #fff;
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
	text-align: center;
}

.rqc-notice-x {
	position: absolute;
	top: 16px;
	left: 16px;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: #f2f5f8 !important;
	color: #526173 !important;
	font-size: 28px !important;
	font-weight: 300 !important;
	cursor: pointer;
}

.rqc-notice-icon {
	display: grid;
	place-items: center;
	width: 58px;
	height: 58px;
	margin: 0 auto 18px;
	border-radius: 50%;
	background: #fff1e6;
	color: var(--rqc-accent);
	color: #ff7a00;
}

.rqc-notice-icon svg {
	width: 34px;
	height: 34px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.rqc-notice-card h3 {
	margin: 0 0 14px !important;
	color: var(--rqc-text) !important;
	font-size: 22px !important;
	line-height: 1.6 !important;
}

.rqc-notice-card p {
	margin: 0 0 22px;
	color: #4b5563;
	font-size: 15px;
	line-height: 2;
}

.rqc-contact-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	padding: 17px 22px;
	margin-bottom: 16px;
	border-radius: 12px;
	background: var(--rqc-accent);
	color: #fff !important;
	font-size: 15px;
	font-weight: 800;
	text-decoration: none !important;
}

.rqc-contact-bar:hover {
	background: var(--rqc-accent-hover);
	color: #fff !important;
}

.rqc-contact-bar strong {
	direction: ltr;
	font-size: 16px;
}

.rqc-alternative-phone {
	margin: 0 0 20px;
	color: #526173;
	font-size: 14px;
	font-weight: 700;
}

.rqc-alternative-phone a {
	direction: ltr;
	display: inline-block;
	color: #111827 !important;
	font-weight: 800;
	text-decoration: none !important;
}

.rqc-notice-close {
	width: 100%;
	padding: 13px 18px !important;
	border: 1px solid #d7dee8 !important;
	border-radius: 10px !important;
	background: #fff !important;
	color: #6b7280 !important;
	font: inherit !important;
	cursor: pointer;
}

@keyframes rqc-spin {
	to { transform: rotate(360deg); }
}

/* صفحه Checkout که داخل مودال باز می‌شود */
html.rqc-embed-document,
body.rqc-embed-checkout {
	background: #fff !important;
}

body.rqc-embed-checkout #mfn-header-template,
body.rqc-embed-checkout #Header_wrapper,
body.rqc-embed-checkout #Subheader,
body.rqc-embed-checkout #Footer,
body.rqc-embed-checkout #back_to_top,
body.rqc-embed-checkout .mfn-cart-holder,
body.rqc-embed-checkout .mfn-cart-overlay,
body.rqc-embed-checkout .woocommerce-form-coupon-toggle,
body.rqc-embed-checkout .woocommerce-form-login-toggle {
	display: none !important;
}

body.rqc-embed-checkout #Wrapper,
body.rqc-embed-checkout #Content,
body.rqc-embed-checkout .content_wrapper,
body.rqc-embed-checkout .section_wrapper,
body.rqc-embed-checkout .sections_group,
body.rqc-embed-checkout .the_content_wrapper {
	width: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
	box-shadow: none !important;
	background: #fff !important;
}

body.rqc-embed-checkout .woocommerce {
	padding: 24px !important;
}

body.rqc-embed-checkout form.checkout {
	direction: rtl;
}

@media (max-width: 767px) {
	.rqc-modal {
		padding: 0;
		place-items: stretch;
	}

	.rqc-dialog {
		width: 100%;
		height: 100dvh;
		max-height: none;
		border-radius: 0;
	}

	.rqc-header {
		min-height: 62px;
		padding: 12px 58px;
	}

	.rqc-close {
		left: 12px;
	}

	.rqc-cart-items {
		padding: 12px;
	}

	.rqc-cart-item {
		grid-template-columns: 74px minmax(0, 1fr);
		gap: 12px;
		padding: 12px;
	}

	.rqc-product-image img {
		width: 74px;
		height: 74px;
	}

	.rqc-item-actions {
		grid-column: 1 / -1;
		flex-direction: row;
		justify-content: space-between;
	}

	.rqc-cart-footer {
		padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
	}

	body.rqc-embed-checkout .woocommerce {
		padding: 14px !important;
	}

	.rqc-payment-notice {
		padding: 14px;
	}

	.rqc-notice-card {
		padding: 26px 18px;
	}

	.rqc-contact-bar {
		padding: 15px;
		gap: 10px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.rqc-modal,
	.rqc-dialog,
	.rqc-spinner {
		transition: none;
		animation-duration: 1ms;
	}
}
