/* ==========================================================================
   Megavar Custom Product Gallery — styles
   Covers: [custom_product_gallery], [megavar_category_product_grid],
           [megavar_category_nav], [megavar_case_study_link]
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. [custom_product_gallery] — full gallery with filter sidebar
   -------------------------------------------------------------------------- */

.mcpg-container {
	display: flex;
	gap: 40px;
	width: 100%;
}

.mcpg-sidebar {
	flex-shrink: 0;
	width: 240px;
}

.mcpg-products {
	flex: 1;
	min-width: 0;
}

.mcpg-grid {
	display: grid;
	gap: 32px;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.mcpg-grid ul,
.mcpg-grid li {
	list-style: none;
	margin: 0;
	padding: 0;
}

.mcpg-grid .product {
	display: flex;
	flex-direction: column;
	text-align: left;
}

.mcpg-grid .product h2 {
	font-size: 14px;
	line-height: 1.3;
	text-align: left;
}

.mcpg-grid .product .price,
.mcpg-grid .product .button {
	display: inline-block;
	margin-top: 10px;
}

.mcpg-grid .product .button {
	background: #1a1a1a;
	border: none;
	border-radius: 4px;
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	padding: 8px 14px;
	text-decoration: none;
	transition: background 0.2s;
}

.mcpg-grid .product .button:hover {
	background: #333333;
}

.mcpg-item {
	box-sizing: border-box;
	display: block;
	width: 100%;
}

.mcpg-hidden {
	display: none;
}

/* Grid image normalisation */
.mcpg-grid .product img,
.mcpg-grid .mcpg-product-image-wrapper img {
	display: block;
	height: auto;
	max-width: 100%;
	object-fit: cover;
	width: 100%;
}

/* Load More */
#mcpg-load-more {
	background: #75CEDE;
	border: none;
	border-radius: 4px;
	color: #1a1a1a;
	cursor: pointer;
	display: block;
	font-size: 14px;
	font-weight: 600;
	margin: 30px auto 0;
	padding: 12px 28px;
	transition: background 0.2s;
}

#mcpg-load-more:hover {
	background: #3a8fa0;
	color: #fff;
}

/* Grid header (filter toggle + apply on mobile) */
.mcpg-grid-header {
	display: none;
}

/* Pagination */
.mcpg-pagination {
	margin-top: 24px;
	text-align: center;
}

/* --------------------------------------------------------------------------
   Filters
   -------------------------------------------------------------------------- */

.mcpg-filters {
	font-family: inherit;
}

.mcpg-filter-group {
	background: #fff;
	border: 1px solid #e4e4e4;
	border-radius: 8px;
	margin-bottom: 14px;
	padding: 16px;
}

.mcpg-filter-title {
	color: #1a1a1a;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.04em;
	margin: 0 0 10px;
	text-transform: uppercase;
}

.mcpg-filter-label {
	align-items: center;
	color: #1a1a1a;
	cursor: pointer;
	display: flex;
	font-size: 14px;
	gap: 8px;
	margin-bottom: 8px;
}

.mcpg-filter-label input[type="checkbox"] {
	flex-shrink: 0;
	height: 16px;
	margin: 0;
	width: 16px;
}

.mcpg-filter-apply {
	background: #1a1a1a;
	border: none;
	border-radius: 6px;
	color: #fff;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	margin-top: 4px;
	padding: 10px;
	transition: background 0.2s;
	width: 100%;
}

.mcpg-filter-apply:hover {
	background: #333333;
}

/* Mobile filter toggle */
.mcpg-filter-toggle {
	display: none;
}

#mcpg-filter-toggle {
	align-items: center;
	background: #1a1a1a;
	border: none;
	border-radius: 6px;
	color: #fff;
	cursor: pointer;
	display: none;
	height: 40px;
	justify-content: center;
	padding: 6px;
	width: 40px;
}

#mcpg-filter-toggle svg {
	height: 18px;
	width: 18px;
}

#mcpg-apply-filters-top {
	display: none;
}

/* Overlay (mobile) */
#mcpg-overlay {
	background: rgba(0, 0, 0, 0.35);
	inset: 0;
	opacity: 0;
	position: fixed;
	transition: opacity 0.18s ease, visibility 0.18s ease;
	visibility: hidden;
	z-index: 9990;
}

#mcpg-overlay.open {
	opacity: 1;
	visibility: visible;
}

/* --------------------------------------------------------------------------
   2. [megavar_category_product_grid] — Block 2b Section 2.2
   -------------------------------------------------------------------------- */

.mcpg-category-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 24px;
	width: 100%;
}

.mcpg-product-card {
	background: #fff;
	border: 1px solid #e4e4e4;
	border-radius: 6px;
	display: flex;
	flex: 0 0 calc(25% - 18px);
	flex-direction: column;
	max-width: calc(25% - 18px);
	min-width: 180px;
	overflow: hidden;
	transition: box-shadow 0.2s ease;
}

.mcpg-product-card:hover {
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.09);
}

.mcpg-product-card__image-link {
	aspect-ratio: 4 / 3;
	background: #f5f5f5;
	display: block;
	overflow: hidden;
}

.mcpg-product-card__image {
	height: 100%;
	object-fit: cover;
	object-position: center;
	width: 100%;
}

.mcpg-product-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 8px;
	padding: 14px;
}

.mcpg-product-card__chip {
	align-self: flex-start;
	background: #f0f9fb;
	border-radius: 3px;
	color: #3a8fa0;
	display: inline-block;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.04em;
	padding: 3px 8px;
	text-transform: uppercase;
}

.mcpg-product-card__title {
	color: #1a1a1a;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	margin: 0;
}

.mcpg-product-card__title a {
	color: inherit;
	text-decoration: none;
}

.mcpg-product-card__title a:hover {
	color: #3a8fa0;
}

.mcpg-product-card__application {
	color: #666666;
	font-size: 12px;
	line-height: 1.4;
	margin: 0;
}

.mcpg-product-card__rate {
	color: #555555;
	font-size: 13px;
	font-weight: 500;
	margin: 0;
}

.mcpg-product-card__cta {
	align-self: flex-start;
	background: #1a1a1a;
	border-radius: 4px;
	color: #ffffff;
	display: inline-block;
	font-size: 13px;
	font-weight: 600;
	margin-top: auto;
	padding: 8px 14px;
	text-decoration: none;
	transition: background 0.2s;
}

.mcpg-product-card__cta:hover {
	background: #333333;
	color: #ffffff;
	text-decoration: none;
}

/* --------------------------------------------------------------------------
   3. [megavar_category_nav] + brand filter — Block 2b Section 2.4
   Desktop: vertical list (place in Elementor sidebar column).
   Mobile: horizontal scrolling strip.
   -------------------------------------------------------------------------- */

.mcpg-category-nav {
	width: 100%;
}

.mcpg-category-nav__list {
	display: flex;
	flex-direction: column;
	gap: 2px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.mcpg-category-nav__item {
	margin: 0;
}

.mcpg-category-nav__link {
	border-radius: 4px;
	color: #1a1a1a;
	display: block;
	font-size: 14px;
	font-weight: 500;
	padding: 10px 14px;
	text-decoration: none;
	transition: background 0.15s, color 0.15s;
}

.mcpg-category-nav__link:hover {
	background: #f0f9fb;
	color: #3a8fa0;
}

.mcpg-category-nav__link--active {
	background: #75CEDE;
	color: #fff;
	cursor: default;
	font-weight: 700;
}

.mcpg-category-nav__link--active:hover {
	background: #75CEDE;
	color: #fff;
}

/* Sidebar nav sections */

.mcpg-sidebar-nav {
	display: flex;
	flex-direction: column;
	gap: 28px;
}

.mcpg-sidebar-nav__section {
	display: flex;
	flex-direction: column;
}

.mcpg-sidebar-nav__title {
	color: #1a1a1a !important;
	font-size: 17px;
	font-weight: 700;
	letter-spacing: 0.06em;
	margin: 0 0 8px;
	padding: 0 4px;
	text-transform: uppercase;
}

.mcpg-brand-filter__header {
	align-items: center;
	display: flex;
	justify-content: space-between;
	margin-bottom: 10px;
}

.mcpg-brand-filter__title {
	color: #1a1a1a !important;
	font-size: 17px;
	font-weight: 700;
	letter-spacing: 0.04em;
	margin: 0;
	text-transform: uppercase;
}

.mcpg-brand-filter__clear {
	background: none;
	border: none;
	color: #3a8fa0;
	cursor: pointer;
	font-size: 12px;
	font-weight: 600;
	padding: 0;
	text-decoration: underline;
}

.mcpg-brand-filter__clear:hover {
	color: #1a6070;
}

.mcpg-brand-filter__list {
	display: flex;
	flex-direction: column;
	gap: 6px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.mcpg-brand-filter__item {
	margin: 0;
}

.mcpg-brand-filter__label {
	align-items: center;
	color: #1a1a1a;
	cursor: pointer;
	display: flex;
	font-size: 14px;
	gap: 8px;
}

.mcpg-brand-filter__label input[type="checkbox"] {
	accent-color: #75CEDE;
	flex-shrink: 0;
	height: 16px;
	margin: 0;
	width: 16px;
}

/* --------------------------------------------------------------------------
   4. [megavar_case_study_link] — Block 2b Section 2.6
      Renders: authority lead paragraph + optional case study link line.
   -------------------------------------------------------------------------- */

.mcpg-category-content {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.mcpg-authority-lead {
	color: #1a1a1a;
	font-size: 15px;
	line-height: 1.7;
}

.mcpg-authority-lead p {
	margin: 0 0 1em;
}

.mcpg-authority-lead p:last-child {
	margin-bottom: 0;
}

.mcpg-case-study-link {
	background: #f0f9fb;
	border-left: 4px solid #75CEDE;
	border-radius: 0 4px 4px 0;
	margin: 20px 0;
	padding: 12px 16px;
}

.mcpg-case-study-link__text {
	color: #1a1a1a;
	font-size: 14px;
	line-height: 1.5;
	margin: 0;
}

.mcpg-case-study-link__anchor {
	color: #3a8fa0;
	font-weight: 600;
	text-decoration: none;
}

.mcpg-case-study-link__anchor:hover {
	text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Mobile — ≤ 768px
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {

	/* Gallery: stack sidebar below on small screens */
	.mcpg-container {
		flex-direction: column;
		gap: 20px;
	}

	.mcpg-sidebar {
		background: #fff;
		border-radius: 10px;
		box-shadow: 0 6px 30px rgba(0, 0, 0, 0.16);
		left: 8px;
		max-height: calc(100vh - 100px);
		max-width: 420px;
		opacity: 0;
		overflow: auto;
		padding: 18px;
		pointer-events: none;
		position: fixed;
		right: auto;
		top: 60px;
		transform: translateY(-6px) scale(0.98);
		transition: opacity 0.2s ease, transform 0.2s ease;
		width: 100%;
		z-index: 9999;
	}

	.mcpg-sidebar.open {
		opacity: 1;
		pointer-events: auto;
		transform: translateY(0) scale(1);
	}

	.mcpg-grid-header {
		align-items: center;
		display: flex;
		gap: 8px;
		margin-bottom: 12px;
	}

	.mcpg-filter-toggle,
	#mcpg-filter-toggle {
		display: inline-flex;
	}

	#mcpg-apply-filters-top {
		background: #75CEDE;
		border: none;
		border-radius: 6px;
		color: #1a1a1a;
		cursor: pointer;
		display: inline-block;
		font-size: 13px;
		font-weight: 600;
		padding: 8px 14px;
	}

	.mcpg-grid {
		gap: 16px;
		grid-template-columns: repeat(2, 1fr);
	}

	/* Category product grid: 2 columns on tablet */
	.mcpg-product-card {
		flex: 0 0 calc(50% - 12px);
		max-width: calc(50% - 12px);
	}

	/* Category nav: horizontal scrolling strip */
	.mcpg-category-nav__list {
		flex-direction: row;
		flex-wrap: nowrap;
		gap: 8px;
		-webkit-overflow-scrolling: touch;
		overflow-x: auto;
		padding-bottom: 4px;
		scrollbar-width: none;
	}

	.mcpg-category-nav__list::-webkit-scrollbar {
		display: none;
	}

	.mcpg-category-nav__item {
		flex-shrink: 0;
	}

	.mcpg-category-nav__link {
		border: 1px solid #e4e4e4;
		padding: 6px 14px;
		white-space: nowrap;
	}

	.mcpg-category-nav__link--active {
		border-color: #75CEDE;
	}

	/* Filters two-column on mobile */
	.mcpg-filters .mcpg-filter-group {
		display: grid;
		gap: 6px 12px;
		grid-template-columns: repeat(2, 1fr);
	}

	.mcpg-filter-title {
		grid-column: 1 / -1;
	}
}

@media (max-width: 480px) {
	.mcpg-product-card {
		flex: 0 0 100%;
		max-width: 100%;
	}

	.mcpg-grid {
		grid-template-columns: 1fr;
	}
}
