/* Checkout page hero — minimal title block */
.onyx-checkout-page-title .main-page-title {
	display: block;
}

.onyx-checkout-page-title .breadcrumbs {
	justify-content: flex-start;
}

.onyx-checkout-page-title__head {
	display: grid;
	gap: 12px;
	text-align: left;
}

.onyx-checkout-page-title__heading {
	margin-top: 0;
}

/* WooCommerce fields — Amerce checkout (no pill textarea) */
.onyx-checkout-form .woocommerce-billing-fields__field-wrapper,
.onyx-checkout-form .woocommerce-additional-fields__field-wrapper {
	display: grid;
	gap: 16px;
}

@media (min-width: 576px) {
	.onyx-checkout-form .woocommerce-billing-fields__field-wrapper {
		grid-template-columns: 1fr 1fr;
	}

	.onyx-checkout-form .woocommerce-billing-fields__field-wrapper .form-row-wide {
		grid-column: 1 / -1;
	}
}

.onyx-checkout-form .form-row {
	margin: 0;
	padding: 0;
}

.onyx-checkout-form .form-row label {
	display: block;
	margin-bottom: 8px;
	font-weight: 500;
}

.onyx-checkout-form .form-row label .required {
	color: var(--primary, #dc4646);
	font-weight: 700;
}

.onyx-checkout-form .form-row .optional {
	display: none;
}

.onyx-checkout-form .form-row .input-text,
.onyx-checkout-form .form-row select {
	width: 100%;
	border-radius: 8px;
	padding: 12px 16px;
}

.onyx-checkout-form .form-row textarea.input-text {
	border-radius: 8px;
	min-height: 120px;
	padding: 14px 16px;
	resize: vertical;
}

.onyx-checkout-form .select2-container .select2-selection--single {
	border-radius: 8px;
	height: 52px;
}

/*
 * SelectWoo держит у выбранного значения свою высоту строки (28px) и padding-left: 8px,
 * поэтому текст прилипал к верху поля и не совпадал по отступу с обычными input.
 * 52px = 12 + 26 + 12 (padding и строка .input-text), минус 1px рамка сверху/снизу.
 */
.onyx-checkout-form .select2-container .select2-selection--single .select2-selection__rendered {
	line-height: 50px;
	padding-left: 16px;
	padding-right: 44px;
}

.onyx-checkout-form .select2-container .select2-selection--single .select2-selection__arrow {
	right: 8px;
	height: 50px;
}

/*
 * Плагин телефона рисует поле как inline-block и сжимает его по содержимому,
 * из-за чего телефон занимал четверть ряда. Растягиваем виджет на всю ширину.
 */
.onyx-checkout-form .form-row .woocommerce-input-wrapper {
	display: block;
}

.onyx-checkout-form .form-row .iti,
.onyx-checkout-form .form-row .iti__tel-input {
	display: block;
	width: 100%;
}

.onyx-checkout-form .woocommerce-checkout-payment {
	margin-top: 0;
	padding-top: 0;
	border: 0;
}

.onyx-checkout-submit-wrap {
	margin-top: 8px;
}

.onyx-checkout-submit-wrap .place-order {
	margin-top: 24px;
	padding: 0;
}

#place_order.onyx-place-order--pending {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: 10px;
	cursor: wait;
	opacity: 0.92;
	pointer-events: none;
}

#place_order.onyx-place-order--pending::before {
	content: "";
	width: 18px;
	height: 18px;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: onyx-place-order-spin 0.7s linear infinite;
	flex-shrink: 0;
}

@keyframes onyx-place-order-spin {
	to {
		transform: rotate(360deg);
	}
}

.onyx-checkout .woocommerce-NoticeGroup {
	margin-bottom: 24px;
}

.onyx-checkout-additional.box-ip-checkout {
	margin-bottom: 0;
}

/* Right sidebar — cart lines */
.onyx-checkout-review-sidebar .list-order-product .order-item.onyx-sidebar-cart-item {
	align-items: flex-start;
}

.onyx-checkout-review-sidebar .img-prd {
	flex: 0 0 100px;
	width: 100px;
	max-width: 100px;
}

.onyx-checkout-review-sidebar .img-prd img,
.onyx-checkout-review-sidebar .img-prd .onyx-sidebar-cart-thumb {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 100 / 133;
	object-fit: cover;
}

.onyx-checkout-review-sidebar .infor-prd {
	gap: 8px;
}

.onyx-checkout-review-sidebar .onyx-sidebar-qty {
	max-width: 140px;
	margin-top: 4px;
	padding-top: 0;
	padding-bottom: 0;
}

.onyx-checkout-review-sidebar .quantity-price {
	align-self: center;
	flex-shrink: 0;
	text-align: right;
	min-width: 72px;
}

.onyx-checkout-review-sidebar .box-your-order .list-total {
	margin-top: 28px;
	margin-bottom: 20px;
	padding: 20px 0;
	border-top: 1px solid var(--line);
	border-bottom: 1px solid var(--line);
}

.onyx-checkout-review-sidebar .box-your-order .list-total .total-item {
	justify-content: space-between;
	gap: 16px;
}

.onyx-checkout-review-sidebar .box-your-order .list-total .total-item + .total-item {
	margin-top: 12px;
}

.onyx-checkout-review-sidebar .box-your-order .last-total {
	margin-top: 4px;
	padding-top: 4px;
}

.onyx-checkout-review-sidebar.onyx-checkout-sidebar--busy a.remove {
	pointer-events: none;
	opacity: 0.5;
}

.onyx-checkout-review-sidebar .onyx-sidebar-cart-item.onyx-sidebar-item--syncing .quantity-price {
	opacity: 0.75;
	transition: opacity 0.15s ease;
}

/* Legacy table cart (if used elsewhere) */
.onyx-checkout-cart-form .tf-table-page-cart tbody td {
	vertical-align: middle;
}

.onyx-checkout-cart-form .tf-cart_item td.cart_product {
	display: table-cell;
}

.onyx-checkout-cart-form .tf-cart_item .cart-product-cell {
	display: flex;
	align-items: center;
	gap: 24px;
}

.onyx-checkout-cart-form .tf-table-page-cart .wg-quantity {
	margin-left: auto;
	margin-right: auto;
	padding-top: 0;
	padding-bottom: 0;
}

.onyx-checkout-cart-form .img-prd img {
	display: block;
	width: 100px;
	height: auto;
	aspect-ratio: 100 / 133;
	object-fit: cover;
}

/*
 * Мобильный порядок блоков: сначала состав заказа (сайдбар), затем форма.
 * Порядок в разметке не меняем — только визуальный порядок колонок, поэтому
 * на ≥992px всё остаётся как было: форма слева, заказ справа.
 */
@media (max-width: 991.98px) {
	.onyx-checkout-layout > .col-lg-5 {
		order: 1;
		margin-bottom: 30px;
	}

	.onyx-checkout-layout > .col-lg-7 {
		order: 2;
	}

	/* Отступ .fl-sidebar-cart (30px сверху) рассчитан на блок «после формы» —
	   когда заказ идёт первым, он даёт лишний зазор сверху; переносим его вниз. */
	.onyx-checkout-layout .onyx-checkout-review-sidebar {
		margin-top: 0;
	}
}
