/* WooCommerce ↔ Amerce: reset plugin markup that breaks template visuals */

.onyx-single-product .summary .price,
.onyx-single-product .product-infor-price .price {
	display: none !important;
}

.onyx-single-product a.price,
.onyx-single-product .woocommerce-Price-amount {
	text-decoration: none !important;
}

.onyx-single-product .star-rating {
	display: none !important;
}

.onyx-single-product .variations .label {
	font-weight: 500;
	vertical-align: top;
	padding-top: 0.5rem;
}

.onyx-single-product .variations select {
	width: 100%;
	max-width: 280px;
}

.onyx-single-product .woocommerce-variation-add-to-cart .quantity,
.onyx-single-product form.cart .quantity {
	display: none !important;
}

.onyx-single-product .quantity-product {
	text-align: center;
	border: none;
	background: transparent;
	width: 100%;
	max-width: 3rem;
	padding: 0;
}

.onyx-single-product .single_add_to_cart_button.button {
	background: var(--primary, #000);
	border: none;
}

/* ---------------------------------------------------------------
   Order volume picker (BRIEF rev.4): both tiers visible at once,
   the native WooCommerce select stays in the DOM but out of sight.
   --------------------------------------------------------------- */

.onyx-variant-native,
.onyx-single-product .onyx-variant-native {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
	padding: 0;
	margin: -1px;
}

.onyx-variant-picker {
	margin-bottom: 1.25rem;
}

.onyx-variant-picker__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 10px;
}

.onyx-variant-picker__label {
	font-weight: 600;
	color: var(--text, #101010);
}

.onyx-variant-picker__value {
	color: var(--text-2, #696e73);
}

.onyx-variant-picker__tiers {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}

.onyx-variant-picker .onyx-tier {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
	width: 100%;
	padding: 14px 16px;
	text-align: left;
	background: var(--white, #fff);
	border: 1px solid var(--line, #e9e9e9);
	border-radius: 4px;
	color: var(--text, #101010);
	cursor: pointer;
	transition: all 0.3s ease;
}

.onyx-variant-picker .onyx-tier:hover {
	border-color: var(--text, #101010);
}

.onyx-variant-picker .onyx-tier:focus-visible {
	outline: 2px solid var(--primary, #dc4646);
	outline-offset: 2px;
}

.onyx-variant-picker .onyx-tier.is-active {
	background: var(--text, #101010);
	border-color: var(--text, #101010);
	color: var(--white, #fff);
}

.onyx-variant-picker .onyx-tier.is-disabled {
	opacity: 0.3;
	pointer-events: none;
	cursor: not-allowed;
}

.onyx-tier__title {
	font-size: 14px;
	line-height: 1.3;
}

.onyx-tier__price {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 4px;
	background: var(--bg, #f7f7f7);
	color: var(--text, #101010);
	font-weight: 600;
	line-height: 1.4;
}

.onyx-tier__price .woocommerce-Price-amount {
	color: inherit;
	font-weight: inherit;
}

.onyx-variant-picker .onyx-tier.is-active .onyx-tier__price {
	background: rgba(255, 255, 255, 0.16);
	color: var(--white, #fff);
}

@media (max-width: 575px) {
	.onyx-variant-picker__tiers {
		gap: 8px;
	}

	.onyx-variant-picker .onyx-tier {
		padding: 10px 12px;
	}

	.onyx-tier__title {
		font-size: 13px;
	}

	.onyx-tier__price {
		padding: 3px 8px;
		font-size: 14px;
	}
}

/* Add to cart row: the quantity widget is intentionally absent (Q5b). */
.onyx-single-product .woocommerce-variation-add-to-cart .group-action {
	display: flex;
	align-items: center;
	gap: 10px;
}

.onyx-single-product .woocommerce-variation-add-to-cart .single_add_to_cart_button {
	flex: 1 1 auto;
}

.onyx-single-product .woocommerce-notices-wrapper {
	margin-bottom: 1rem;
}

.onyx-add-to-cart-wrap .stock {
	margin-bottom: 1rem;
}

/* Card grid fallback (non-swiper) */
.onyx-single-product ul.products {
	display: none;
}

/* Product card sale countdown (Amerce shop-left-sidebar / home-mental markup) */
.product-countdown .countdown__timer {
	display: inline-flex;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: center;
	gap: 2px;
}

.product-countdown .countdown__item {
	display: inline-flex;
	align-items: baseline;
	white-space: nowrap;
}

.product-countdown .countdown__label {
	margin-left: 1px;
	font-weight: 600;
}

/* FBT: fix stretched thumbs (theme uses height:100% on .list-order-product .img-prd img) */
.tf-product-fbt .list-bundle-prd .img-prd {
	flex: 0 0 100px;
	width: 100px;
	max-width: 100px;
	aspect-ratio: 100 / 133;
}

.tf-product-fbt .list-bundle-prd .img-prd img,
.tf-product-fbt .list-bundle-prd .img-prd img.fbt-prd-thumb {
	width: 100% !important;
	height: 100% !important;
	max-height: none;
	object-fit: cover;
	object-position: center;
	display: block;
}

@media (max-width: 575px) {
	.tf-product-fbt .list-bundle-prd .img-prd {
		flex: 0 0 80px;
		width: 80px;
		max-width: 80px;
		aspect-ratio: 100 / 133;
	}
}

.tf-product-fbt .list-bundle-prd .order-item--no-bundle {
	opacity: 0.85;
}

.tf-product-fbt .list-bundle-prd .order-item--no-bundle:has(input:disabled) {
	opacity: 0.75;
}

.tf-product-fbt .list-bundle-prd .order-item--no-bundle .fbt-item-status {
	font-weight: 500;
}

.tf-product-fbt .list-bundle-prd .order-item--no-bundle .tf-check:disabled {
	cursor: not-allowed;
}

/* PDP block review mode (SITE-TEMPLATES evaluation) */
.onyx-pdp-block-label {
	margin: 12px 0 8px;
	padding: 6px 10px;
	font-size: 12px;
	line-height: 1.35;
	background: #fff8e1;
	border: 1px dashed #c9a227;
	border-radius: 6px;
	color: #5c4a00;
}

.onyx-pdp-block-label span {
	display: inline-block;
	font-weight: 700;
	font-family: ui-monospace, monospace;
	margin-right: 6px;
}

.onyx-single-product .onyx-pdp-sticky-preview {
	position: relative;
	margin-top: 1rem;
}

/* ---------------------------------------------------------------
   PDP properties: effects and side effects (right column).
   Данные — inc/onyx-pdp-properties.php, разметка —
   template-parts/amerce/single-product/properties.php.
   Цвета только из переменных темы (styles.css:15-43).
   --------------------------------------------------------------- */

/* Разметка блока — настоящая таблица (properties.php: <table>/<tbody>/<tr>/<th>/<td>),
   но раскладку по-прежнему задаёт grid: те же классы, что были у <ul>/<li>/<span>,
   дают те же боксы, поэтому вид не меняется. <tbody> и <tr> боксов не создают
   (display: contents), ячейки становятся элементами внешней сетки. */

.onyx-properties__table {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 20px 24px;
	width: 100%;
	margin: 0;
	overflow: visible; /* styles.css:221 ставит overflow-x:auto — лишний контейнер прокрутки */
}

.onyx-properties__table > tbody {
	display: contents;
}

/* Сброс унаследованных правил для ячеек: styles.css:226 даёт `td, th { padding: 0 0 12px }`,
   bootstrap:461 — `th { text-align: inherit }`, браузер по умолчанию — `th` жирный и по центру.
   :where() держит специфичность на уровне родителя, чтобы правила ниже (цвет, фон, выравнивание
   значения) продолжали побеждать. font-weight не трогаем — его задаёт утилита .fw-medium. */
.onyx-properties__table :where(th, td) {
	padding: 0;
	border: 0;
	background: none;
}

.onyx-properties__table :where(th) {
	text-align: inherit;
}

.onyx-properties__item {
	display: grid;
	grid-template-columns: 34px minmax(0, 1fr) auto;
	align-items: center;
	column-gap: 12px;
	row-gap: 6px;
}

.onyx-properties__icon {
	grid-column: 1;
	grid-row: 1 / 3;
	align-self: start;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: rgba(61, 171, 37, 0.12); /* --success 12% */
	color: var(--success, #3DAB25);
}

.onyx-properties__icon .icon {
	font-size: 20px;
}

.onyx-properties__icon-img {
	display: block;
	width: 22px;
	height: 22px;
	object-fit: contain;
}

.onyx-properties__name {
	grid-column: 2 / -1;
	grid-row: 1;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	min-width: 0;
}

.onyx-properties__key {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 144px;
	background: rgba(61, 171, 37, 0.12);
	color: var(--success, #3DAB25);
}

.onyx-properties__score {
	grid-column: 3;
	grid-row: 2;
	white-space: nowrap;
	text-align: right;
}

.onyx-properties__bar {
	grid-column: 2;
	grid-row: 2;
	display: block;
	height: 8px;
	border-radius: 100px;
	background: var(--line, #E9E9E9);
	overflow: hidden;
}

.onyx-properties__bar-fill {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: var(--success, #3DAB25);
}

/* Side effects: тон риска + сводная оценка */

.onyx-properties--side .onyx-properties__icon {
	background: rgba(240, 62, 62, 0.12); /* --critical 12% */
	color: var(--critical, #F03E3E);
}

.onyx-properties__risk {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	column-gap: 12px;
	row-gap: 6px;
	margin-bottom: 12px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--line, #E9E9E9);
}

.onyx-properties--side .onyx-properties__risk .onyx-properties__name {
	grid-column: 1;
	grid-row: 1;
	font-weight: 600;
}

.onyx-properties--side .onyx-properties__risk .onyx-properties__score {
	grid-column: 2;
	grid-row: 1;
}

.onyx-properties--side .onyx-properties__risk .onyx-properties__bar {
	grid-column: 1 / -1;
	grid-row: 2;
}

.onyx-properties__risk .onyx-properties__bar-fill {
	background: var(--critical, #F03E3E);
}

.onyx-properties__value {
	white-space: nowrap;
	text-align: right;
}

/* Побочки: значение уходит под название, число-оценки у них нет */

.onyx-properties--side .onyx-properties__item {
	grid-template-columns: 34px minmax(0, 1fr);
}

.onyx-properties--side .onyx-properties__name {
	grid-column: 2;
}

.onyx-properties--side .onyx-properties__value {
	grid-column: 2;
	grid-row: 2;
	text-align: left;
}

.onyx-properties__item.is-positive .onyx-properties__value {
	color: var(--success, #3DAB25);
}

.onyx-properties__item.is-risk .onyx-properties__value {
	color: var(--critical, #F03E3E);
}

@media (max-width: 1199px) {
	.onyx-properties__table {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 575px) {
	.onyx-properties__table {
		grid-template-columns: minmax(0, 1fr);
		gap: 16px;
	}

	.onyx-properties__item,
	.onyx-properties--side .onyx-properties__item {
		grid-template-columns: 30px minmax(0, 1fr) auto;
		column-gap: 10px;
	}

	.onyx-properties--side .onyx-properties__item {
		grid-template-columns: 30px minmax(0, 1fr);
	}

	.onyx-properties__icon {
		width: 30px;
		height: 30px;
	}

	.onyx-properties__icon-img {
		width: 20px;
		height: 20px;
	}
}

/* ---------------------------------------------------------------
   Мобильный порядок блоков: описание поднимается сразу после свойств.
   Перенос узла делает assets/amerce/js/onyx-wc-single.js (ниже 768px —
   там колонки карточки складываются в одну), здесь только отступы:
   в колонке секция стоит без «секционных» полей, а внутренний .container
   не должен добавлять второй горизонтальный паддинг к гаттеру колонки.
   Ритм между блоками колонки задаёт gap у .tf-product-info-list (24px).
   --------------------------------------------------------------- */

@media (max-width: 767.98px) {
	.section-product-description.onyx-desc-in-summary {
		padding-top: 0;
		padding-bottom: 0;
	}

	.section-product-description.onyx-desc-in-summary .container {
		padding-left: 0;
		padding-right: 0;
	}
}
