/* MedLab shop — brand colors #004A73 / #f58220 */

.medlab-shop {
	--ms-navy: #004a73;
	--ms-navy-deep: #003755;
	--ms-navy-soft: #e8f1f6;
	--ms-accent: #f58220;
	--ms-accent-hover: #e07010;
	--ms-muted: #5b6b7c;
	--ms-line: #dce5ec;
	--ms-bg: #f4f7fa;
	--ms-surface: #ffffff;
	--ms-font: var(--medlab-site-font, "Yekan", Tahoma, sans-serif);
	--ms-cart-shadow: none;
	--ms-cart-hover-shadow: none;
	--ms-cart-width: 90%;
	font-family: var(--ms-font);
	background: var(--ms-bg);
}

.medlab-shop .site-main,
.medlab-shop .woocommerce {
	max-width: none;
}

/* ---- Hero ---- */
.medlab-shop-hero {
	position: relative;
	overflow: hidden;
	background:
		radial-gradient(ellipse 70% 80% at 100% 0%, rgba(245, 130, 32, 0.14), transparent 55%),
		radial-gradient(ellipse 60% 70% at 0% 100%, rgba(0, 74, 115, 0.12), transparent 50%),
		linear-gradient(165deg, #eaf3f8 0%, #f5f8fb 48%, #eef4f8 100%);
	border-bottom: 1px solid var(--ms-line);
	padding: 40px 20px 32px;
	margin: 0 0 8px;
}

.medlab-shop-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	background:
		linear-gradient(90deg, transparent 0%, rgba(0, 74, 115, 0.03) 50%, transparent 100%);
	pointer-events: none;
}

.medlab-shop-hero__inner {
	position: relative;
	max-width: 1240px;
	margin: 0 auto;
	text-align: center;
}

.medlab-shop-hero__eyebrow {
	display: inline-block;
	margin: 0 0 10px;
	padding: 4px 12px;
	border-radius: 999px;
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	color: var(--ms-navy);
	background: rgba(0, 74, 115, 0.1);
}

.medlab-shop-hero__title {
	margin: 0 0 10px;
	font-size: clamp(1.45rem, 2.6vw, 2.05rem);
	font-weight: 800;
	color: var(--ms-navy);
	line-height: 1.35;
}

.medlab-shop-hero__text {
	margin: 0 auto;
	max-width: 560px;
	color: var(--ms-muted);
	font-size: 0.98rem;
	line-height: 1.7;
}

/* Brand description — matches product editor prose */
.medlab-shop-brand-desc {
	max-width: 1240px;
	margin: 0 auto 20px;
	padding: 0 20px;
}

.medlab-shop-brand-desc__card {
	background: #fff;
	border: 1px solid var(--ms-line);
	border-radius: 14px;
	box-shadow: 0 6px 24px rgba(0, 74, 115, 0.04);
	overflow: hidden;
}

.medlab-shop-brand-desc__header {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 0;
	padding: 20px 24px 14px;
	border-bottom: 1px solid #eef0f4;
}

.medlab-shop-brand-desc__logo {
	width: 56px;
	height: 56px;
	object-fit: contain;
	border-radius: 12px;
	background: var(--ms-navy-soft);
	padding: 6px;
	flex-shrink: 0;
}

.medlab-shop-brand-desc__title {
	margin: 0 0 4px;
	font-size: 1.25rem;
	font-weight: 800;
	color: var(--ms-navy);
	line-height: 1.4;
}

.medlab-shop-brand-desc__subtitle {
	margin: 0;
	font-size: 0.95rem;
	color: var(--ms-navy);
	font-weight: 600;
	opacity: 0.85;
}

.medlab-shop-brand-desc__body {
	padding: 22px 24px 26px;
}

.medlab-shop-prose {
	color: #374151;
	font-size: 0.98rem;
	line-height: 1.9;
	text-align: right;
}

.medlab-shop-prose > *:first-child {
	margin-top: 0;
}

.medlab-shop-prose > *:last-child {
	margin-bottom: 0;
}

.medlab-shop-prose h2,
.medlab-shop-prose h3,
.medlab-shop-prose h4 {
	color: var(--ms-navy);
	margin: 1.5em 0 0.5em;
	line-height: 1.45;
}

.medlab-shop-prose p {
	margin: 0 0 1em;
}

.medlab-shop-prose ul,
.medlab-shop-prose ol {
	margin: 0 0 1em;
	padding: 0 1.2em 0 0;
}

.medlab-shop-prose li {
	margin-bottom: 0.35em;
}

.medlab-shop-prose a {
	color: var(--ms-navy);
}

.medlab-shop-prose img {
	max-width: 100%;
	height: auto;
	border-radius: 10px;
}

/* ---- Toolbar ---- */
.medlab-shop-toolbar {
	max-width: 1240px;
	margin: 0 auto 28px;
	padding: 0 20px;
}

.medlab-shop-toolbar__form {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: stretch;
	background: var(--ms-surface);
	border: 1px solid var(--ms-line);
	border-radius: 18px;
	padding: 14px;
	box-shadow: 0 12px 36px rgba(0, 74, 115, 0.07);
}

.medlab-shop-toolbar__search {
	position: relative;
	flex: 1 1 280px;
	display: flex;
	align-items: stretch;
	min-width: 0;
}

.medlab-shop-toolbar__search-icon {
	position: absolute;
	right: 14px;
	top: 50%;
	transform: translateY(-50%);
	color: #8aa0b0;
	pointer-events: none;
	display: inline-flex;
}

.medlab-shop-toolbar__search input[type="search"] {
	flex: 1;
	width: 100%;
	min-height: 48px;
	border: 1px solid var(--ms-line);
	border-radius: 12px 0 0 12px;
	border-left: 0;
	padding: 0 44px 0 14px;
	font-size: 0.98rem;
	background: #f7fafc;
	color: var(--ms-navy);
	outline: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.medlab-shop-toolbar__search input[type="search"]:focus {
	background: #fff;
	border-color: rgba(0, 74, 115, 0.35);
	box-shadow: inset 0 0 0 1px rgba(0, 74, 115, 0.15);
}

/* Search + advanced: same shape/shadow as add-to-cart, Elementor primary blue */
.medlab-shop-toolbar__submit,
.medlab-shop-toolbar__advanced,
.medlab-shop-advanced__apply {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 20px;
	border: 0 !important;
	border-radius: 12px !important;
	background: var(--e-global-color-primary, var(--ms-navy)) !important;
	color: #fff !important;
	font-weight: 800 !important;
	font-size: 0.95rem;
	cursor: pointer;
	white-space: nowrap;
	text-align: center;
	box-shadow: 0 6px 16px rgba(0, 74, 115, 0.28);
	transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease !important;
}

.medlab-shop-toolbar__submit {
	border-radius: 0 12px 12px 0 !important;
	min-height: 48px;
}

.medlab-shop-toolbar__submit:hover,
.medlab-shop-toolbar__advanced:hover,
.medlab-shop-toolbar__advanced.is-open,
.medlab-shop-advanced__apply:hover {
	background: var(--ms-navy-deep) !important;
	box-shadow: 0 8px 20px rgba(0, 74, 115, 0.36);
	transform: translateY(-1px);
	color: #fff !important;
}

/* Advanced panel */
.medlab-shop-advanced {
	margin-top: 12px;
	background: var(--ms-surface);
	border: 1px solid var(--ms-line);
	border-radius: 18px;
	padding: 18px 18px 16px;
	box-shadow: 0 10px 28px rgba(0, 74, 115, 0.06);
}

.medlab-shop-advanced__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
}

.medlab-shop-advanced__field label {
	display: block;
	margin-bottom: 6px;
	font-size: 0.86rem;
	font-weight: 700;
	color: var(--ms-navy);
}

.medlab-shop-advanced__field input,
.medlab-shop-advanced__field select {
	width: 100%;
	min-height: 44px;
	border: 1px solid var(--ms-line);
	border-radius: 10px;
	padding: 0 12px;
	background: #f7fafc;
	color: var(--ms-navy);
	font-size: 0.94rem;
}

.medlab-shop-advanced__field input:focus,
.medlab-shop-advanced__field select:focus {
	outline: none;
	border-color: rgba(0, 74, 115, 0.4);
	background: #fff;
}

.medlab-shop-advanced__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 12px;
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px solid #eef2f5;
}

.medlab-shop-advanced__clear {
	color: var(--ms-muted);
	text-decoration: none;
	font-size: 0.9rem;
}

.medlab-shop-advanced__clear:hover {
	color: #b91c1c;
}

/* Meta row */
.medlab-shop-toolbar__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 16px;
	margin-top: 14px;
}

.medlab-shop-toolbar__count {
	margin: 0;
	font-size: 0.9rem;
	font-weight: 700;
	color: var(--ms-navy);
}

.medlab-shop-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	flex: 1;
}

.medlab-shop-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 10px;
	border-radius: 999px;
	background: var(--ms-navy-soft);
	color: var(--ms-navy);
	text-decoration: none;
	font-size: 0.82rem;
	font-weight: 700;
}

.medlab-shop-chip:hover {
	background: #d5e6ef;
}

.medlab-shop-chip--clear {
	background: #fff1f1;
	color: #b91c1c;
}

.medlab-shop-toolbar__ordering {
	margin-right: auto;
}

.medlab-shop-toolbar__ordering .woocommerce-ordering {
	margin: 0;
}

.medlab-shop-toolbar__ordering select {
	min-height: 40px;
	border: 1px solid var(--ms-line);
	border-radius: 10px;
	padding: 0 12px;
	background: #fff;
	color: var(--ms-navy);
}

/* Brand archive: 4 columns on desktop, no shop search */
body.medlab-shop--brand-archive ul.products,
.medlab-shop--brand-archive ul.products {
	--ms-cols: 4 !important;
	grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

@media (max-width: 900px) {
	body.medlab-shop--brand-archive ul.products,
	.medlab-shop--brand-archive ul.products {
		--ms-cols: 2 !important;
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
}

@media (max-width: 560px) {
	body.medlab-shop--brand-archive ul.products,
	.medlab-shop--brand-archive ul.products {
		--ms-cols: 1 !important;
		grid-template-columns: 1fr !important;
	}
}

.medlab-shop-brand-bar {
	max-width: 1240px;
	margin: 0 auto 16px;
	padding: 0 20px;
}

.medlab-shop-brand-bar__count {
	margin: 0;
	font-size: 0.98rem;
	font-weight: 700;
	color: var(--ms-navy);
}

/* ---- Product grid ---- */
.medlab-shop ul.products {
	--ms-cols: 4;
	--ms-col-gap: 22px;
	--ms-row-gap: 22px;
	max-width: 1240px;
	margin: 0 auto 36px !important;
	padding: 0 20px !important;
	display: grid !important;
	grid-template-columns: repeat(var(--ms-cols), minmax(0, 1fr));
	column-gap: var(--ms-col-gap);
	row-gap: var(--ms-row-gap);
	list-style: none;
}

.medlab-shop ul.products::before,
.medlab-shop ul.products::after {
	display: none !important;
}

.medlab-shop ul.products li.product {
	position: relative;
	width: 100% !important;
	margin: 0 !important;
	float: none !important;
	clear: none !important;
	background: var(--ms-surface);
	border: 1px solid var(--ms-line);
	border-radius: 18px;
	overflow: hidden;
	padding: 0 0 16px !important;
	box-shadow: 0 6px 20px rgba(0, 74, 115, 0.05);
	transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
	display: flex;
	flex-direction: column;
}

.medlab-shop ul.products li.product::before {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	left: 0;
	height: 3px;
	background: linear-gradient(90deg, var(--ms-accent), var(--ms-navy));
	opacity: 0;
	transition: opacity 0.22s ease;
	z-index: 1;
}

.medlab-shop ul.products li.product:hover {
	transform: translateY(-4px);
	border-color: rgba(0, 74, 115, 0.28);
	box-shadow: 0 16px 40px rgba(0, 74, 115, 0.12);
}

.medlab-shop ul.products li.product:hover::before {
	opacity: 1;
}

/* Photo wrapper: brand logo sits on the product image */
.medlab-shop-card-photo {
	position: relative;
	display: block;
	width: 100%;
	max-width: 100%;
	margin: 0;
}

.medlab-shop-card-brand {
	position: absolute;
	z-index: 6;
	display: flex;
	width: auto;
	padding: 0;
	pointer-events: none;
	top: var(--ms-brand-inset, 8px);
	right: var(--ms-brand-inset, 8px);
	left: auto;
	bottom: auto;
}

.medlab-shop-card-brand__logo {
	flex-shrink: 0;
	width: var(--ms-brand-logo-size, 28px);
	height: var(--ms-brand-logo-size, 28px);
	border-radius: var(--ms-brand-logo-radius, 50%);
	overflow: hidden;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	border: 2px solid var(--ms-navy-soft);
	box-shadow: 0 2px 8px rgba(0, 74, 115, 0.18);
}

.medlab-shop-card-brand__logo img {
	width: 100% !important;
	height: 100% !important;
	aspect-ratio: auto !important;
	object-fit: contain !important;
	padding: 0 !important;
	margin: 0 !important;
	border: 0 !important;
	background: #fff !important;
	border-radius: var(--ms-brand-logo-radius, 50%);
	transform: none !important;
}

.medlab-shop-card-brand__logo--fallback {
	background: linear-gradient(145deg, var(--ms-navy), #0070ad);
	color: #fff;
	font-weight: 800;
	font-size: 0.95rem;
	border-color: transparent;
}

.medlab-shop-card-brand__name {
	font-size: 0.82rem;
	font-weight: 700;
	color: var(--ms-navy);
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.medlab-shop-card-brand__link:hover .medlab-shop-card-brand__name {
	color: var(--ms-navy-deep);
}

/* Product image area */
.medlab-shop ul.products li.product > a.woocommerce-LoopProduct-link {
	display: flex;
	flex-direction: column;
}

.medlab-shop ul.products li.product .medlab-shop-card-photo {
	width: 100%;
	margin: 0;
}

.medlab-shop--style-classic ul.products li.product .medlab-shop-card-photo {
	width: min(72%, 168px);
	margin: 12px auto 0;
}

.medlab-shop ul.products li.product .medlab-shop-card-photo > img {
	margin: 0 !important;
	width: 100% !important;
	max-width: 100% !important;
	height: auto !important;
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: 0;
	padding: 0;
	border: 0;
	background: #f4f7fa;
	box-shadow: none;
	transition: transform 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease, border-color 0.3s ease;
}

.medlab-shop--style-classic ul.products li.product .medlab-shop-card-photo > img {
	border-radius: 50%;
	background:
		radial-gradient(circle at 80% 20%, rgba(245, 130, 32, 0.1), transparent 40%),
		radial-gradient(circle at 20% 80%, rgba(0, 74, 115, 0.1), transparent 42%),
		linear-gradient(180deg, #f3f8fb 0%, #eef4f8 100%);
	padding: 10px;
	border: 2px solid #e4eef4;
	box-shadow: 0 8px 22px rgba(0, 74, 115, 0.08);
}

.medlab-shop ul.products li.product:hover .medlab-shop-card-photo > img,
.medlab-shop ul.products li.product:hover > a > img {
	transform: none;
}

.medlab-shop--style-classic ul.products li.product:hover .medlab-shop-card-photo > img {
	transform: scale(1.04);
	border-color: rgba(0, 74, 115, 0.25);
	box-shadow: 0 12px 28px rgba(0, 74, 115, 0.14);
}

.medlab-shop ul.products li.product .woocommerce-loop-product__title {
	padding: 16px 16px 8px;
	font-size: var(--ms-title-size, 1rem);
	font-weight: 800;
	color: var(--ms-title-color, var(--ms-navy));
	line-height: 1.5;
	margin: 0 !important;
	transition: color 0.2s ease;
	text-align: right;
}

.medlab-shop ul.products li.product:hover .woocommerce-loop-product__title {
	color: var(--ms-title-hover-color, var(--ms-navy-deep));
}

.medlab-shop ul.products li.product .price {
	display: block;
	width: 100%;
	padding: 0 16px 4px;
	color: var(--ms-price-color, var(--ms-navy));
	font-weight: 800;
	font-size: var(--ms-price-size, 1.08rem);
	margin-bottom: 14px !important;
	letter-spacing: 0;
	text-align: right;
}

.medlab-shop ul.products li.product .price .medlab-price,
.medlab-shop .medlab-price {
	display: inline-grid !important;
	grid-template-columns: auto auto;
	grid-auto-flow: column;
	align-items: baseline;
	column-gap: 0.35em;
	direction: ltr !important;
	unicode-bidi: isolate;
}

.medlab-shop ul.products li.product .price .medlab-price .woocommerce-Price-currencySymbol,
.medlab-shop .medlab-price .woocommerce-Price-currencySymbol {
	grid-column: 1;
	color: var(--ms-accent);
	font-size: 0.88em;
	font-weight: 800;
}

.medlab-shop ul.products li.product .price .medlab-price__num,
.medlab-shop .medlab-price .medlab-price__num {
	grid-column: 2;
	font-variant-numeric: tabular-nums;
	unicode-bidi: isolate;
}

.medlab-shop ul.products li.product .price del {
	color: #9ca3af;
	font-weight: 600;
	font-size: 0.88rem;
}

.medlab-shop ul.products li.product .price del .woocommerce-Price-currencySymbol {
	color: #9ca3af;
}

.medlab-shop ul.products li.product .price ins {
	text-decoration: none;
}

.medlab-shop ul.products li.product .button,
.medlab-shop ul.products li.product a.button {
	margin: auto 0 0 !important;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	align-self: center;
	justify-self: center;
	width: var(--ms-cart-width, 90%);
	max-width: 100%;
	box-sizing: border-box;
	min-height: 44px;
	border-radius: var(--ms-cart-radius, 12px) !important;
	background: var(--ms-cart-bg, var(--ms-accent)) !important;
	color: var(--ms-cart-color, #fff) !important;
	border-style: solid !important;
	border-width: var(--ms-cart-border-width, 0) !important;
	border-color: var(--ms-cart-border-color, transparent) !important;
	font-weight: 800 !important;
	font-size: var(--ms-cart-size, 0.95rem) !important;
	text-align: center;
	box-shadow: var(--ms-cart-shadow, none);
	transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, color 0.2s ease, border-color 0.2s ease !important;
}

.medlab-shop ul.products li.product .button:hover,
.medlab-shop ul.products li.product a.button:hover {
	background: var(--ms-cart-hover-bg, var(--ms-accent-hover)) !important;
	color: var(--ms-cart-hover-color, #fff) !important;
	border-color: var(--ms-cart-hover-border-color, var(--ms-cart-border-color, transparent)) !important;
	box-shadow: var(--ms-cart-hover-shadow, none);
	transform: none;
}

.medlab-shop .woocommerce-pagination {
	max-width: 1240px;
	margin: 0 auto 48px;
	padding: 0 20px;
	text-align: center;
}

.medlab-shop .woocommerce-pagination ul {
	border: 0;
	display: inline-flex;
	gap: 6px;
}

.medlab-shop .woocommerce-pagination ul li {
	border: 0;
}

.medlab-shop .woocommerce-pagination ul li a,
.medlab-shop .woocommerce-pagination ul li span {
	min-width: 40px;
	min-height: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 10px;
	border: 1px solid var(--ms-line);
	background: #fff;
	color: var(--ms-navy);
	font-weight: 700;
}

.medlab-shop .woocommerce-pagination ul li span.current {
	background: var(--ms-navy);
	border-color: var(--ms-navy);
	color: #fff;
}

.medlab-shop .woocommerce-info {
	max-width: 1240px;
	margin: 0 auto 32px;
	border-radius: 12px;
}

@media (max-width: 1100px) {
	.medlab-shop ul.products {
		--ms-cols: 3;
	}
}

@media (max-width: 800px) {
	.medlab-shop-advanced__grid {
		grid-template-columns: 1fr;
	}

	.medlab-shop ul.products {
		--ms-cols: 2;
		--ms-col-gap: 14px;
		--ms-row-gap: 14px;
	}

	.medlab-shop-toolbar__ordering {
		margin-right: 0;
		width: 100%;
	}

	.medlab-shop-toolbar__search input[type="search"] {
		border-radius: 12px 12px 0 0;
		border-left: 1px solid var(--ms-line);
	}

	.medlab-shop-toolbar__search {
		flex-direction: column;
	}

	.medlab-shop-toolbar__submit {
		border-radius: 0 0 12px 12px !important;
		width: 100%;
	}

	.medlab-shop-toolbar__advanced {
		width: 100%;
	}
}

@media (max-width: 520px) {
	.medlab-shop ul.products {
		--ms-cols: 1;
	}

	.medlab-shop-toolbar__advanced {
		width: 100%;
	}
}
