/* Granxok — сетка категорий и товаров WooCommerce */

.granxok-wc-wrap {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	clear: both;
}

.granxok-categories,
.granxok-products {
	width: 100%;
	max-width: 100%;
	margin-bottom: 32px;
	box-sizing: border-box;
	overflow: visible;
	display: block;
	height: auto;
	min-height: 0;
}

.granxok-categories__grid,
.granxok-products__grid {
	display: grid;
	gap: 24px 20px;
	width: 100%;
}

.granxok-categories__grid {
	grid-template-columns: repeat(var(--granxok-cat-cols, 3), minmax(0, 1fr));
}

.granxok-products__grid {
	grid-template-columns: repeat(var(--granxok-product-cols, 3), minmax(0, 1fr));
}

.granxok-categories__item {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	min-width: 0;
	width: 100%;
}

.granxok-products__item {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	min-width: 0;
	width: 100%;
}

.granxok-categories__image {
	width: 100%;
	aspect-ratio: 4 / 5;
	background: #fff;
	border-radius: 4px;
	overflow: hidden;
}

.granxok-products__image {
	width: 100%;
	aspect-ratio: 3 / 4;
	background: #fff;
	border-radius: 4px;
	overflow: hidden;
	position: relative;
}

.granxok-products__badge {
	position: absolute;
	top: 70px;
	left: 14px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 8px 14px;
	border-radius: 999px;
	background: #d63031;
	color: #fff;
	font-family: Inter, sans-serif;
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	pointer-events: none;
}

.granxok-categories__image-link,
.granxok-products__image-link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	text-decoration: none;
}

.granxok-categories__img,
.granxok-products__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	object-position: center center;
}

.granxok-categories__title,
.granxok-products__title {
	display: inline-block;
	margin-top: 12px;
	font-family: Inter, sans-serif;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
	color: #1e1d1b;
	text-decoration: none;
	border-bottom: 2px solid transparent;
	transition: border-color 0.2s ease;
}

.granxok-categories__title:hover,
.granxok-categories__title:focus-visible,
.granxok-products__title:hover,
.granxok-products__title:focus-visible,
.granxok-categories__image-link:hover + .granxok-categories__title,
.granxok-products__image-link:hover + .granxok-products__title {
	border-bottom-color: #257785;
}

.granxok-products__price {
	margin-top: 8px;
	font-family: Inter, sans-serif;
	font-size: 15px;
	font-weight: 600;
	color: #257785;
}

.granxok-products__btn {
	display: block;
	width: 100%;
	margin-top: 16px;
	padding: 14px 20px;
	border-radius: 14px;
	background: #257785;
	color: #fff;
	font-family: Inter, sans-serif;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	transition: background-color 0.2s ease, opacity 0.2s ease;
	box-sizing: border-box;
}

.granxok-products__btn:hover,
.granxok-products__btn:focus-visible {
	background: #1e606b;
	color: #fff;
}

@media (max-width: 767px) {
	.granxok-wc-wrap {
		padding: 0 16px 48px;
		margin-bottom: 24px;
		position: relative;
		z-index: auto;
	}

	.granxok-categories,
	.granxok-products {
		--granxok-cat-cols: 1;
		--granxok-product-cols: 1;
		margin-bottom: 0;
	}

	.granxok-categories__grid,
	.granxok-products__grid {
		grid-template-columns: 1fr;
		gap: 24px;
	}

	.granxok-categories__image,
	.granxok-products__image {
		aspect-ratio: auto;
		height: auto;
	}

	.granxok-categories__image-link,
	.granxok-products__image-link {
		display: block;
		height: auto;
	}

	.granxok-categories__img,
	.granxok-products__img {
		width: 100%;
		height: auto;
	}

	/* Elementor-контейнеры не должны обрезать сетку и «наезжать» футером */
	.elementor-section:has(.granxok-wc-wrap),
	.elementor-container:has(.granxok-wc-wrap),
	.elementor-column:has(.granxok-wc-wrap),
	.elementor-widget-wrap:has(.granxok-wc-wrap),
	.elementor-widget-container:has(.granxok-wc-wrap),
	.elementor-element:has(.granxok-wc-wrap),
	.e-con:has(.granxok-wc-wrap),
	.e-con-inner:has(.granxok-wc-wrap),
	#content:has(.granxok-wc-wrap),
	.site-content:has(.granxok-wc-wrap),
	main:has(.granxok-wc-wrap) {
		height: auto !important;
		min-height: 0 !important;
		max-height: none !important;
		overflow: visible !important;
		contain: none !important;
	}
}
