/* MSR Unified Commerce Shell (MSR Commerce + WooCommerce) - 0.3.5 */

.msr-commerce-shell {
	background-color: var(--msr-bg, #ffffff);
	color: var(--msr-text, #1e293b);
	margin: 0;
	padding: 0;
}

.msr-commerce-shell[dir="rtl"],
.msr-commerce-shell [dir="rtl"],
body.rtl .msr-commerce-shell,
body.msr-force-rtl-chrome .msr-commerce-shell {
	direction: rtl;
	text-align: right;
	font-family: "Cairo", system-ui, -apple-system, sans-serif;
}
.msr-commerce-sticky,
.msr-commerce-drawer {
	top: var(--msr-admin-offset, 0px);
}

.msr-commerce-shell button,
.msr-commerce-shell input,
.msr-commerce-shell select,
.msr-commerce-shell textarea {
	font-family: inherit;
}

.msr-commerce-container {
	width: min(100%, 1320px);
	margin-inline: auto;
	padding: clamp(20px, 3vw, 40px) clamp(16px, 2.5vw, 28px);
	box-sizing: border-box;
}

.msr-commerce-entry {
	min-width: 0;
}

/* Fallback Archive Header & Responsive Grid (when MSR Commerce renders fallback archive) */
.msr-commerce-archive-header {
	margin-bottom: 28px;
}

.msr-commerce-archive-title {
	margin: 0 0 8px;
	font-size: clamp(24px, 3vw, 34px);
	font-weight: 700;
	color: var(--msr-text, #0f172a);
}

.msr-commerce-archive-desc {
	color: var(--msr-muted, #64748b);
	font-size: 15px;
	line-height: 1.65;
}

.msr-commerce-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
	align-items: stretch;
}

.msr-commerce-card {
	display: flex;
	flex-direction: column;
	background: var(--msr-surface, #ffffff);
	border: 1px solid var(--msr-border, rgba(15, 23, 42, 0.1));
	border-radius: 16px;
	overflow: hidden;
	transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.msr-commerce-card:hover {
	transform: translateY(-2px);
	border-color: color-mix(in srgb, var(--msr-accent, #4e71fe) 45%, var(--msr-border, rgba(15, 23, 42, 0.1)));
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.msr-commerce-card-media {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 4 / 3;
	padding: 20px;
	background: radial-gradient(
		circle at 50% 42%,
		var(--msr-surface-2, rgba(78, 113, 254, 0.08)) 0%,
		var(--msr-surface, #f8fafc) 76%
	);
	overflow: hidden;
}

.msr-commerce-card-media img {
	width: 100%;
	height: 100%;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	display: block;
}

.msr-commerce-card-body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	padding: 20px;
	gap: 10px;
}

.msr-commerce-card-title {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.4;
}

.msr-commerce-card-title a {
	color: var(--msr-text, #0f172a);
	text-decoration: none;
}

.msr-commerce-card-excerpt {
	color: var(--msr-muted, #64748b);
	font-size: 14px;
	line-height: 1.6;
}

.msr-commerce-card-cta {
	margin-top: auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 18px;
	border-radius: 10px;
	background: var(--msr-primary, #4e71fe);
	color: #ffffff;
	font-weight: 600;
	font-size: 14px;
	text-decoration: none;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.msr-commerce-card-cta:hover {
	color: #ffffff;
	opacity: 0.92;
}

.msr-commerce-pagination {
	margin-top: 32px;
	text-align: center;
}

/* WooCommerce Surface Token Harmonization (Light, Mid-Tone & Dark) */
body.msr-commerce-provider-woo .page_content.msr-commerce-shell,
body.msr-commerce-provider-woo .msr-commerce-shell .woocommerce {
	color: var(--msr-text, inherit);
}

body.msr-commerce-provider-woo .woocommerce ul.products li.product {
	background: var(--msr-surface, transparent);
	border: 1px solid var(--msr-border, rgba(148, 163, 184, 0.16));
	border-radius: 14px;
	padding: 14px;
	box-sizing: border-box;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

body.msr-commerce-provider-woo .woocommerce ul.products li.product:hover {
	border-color: color-mix(in srgb, var(--msr-accent, #4e71fe) 45%, var(--msr-border, rgba(148, 163, 184, 0.2)));
}

body.msr-commerce-provider-woo .woocommerce ul.products li.product .woocommerce-loop-product__title,
body.msr-commerce-provider-woo .woocommerce div.product .product_title {
	color: var(--msr-text, inherit);
}

body.msr-commerce-provider-woo .woocommerce ul.products li.product .price,
body.msr-commerce-provider-woo .woocommerce div.product p.price,
body.msr-commerce-provider-woo .woocommerce div.product span.price {
	color: var(--msr-accent, var(--msr-primary, #4e71fe));
}

body.msr-commerce-provider-woo .woocommerce-product-details__short-description,
body.msr-commerce-provider-woo .woocommerce .product_meta,
body.msr-commerce-provider-woo .woocommerce .woocommerce-breadcrumb,
body.msr-commerce-provider-woo .woocommerce .woocommerce-result-count {
	color: var(--msr-muted, #64748b);
}

body.msr-commerce-provider-woo .woocommerce div.product .woocommerce-tabs .panel {
	background: var(--msr-surface, transparent);
	border-color: var(--msr-border, rgba(167, 167, 167, 0.2));
	color: var(--msr-text, inherit);
	border-radius: 0 12px 12px 12px;
}

body.msr-commerce-provider-woo .woocommerce div.product .woocommerce-tabs ul.tabs li {
	background: var(--msr-surface-2, rgba(167, 167, 167, 0.1));
	border-color: var(--msr-border, rgba(167, 167, 167, 0.2));
	color: var(--msr-muted, inherit);
}

body.msr-commerce-provider-woo .woocommerce div.product .woocommerce-tabs ul.tabs li.active {
	background: var(--msr-surface, #ffffff);
	color: var(--msr-text, inherit);
}

body.msr-commerce-provider-woo .woocommerce table.shop_table,
body.msr-commerce-provider-woo .woocommerce-checkout #payment,
body.msr-commerce-provider-woo .woocommerce-cart .cart-collaterals .cart_totals {
	background: var(--msr-surface, transparent);
	border-color: var(--msr-border, rgba(167, 167, 167, 0.2));
	color: var(--msr-text, inherit);
}

body.msr-commerce-provider-woo .woocommerce div.product form.cart .variations select,
body.msr-commerce-provider-woo .woocommerce .woocommerce-ordering select,
body.msr-commerce-provider-woo .woocommerce input.input-text,
body.msr-commerce-provider-woo .woocommerce textarea {
	background: var(--msr-surface, #ffffff);
	color: var(--msr-text, #1e293b);
	border: 1px solid var(--msr-border, rgba(148, 163, 184, 0.28));
}

/* Tablet & Mobile Responsive Polish */
@media screen and (max-width: 1024px) {
	.msr-commerce-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 18px;
	}
}

@media screen and (max-width: 768px) {
	.msr-commerce-grid {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	.msr-commerce-container {
		padding: 18px 14px;
	}

	.msr-commerce-single .msr-commerce-container {
		padding-bottom: 88px;
	}

	/* Lift floating helpers cleanly above bottom order/price sticky bars */
	body.msr-commerce-single i.fixed_contact,
	body.msr-commerce-single i.backtotop {
		bottom: 86px !important;
	}

	/* WooCommerce Single Product Mobile Layout */
	body.msr-commerce-provider-woo .woocommerce div.product div.images,
	body.msr-commerce-provider-woo .woocommerce div.product div.summary {
		width: 100% !important;
		float: none !important;
		margin: 0 0 24px !important;
	}

	body.msr-commerce-provider-woo .woocommerce div.product form.cart {
		display: flex;
		flex-wrap: wrap;
		gap: 12px;
		align-items: stretch;
	}

	body.msr-commerce-provider-woo .woocommerce div.product form.cart .single_add_to_cart_button {
		flex: 1 1 200px;
		min-height: 48px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		border-radius: 10px;
	}

	body.msr-commerce-provider-woo .woocommerce div.product .woocommerce-tabs .panel {
		padding: 20px;
	}

	body.msr-commerce-provider-woo .woocommerce div.product .woocommerce-tabs ul.tabs {
		display: flex;
		flex-wrap: nowrap;
		overflow-x: auto;
		gap: 6px;
		margin: 0 0 -1px;
		padding: 0;
	}

	body.msr-commerce-provider-woo .woocommerce div.product .woocommerce-tabs ul.tabs li {
		flex: 0 0 auto;
	}
}
