/* Общие стили корзины */
.custom-cart-container {
	width: 100%;
}

.custom-cart-wrap {
	display: flex;
	flex-direction: row-reverse;
	justify-content: space-between;
	gap: 30px;
	margin: 30px 0;
}

/* Колонка с товарами (правая) */
.cart-items-column {
	flex: 1;
	min-width: 0;
}

.cart-items-column h2 {
	font-size: var(--font-size-xxl);
	margin-bottom: 20px;
	font-weight: 500;
}

/* Таблица товаров */
.woocommerce-cart-form__contents {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 20px;
}

.woocommerce-cart-form__contents thead {
	background-color: var(--light-gray);
}

.woocommerce-cart-form__contents th {
	text-align: left;
	padding: 15px;
	font-weight: 500;
	font-size: var(--font-size-sm);
	color: var(--text-light);
}

.woocommerce-cart-form__contents td {
	padding: 15px;
	border-bottom: 1px solid var(--light-gray);
	vertical-align: middle;
}

.woocommerce-cart-form__contents .product-remove {
	width: 30px;
}

.woocommerce-cart-form__contents .product-thumbnail {
	width: 80px;
}

.woocommerce-cart-form__contents .product-thumbnail img {
	width: 70px;
	height: 70px;
	object-fit: cover;
	border-radius: 4px;
}

.woocommerce-cart-form__contents .product-name {
	font-weight: 500;
}

.woocommerce-cart-form__contents .product-name a {
	color: var(--black);
	text-decoration: none;
	transition: color 0.2s;
}

.woocommerce-cart-form__contents .product-name a:hover {
	color: var(--primary-color);
}

.woocommerce-cart-form__contents .product-price,
.woocommerce-cart-form__contents .product-subtotal {
	font-weight: 500;
	min-width: 100px;
}

.woocommerce-cart-form__contents .product-quantity {
	min-width: 120px;
}

.woocommerce-cart-form__contents
	.product-quantity
	.qib-button-wrapper
	.quantity
	input.input-text.qty.text {
	width: 100px;
}

/* Количество товара */
.quantity {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--light-gray);
	border-radius: 4px;
}

.quantity .qty {
	width: 50px;
	text-align: center;
	border: none;
	padding: 8px 0;
	-moz-appearance: textfield;
}

.quantity .qty::-webkit-outer-spin-button,
.quantity .qty::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.qib-button-wrapper {
	display: flex;
	align-items: center;
}

.qib-button {
	background: var(--light-gray);
	border: none;
	padding: 8px 12px;
	cursor: pointer;
	transition: background-color 0.2s;
}

.qib-button:hover {
	background-color: #e8e8e8;
}

/* Кнопка удаления товара */
.product-remove a.remove {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	font-size: var(--font-size-lg);
	text-decoration: none;
	color: var(--text-light);
	border-radius: 50%;
	background-color: var(--light-gray);
	transition: all 0.2s;
}

.product-remove a.remove:hover {
	color: var(--white);
	background-color: var(--secondary-color);
}

/* Секция с купоном и обновлением корзины */
.actions {
	padding: 20px 0;
}

.coupon {
	display: flex;
	align-items: center;
	gap: 10px;
}

.coupon label {
	margin-right: 10px;
}

.coupon .input-text {
	padding: 10px 15px;
	border: 1px solid var(--light-gray);
	border-radius: 4px;
	min-width: 200px;
}

.cart_totals h2 {
	display: none;
}

/* Колонка с итогами (левая) */
.cart-totals-column {
	width: 350px;
	flex-shrink: 0;
}

.cart-totals-inner {
	background-color: #fcfcfc;
	padding: 25px;
	border-radius: 10px;
}

.cart-totals-inner h2 {
	font-size: var(--font-size-xxl);
	margin-bottom: 20px;
	font-weight: 500;
}

/* Таблица итогов */
.cart_totals table {
	width: 100%;
	margin-bottom: 20px;
}

.cart_totals th {
	text-align: left;
	padding: 10px 0;
	font-weight: normal;
	color: var(--text-light);
	font-size: var(--font-size-sm);
}

.cart_totals td {
	text-align: right;
	padding: 10px 0;
	font-weight: 500;
}

.cart_totals .order-total th,
.cart_totals .order-total td {
	font-size: var(--font-size-md);
	padding-top: 20px;
	border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.cart_totals .order-total td {
	font-weight: var(--font-weight-medium);
}

/* Секция с доставкой */
.woocommerce-shipping-methods {
	list-style: none;
	padding: 0;
	margin: 0 15px;
}

.woocommerce-shipping-methods li {
	margin-bottom: 10px;
	display: flex;
	align-items: center;
}

.woocommerce-shipping-methods input[type="radio"] {
	margin-right: 10px;
}

.woocommerce-shipping-destination {
	font-size: var(--font-size-xs);
	color: var(--text-light);
	margin-top: 10px;
}

/* Кнопки */
.button {
	display: inline-block;
	padding: 12px 20px;
	background-color: var(--primary-color);
	color: var(--white);
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-size: var(--font-size-sm);
	text-decoration: none;
	transition: background-color 0.2s;
}

.button:hover {
	background-color: #2f2870;
}

.coupon .button {
	background-color: var(--light-gray);
	color: var(--black);
}

.coupon .button:hover {
	background-color: #e8e8e8;
}

button[name="update_cart"] {
	background-color: var(--light-gray);
	color: var(--black);
	margin-left: auto;
}

button[name="update_cart"]:hover {
	background-color: #e8e8e8;
}

button[name="update_cart"][disabled] {
	opacity: 0.5;
	cursor: not-allowed;
}

.checkout-button {
	display: block;
	text-align: center;
	background-color: var(--primary-color);
	font-weight: 500;
	padding: 10px 16px;
	width: 100%;
	margin-top: 20px;
}

.cart-buttons {
	margin-top: 20px;
}

@media (max-width: 1200px) {
	.cart-totals-column {
		width: 275px;
	}
}
/* Адаптивная верстка */
@media screen and (max-width: 991px) {
	.custom-cart-wrap {
		flex-direction: column;
	}

	.cart-totals-column {
		width: 100%;
		order: 2;
	}

	.cart-items-column {
		order: 1;
	}

	.desktop-only {
		display: none;
	}
}

@media screen and (min-width: 992px) {
	.mobile-only {
		display: none;
	}
}

@media screen and (max-width: 767px) {
	.woocommerce-cart-form__contents {
		display: block;
	}

	.woocommerce-cart-form__contents thead {
		display: none;
	}
	body .qib-button-wrapper {
		display: flex;
		float: right;
		margin-right: 0;
	}
	.woocommerce-cart-form__contents tbody,
	.woocommerce-cart-form__contents tr,
	.woocommerce-cart-form__contents td {
		display: block;
	}

	.woocommerce-cart-form__contents tr {
		position: relative;
		margin-bottom: 20px;
		padding-bottom: 20px;
		border-bottom: 1px solid var(--light-gray);
	}

	.woocommerce-cart-form__contents td {
		border-bottom: none;
		padding: 8px 0;
		text-align: right;
	}

	.woocommerce-cart-form__contents .product-remove {
		position: absolute;
		top: 0;
		right: 0;
		width: auto;
	}

	.woocommerce-cart-form__contents .product-thumbnail {
		text-align: center;
		width: 100%;
	}

	.woocommerce-cart-form__contents .product-thumbnail:before {
		display: none;
	}

	.woocommerce-cart-form__contents .product-thumbnail img {
		width: 100px;
		height: 100px;
	}

	.coupon {
		flex-direction: column;
		align-items: flex-start;
	}

	.coupon .input-text {
		width: 100%;
		margin-bottom: 10px;
	}

	.coupon .button {
		width: 100%;
	}

	button[name="update_cart"] {
		width: 100%;
		margin-top: 10px;
	}

	.actions {
		display: flex;
		flex-direction: column;
	}
}
