/**
 * Products Grid with Variants — responsive styles
 * Columns/gaps set via CSS vars (--pgv-cols, --pgv-gap-*) from Elementor.
 *
 * Mobile note: hero images are absolutely positioned. Prefer the padding-bottom
 * aspect box (works on older WebKit / Android WebViews) so cards never collapse
 * to 0 height — that collapse lets the footer wrap into empty grid space.
 */

.pgv-widget {
	display: block;
	position: relative;
	width: 100%;
	max-width: 100%;
	clear: both;
	isolation: isolate;
}

.pgv-grid {
	--pgv-cols: 2;
	--pgv-gap-row: 20px;
	--pgv-gap-col: 14px;
	display: grid !important;
	grid-template-columns: repeat(var(--pgv-cols), minmax(0, 1fr));
	gap: var(--pgv-gap-row) var(--pgv-gap-col);
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	clear: both;
	/* Prevent following footer/content from wrapping beside floated leftovers. */
	overflow: hidden;
}

.pgv-grid *,
.pgv-grid *::before,
.pgv-grid *::after {
	box-sizing: border-box;
}

.pgv-empty {
	grid-column: 1 / -1;
	margin: 0;
	padding: 24px 0;
	text-align: center;
	color: #666;
}

.pgv-card {
	display: flex !important;
	flex-direction: column;
	float: none !important;
	clear: none !important;
	position: relative;
	min-width: 0;
	width: 100% !important;
	max-width: 100%;
	margin: 0 !important;
	background: transparent;
	border: 0;
	box-shadow: none;
	/* Keep absolute children (hero img) tied to this card on WebKit. */
	transform: translateZ(0);
}

/* Hero image — padding-bottom aspect box (4:5).
 * Do NOT rely on aspect-ratio alone: some iOS/Android WebViews collapse
 * absolute-positioned children when the only height source is aspect-ratio. */
.pgv-widget .pgv-media {
	position: relative;
	display: block;
	overflow: hidden;
	background: #f3f3f3;
	width: 100%;
	height: 0;
	padding-bottom: 125%; /* 4 / 5 */
	aspect-ratio: unset;
	text-decoration: none;
	line-height: 0;
	touch-action: pan-y;
	cursor: pointer;
	user-select: none;
	-webkit-user-select: none;
	flex: 0 0 auto;
}

.pgv-widget .pgv-media:focus-visible {
	outline: 2px solid #222;
	outline-offset: 2px;
}

.pgv-widget .pgv-media-link {
	position: absolute;
	inset: 0;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	display: block;
	width: 100%;
	height: 100%;
	text-decoration: none;
	z-index: 1;
	cursor: pointer;
	overflow: hidden;
}

.pgv-widget .pgv-media .pgv-main-image {
	position: absolute !important;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	max-height: none !important;
	margin: 0 !important;
	padding: 0 !important;
	object-fit: cover !important;
	object-position: center center !important;
	user-select: none;
	-webkit-user-drag: none;
	pointer-events: none;
	opacity: 1 !important;
	z-index: 1;
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
}

/* Incoming frame — sits above primary, starts invisible */
.pgv-grid .pgv-media .pgv-main-image--fade {
	z-index: 2;
	opacity: 0 !important;
	transition: none;
}

.pgv-grid .pgv-media .pgv-main-image--fade.is-visible {
	opacity: 1 !important;
}

.pgv-badge {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 3;
	padding: 3px 8px;
	background: #e53935;
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.02em;
	line-height: 1.3;
	text-transform: uppercase;
	border-radius: 2px;
	pointer-events: none;
}

.pgv-body {
	display: flex;
	flex-direction: column;
	align-items: start;
	gap: 6px;
	padding-top: 10px;
	line-height: normal;
	min-width: 0;
	width: 100%;
	text-align: start;
	position: relative;
	z-index: 2;
	flex: 1 1 auto;
}

.pgv-title {
	margin: 0;
	padding: 0;
	width: 100%;
	font-size: clamp(12px, 2.8vw, 14px);
	font-weight: 500;
	line-height: 1.35;
	letter-spacing: 0;
	overflow-wrap: anywhere;
	word-break: break-word;
	text-align: inherit;
}

.pgv-title a {
	color: #222;
	text-decoration: none;
}

.pgv-title a:hover,
.pgv-title a:focus-visible {
	color: #111;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.pgv-price {
	width: 100%;
	font-size: clamp(12px, 2.8vw, 14px);
	font-weight: 600;
	line-height: 1.3;
	color: #222;
	text-align: inherit;
}

.pgv-price del {
	margin-right: 6px;
	opacity: 0.55;
	font-weight: 400;
	text-decoration: line-through;
}

.pgv-price ins {
	text-decoration: none;
	font-weight: 600;
}

.pgv-swatches {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-start;
	gap: 6px;
	margin-top: 4px;
	padding: 0;
	width: 100%;
}

.pgv-grid .pgv-swatch {
	appearance: none;
	-webkit-appearance: none;
	position: relative;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	min-width: 32px;
	min-height: 32px;
	padding: 0 !important;
	margin: 0 !important;
	border-style: solid;
	border-width: 2px;
	border-color: transparent;
	border-radius: 50%;
	background-color: #e8e8e8;
	background-size: cover;
	background-position: center;
	cursor: pointer;
	overflow: hidden !important;
	flex-shrink: 0;
	line-height: 0 !important;
	vertical-align: middle;
	box-shadow: none !important;
	transition: border-color 0.15s ease;
}

.pgv-grid .pgv-swatch .pgv-swatch-img,
.pgv-grid .pgv-swatch img {
	position: absolute !important;
	top: 0 !important;
	left: 0 !important;
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	max-height: none !important;
	margin: 0 !important;
	padding: 0 !important;
	object-fit: cover !important;
	border-radius: inherit;
	pointer-events: none !important;
	visibility: visible !important;
	opacity: 1 !important;
}

.pgv-grid .pgv-swatch:hover {
	border-color: rgba(0, 0, 0, 0.3);
}

.pgv-grid .pgv-swatch:focus-visible {
	outline: 2px solid #222;
	outline-offset: 2px;
}

.pgv-grid .pgv-swatch.is-active {
	border-color: #222;
}

.pgv-more {
	display: inline-flex;
	align-items: center;
	margin-left: 2px;
	font-size: 12px;
	font-weight: 500;
	line-height: 1;
	color: #555;
	white-space: nowrap;
}

/* Tablet */
@media (max-width: 1024px) {
	.pgv-grid {
		--pgv-cols: 3;
		--pgv-gap-row: 20px;
		--pgv-gap-col: 14px;
	}
}

/* Mobile — match reference 2-column shop */
@media (max-width: 767px) {
	.pgv-grid {
		--pgv-cols: 2;
		--pgv-gap-row: 16px;
		--pgv-gap-col: 10px;
	}

	.pgv-badge {
		top: 8px;
		left: 8px;
		padding: 2px 6px;
		font-size: 10px;
	}

	.pgv-body {
		gap: 4px;
		padding-top: 8px;
	}

	.pgv-swatches {
		gap: 5px;
	}

	.pgv-grid .pgv-swatch {
		width: 24px;
		height: 24px;
		min-width: 24px;
		min-height: 24px;
	}

	.pgv-more {
		font-size: 11px;
	}
}

/* Very small phones */
@media (max-width: 380px) {
	.pgv-grid {
		--pgv-gap-col: 8px;
		--pgv-gap-row: 14px;
	}

	.pgv-grid .pgv-swatch {
		width: 22px;
		height: 22px;
		min-width: 22px;
		min-height: 22px;
	}
}

/* Desktop comfort spacing when Elementor has not overridden gaps */
@media (min-width: 1025px) {
	.pgv-grid {
		--pgv-cols: 4;
		--pgv-gap-row: 28px;
		--pgv-gap-col: 20px;
	}

	.pgv-grid .pgv-swatch {
		width: 34px;
		height: 34px;
		min-width: 34px;
		min-height: 34px;
	}
}

.pgv-view-all {
	width: 100%;
	margin-top: 24px;
	text-align: center;
}

.pgv-view-all-link {
	display: inline-block;
	color: #222;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.pgv-view-all-link:hover,
.pgv-view-all-link:focus-visible {
	color: #111;
}

/* —— Carousel layout —— */
.pgv-widget .pgv-carousel {
	--pgv-cols: 4;
	--pgv-gap-col: 20px;
	position: relative;
	display: block;
	width: 100%;
	max-width: 100%;
}

.pgv-widget .pgv-carousel-shell {
	position: relative;
	display: block;
	width: 100%;
	padding: 0 48px;
	box-sizing: border-box;
}

.pgv-widget .pgv-carousel-viewport {
	display: block;
	overflow: hidden;
	width: 100%;
	touch-action: pan-y;
}

.pgv-widget .pgv-carousel-track {
	display: flex !important;
	flex-direction: row !important;
	flex-wrap: nowrap !important;
	align-items: stretch !important;
	gap: var(--pgv-gap-col);
	margin: 0;
	padding: 0;
	will-change: transform;
}

.pgv-widget .pgv-carousel-track .pgv-card {
	display: flex !important;
	flex-direction: column;
	min-width: 0;
	height: auto;
	align-self: stretch;
}

.pgv-widget .pgv-carousel-track .pgv-body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
}

.pgv-widget .pgv-carousel-track .pgv-title {
	min-height: 2.7em;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.pgv-widget .pgv-carousel-track .pgv-swatches {
	margin-top: auto;
}

.pgv-widget .pgv-carousel .pgv-carousel-btn {
	position: absolute !important;
	top: 36% !important;
	left: auto;
	right: auto;
	bottom: auto !important;
	z-index: 6;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 42px !important;
	height: 42px !important;
	min-width: 42px;
	min-height: 42px;
	margin: 0 !important;
	padding: 0 !important;
	border: 1px solid rgba(0, 0, 0, 0.12) !important;
	border-radius: 50% !important;
	background: #fff !important;
	color: #222 !important;
	font-size: 16px !important;
	line-height: 1 !important;
	cursor: pointer;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
	transform: translateY(-50%) !important;
	transition: background 0.2s ease, opacity 0.2s ease;
}

.pgv-widget .pgv-carousel .pgv-carousel-btn:hover:not(:disabled) {
	background: #f5f5f5 !important;
}

.pgv-widget .pgv-carousel .pgv-carousel-btn:disabled {
	opacity: 0.35;
	cursor: default;
}

.pgv-widget .pgv-carousel .pgv-carousel-prev {
	left: 0 !important;
	right: auto !important;
}

.pgv-widget .pgv-carousel .pgv-carousel-next {
	right: 0 !important;
	left: auto !important;
}

.pgv-widget .pgv-carousel-dots {
	display: flex;
	justify-content: center;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 18px;
}

.pgv-widget .pgv-carousel-dot {
	width: 8px;
	height: 8px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.2);
	cursor: pointer;
}

.pgv-widget .pgv-carousel-dot.is-active {
	background: #222;
}

@media (max-width: 767px) {
	.pgv-widget .pgv-carousel-shell {
		padding: 0 36px;
	}

	.pgv-widget .pgv-carousel .pgv-carousel-btn {
		width: 34px !important;
		height: 34px !important;
		min-width: 34px;
		min-height: 34px;
		font-size: 14px !important;
	}
}

/* Infinite scroll / load more */
.pgv-widget .pgv-scroll-sentinel {
	width: 100%;
	height: 1px;
	grid-column: 1 / -1;
	pointer-events: none;
}

.pgv-widget .pgv-scroll-loader {
	grid-column: 1 / -1;
	text-align: center;
	margin: 16px 0 0;
	font-size: 14px;
	color: rgba(0, 0, 0, 0.55);
}

.pgv-widget .pgv-scroll-loader[hidden] {
	display: none !important;
}

.pgv-widget .pgv-pagination {
	display: block;
	clear: both;
	width: 100%;
	margin-top: 28px;
	text-align: center;
	grid-column: 1 / -1;
}

.pgv-widget .pgv-pagination .page-numbers {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 6px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.pgv-widget .pgv-pagination .page-numbers li {
	display: inline-block;
	margin: 0;
}

.pgv-widget .pgv-pagination .page-numbers a,
.pgv-widget .pgv-pagination .page-numbers span {
	display: inline-block;
	min-width: 38px;
	padding: 8px 12px;
	border-radius: 4px;
	text-decoration: none;
	font-size: 14px;
	line-height: 1.2;
	color: #222;
	border: 1px solid rgba(0, 0, 0, 0.12);
	background: #fff;
}

.pgv-widget .pgv-pagination .page-numbers a:hover {
	border-color: rgba(0, 0, 0, 0.35);
}

.pgv-widget .pgv-pagination .page-numbers .current {
	font-weight: 600;
	border-color: #222;
	background: #222;
	color: #fff;
}
