/**
 * Дополнительные стили дочерней темы Woodmart.
 * Файл подключается с версией по времени изменения, поэтому правки не застревают в кэше браузера.
 */

:root {
	--ek-card-radius: 12px;
	--ek-card-title-lines: 2;
	--ek-card-title-line-height: 1.35;
}

/* --------------------------------------------------------------------------
 * Ровная сетка категорий
 * -------------------------------------------------------------------------- */

.wd-cats .category-grid-item,
.products .category-grid-item {
	display: flex;
	height: auto;
}

.wd-cats .category-grid-item .wd-cat-wrap,
.products .category-grid-item .wd-cat-wrap,
.wd-cats .category-grid-item .wd-cat-inner,
.products .category-grid-item .wd-cat-inner {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	width: 100%;
	height: 100%;
}

.wd-cats .category-grid-item .wd-cat-thumb,
.products .category-grid-item .wd-cat-thumb {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 1 / 1;
	overflow: hidden;
}

.wd-cats .category-grid-item .wd-cat-image,
.products .category-grid-item .wd-cat-image {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}

.wd-cats .category-grid-item .wd-cat-thumb img,
.products .category-grid-item .wd-cat-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center;
}

.wd-cats .category-grid-item .wd-cat-content,
.products .category-grid-item .wd-cat-content {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	justify-content: center;
}

.wd-cats .category-grid-item .wd-entities-title,
.products .category-grid-item .wd-entities-title {
	display: -webkit-box;
	min-height: calc(
		var(--ek-card-title-lines) * var(--ek-card-title-line-height) * 1em
	);
	max-height: calc(
		var(--ek-card-title-lines) * var(--ek-card-title-line-height) * 1em
	);
	margin-top: 0;
	margin-bottom: 0;
	overflow: hidden;
	line-height: var(--ek-card-title-line-height);
	text-overflow: ellipsis;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: var(--ek-card-title-lines);
}

/* --------------------------------------------------------------------------
 * Ровная сетка товаров
 * -------------------------------------------------------------------------- */

.wd-products .product-grid-item {
	display: flex;
	height: auto;
}

.wd-products .product-grid-item .product-wrapper {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	width: 100%;
	height: 100%;
}

.wd-products .product-grid-item .product-element-top {
	position: relative;
	flex: 0 0 auto;
	width: 100%;
	aspect-ratio: 1 / 1;
	overflow: hidden;
}

.wd-products .product-grid-item .product-image-link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}

.wd-products .product-grid-item .product-image-link img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center;
}

.wd-products .product-grid-item .product-element-bottom {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
}

.wd-products .product-grid-item .wd-entities-title {
	display: -webkit-box;
	min-height: calc(
		var(--ek-card-title-lines) * var(--ek-card-title-line-height) * 1em
	);
	max-height: calc(
		var(--ek-card-title-lines) * var(--ek-card-title-line-height) * 1em
	);
	overflow: hidden;
	line-height: var(--ek-card-title-line-height);
	text-overflow: ellipsis;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: var(--ek-card-title-lines);
}

.wd-products .product-grid-item .wd-product-footer,
.wd-products .product-grid-item .wrap-price,
.wd-products .product-grid-item .wd-add-btn {
	margin-top: auto;
}

/* --------------------------------------------------------------------------
 * Цена по запросу
 * -------------------------------------------------------------------------- */

.ek-price-on-request {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 30px;
	padding: 6px 10px;
	color: #175eb8;
	background: #eef5ff;
	border: 1px solid rgba(23, 94, 184, 0.2);
	border-radius: 6px;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: 0.025em;
	text-align: center;
	text-transform: uppercase;
}

.single-product .summary .ek-price-on-request {
	min-height: 34px;
	padding: 7px 12px;
	font-size: 12px;
}

.ek-price-placeholder {
	display: inline-block;
	min-width: 14px;
	color: #667085;
	font-size: 18px;
	font-weight: 500;
	line-height: 1;
	text-align: center;
}

.ek-price-request-text {
	color: #475467;
	font-weight: 600;
}

.ek-price-request-notice {
	position: relative;
	margin: 14px 0;
	padding: 12px 14px 12px 42px;
	color: #344054;
	background: #f4f7fa;
	border: 1px solid #e5eaf0;
	border-radius: 9px;
	font-size: 13px;
	line-height: 1.45;
}

.ek-price-request-notice::before {
	position: absolute;
	top: 12px;
	left: 13px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	color: #175eb8;
	background: #e5effd;
	border-radius: 50%;
	content: "i";
	font-size: 12px;
	font-weight: 800;
	font-style: normal;
}

.woocommerce-mini-cart .ek-price-request-notice {
	margin: 12px 0;
	padding: 10px 11px 10px 37px;
	font-size: 12px;
}

.woocommerce-mini-cart .ek-price-request-notice::before {
	top: 10px;
	left: 10px;
}

.ek-price-request-notice-row > td {
	padding-top: 8px !important;
	padding-bottom: 8px !important;
	border-bottom: 0 !important;
}

.ek-price-request-notice-row .ek-price-request-notice {
	margin: 0;
}

/* --------------------------------------------------------------------------
 * Загрузка реквизитов в оформлении заказа
 * -------------------------------------------------------------------------- */

.woocommerce-checkout .woocommerce-billing-fields__field-wrapper {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

.woocommerce-checkout .woocommerce-billing-fields__field-wrapper .form-row {
	float: none;
	width: auto;
	margin: 0;
}

.woocommerce-checkout #billing_first_name_field {
	grid-column: 1 / -1;
}

.woocommerce-checkout .woocommerce-additional-fields {
	display: none;
}

.ek-requisites-field {
	margin: 22px 0;
	padding: 18px;
	background: #f7f8f9;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: var(--ek-card-radius);
}

.ek-requisites-field label {
	display: block;
	margin-bottom: 8px;
	font-weight: 700;
}

.ek-requisites-field input[type="file"] {
	display: block;
	width: 100%;
	padding: 10px;
	background: #fff;
	border: 1px dashed rgba(0, 0, 0, 0.25);
	border-radius: 8px;
}

.ek-requisites-help,
.ek-requisites-status {
	margin: 8px 0 0;
	font-size: 12px;
	line-height: 1.45;
}

.ek-requisites-status.is-loading {
	color: #7a5b00;
}

.ek-requisites-status.is-success {
	color: #157347;
}

.ek-requisites-status.is-error {
	color: #b42318;
}

/* --------------------------------------------------------------------------
 * Увеличение изображений из описания товара
 * -------------------------------------------------------------------------- */

.woocommerce-Tabs-panel--description a:has(> img),
.woocommerce-product-details__short-description a:has(> img) {
	cursor: zoom-in;
}

.ek-lightbox {
	position: fixed !important;
	z-index: 2147483000 !important;
	inset: 0 !important;
	display: flex !important;
	align-items: stretch !important;
	justify-content: stretch !important;
	box-sizing: border-box !important;
	width: 100vw !important;
	height: 100vh !important;
	margin: 0 !important;
	padding: 62px 88px !important;
	visibility: hidden;
	background: rgba(10, 14, 19, 0.94) !important;
	opacity: 0;
	pointer-events: none;
	transition:
		opacity 180ms ease,
		visibility 180ms ease;
}

.ek-lightbox.is-open {
	visibility: visible;
	opacity: 1;
	pointer-events: auto;
}

.ek-lightbox__stage {
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 100% !important;
	height: 100% !important;
	min-width: 0 !important;
	min-height: 0 !important;
}

.ek-lightbox__image {
	display: block !important;
	max-width: 100% !important;
	max-height: 100% !important;
	width: auto !important;
	height: auto !important;
	margin: 0 !important;
	padding: 0 !important;
	object-fit: contain !important;
	background: #fff;
	border: 0 !important;
	border-radius: 3px;
	box-shadow: 0 22px 70px rgba(0, 0, 0, 0.45) !important;
	user-select: none;
}

.ek-lightbox__close,
.ek-lightbox__prev,
.ek-lightbox__next {
	all: unset !important;
	position: fixed !important;
	z-index: 2147483001 !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	box-sizing: border-box !important;
	width: 46px !important;
	height: 46px !important;
	margin: 0 !important;
	padding: 0 !important;
	color: #fff !important;
	background: rgba(255, 255, 255, 0.12) !important;
	border: 1px solid rgba(255, 255, 255, 0.2) !important;
	border-radius: 50% !important;
	box-shadow: 0 8px 26px rgba(0, 0, 0, 0.22) !important;
	cursor: pointer !important;
	transition:
		background-color 160ms ease,
		border-color 160ms ease,
		transform 160ms ease !important;
	appearance: none !important;
}

.ek-lightbox__close svg,
.ek-lightbox__prev svg,
.ek-lightbox__next svg {
	display: block !important;
	width: 22px !important;
	height: 22px !important;
	margin: 0 !important;
	fill: none !important;
	stroke: currentColor !important;
	stroke-width: 2 !important;
	stroke-linecap: round !important;
	stroke-linejoin: round !important;
}

.ek-lightbox__close:hover,
.ek-lightbox__prev:hover,
.ek-lightbox__next:hover {
	color: #fff !important;
	background: rgba(255, 255, 255, 0.22) !important;
	border-color: rgba(255, 255, 255, 0.34) !important;
}

.ek-lightbox__close {
	top: 18px !important;
	right: 20px !important;
	bottom: auto !important;
	left: auto !important;
}

.ek-lightbox__prev,
.ek-lightbox__next {
	top: 50% !important;
	bottom: auto !important;
	transform: translateY(-50%) !important;
}

.ek-lightbox__prev:hover,
.ek-lightbox__next:hover {
	transform: translateY(-50%) scale(1.05) !important;
}

.ek-lightbox__prev {
	right: auto !important;
	left: 22px !important;
}

.ek-lightbox__next {
	right: 22px !important;
	left: auto !important;
}

.ek-lightbox [hidden] {
	display: none !important;
}

.ek-lightbox__counter {
	position: fixed !important;
	z-index: 2147483001 !important;
	bottom: 18px !important;
	left: 50% !important;
	display: block !important;
	min-width: 46px;
	padding: 6px 10px;
	color: rgba(255, 255, 255, 0.9) !important;
	background: rgba(255, 255, 255, 0.1);
	border-radius: 999px;
	font-size: 12px !important;
	line-height: 1 !important;
	text-align: center;
	transform: translateX(-50%) !important;
}

body.ek-lightbox-open {
	overflow: hidden !important;
}

@media (max-width: 767px) {
	:root {
		--ek-card-title-lines: 3;
	}

	.ek-price-on-request {
		min-height: 28px;
		padding: 5px 8px;
		font-size: 10px;
	}

	.woocommerce-checkout .woocommerce-billing-fields__field-wrapper {
		grid-template-columns: minmax(0, 1fr);
		gap: 13px;
	}

	.woocommerce-checkout #billing_first_name_field {
		grid-column: auto;
	}

	.ek-lightbox {
		padding: 64px 12px 78px !important;
	}

	.ek-lightbox__close,
	.ek-lightbox__prev,
	.ek-lightbox__next {
		width: 42px !important;
		height: 42px !important;
	}

	.ek-lightbox__prev,
	.ek-lightbox__next {
		top: auto !important;
		bottom: 17px !important;
		transform: none !important;
	}

	.ek-lightbox__prev:hover,
	.ek-lightbox__next:hover {
		transform: scale(1.05) !important;
	}

	.ek-lightbox__prev {
		left: calc(50% - 54px) !important;
	}

	.ek-lightbox__next {
		right: calc(50% - 54px) !important;
	}

	.ek-lightbox__counter {
		right: auto !important;
		bottom: 29px !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ek-lightbox,
	.ek-lightbox__close,
	.ek-lightbox__prev,
	.ek-lightbox__next {
		transition: none;
	}
}
