/* Базовые стили для десктопов */
.cart-header, .cart-item, .cart-footer {
	display: flex;
	align-items: center;
	padding: 15px 10px;
	border-bottom: 1px solid #e0e0e0;
}

.cart-header {
	font-weight: bold;
	background-color: #f8f9fa;
	border-radius: 8px 8px 0 0;
}

/* Делаем все заголовки жирными */
.cart-header > div {
	font-weight: bold;
}

.cart-col-image {
	width: 80px;
	flex-shrink: 0;
	text-align: center;
}
.cart-col-product {
	flex: 1;
	padding: 0 15px;
	min-width: 0; /* Важно для обрезки длинного текста */
}
.cart-col-quantity {
	width: 120px;
	text-align: right;
	padding-right: 20px;
}
.cart-col-price {
	width: 120px;
	text-align: right;
	padding-right: 20px;
	font-weight: 500;
}
.cart-col-total {
	width: 140px;
	text-align: right;
	padding-right: 20px;
	font-weight: bold;
	color: #2c5aa0;
}
.cart-col-remove {
	width: 80px;
	display: flex;
	justify-content: center;
	align-items: center;
}

.cart-footer .cart-col-product {
	text-align: right;
}

.remove-item-btn {
	background: #dc3545;
	color: white;
	border: none;
	border-radius: 50%;
	width: 32px;
	height: 32px;
	cursor: pointer;
	font-size: 18px;
	line-height: 1;
	transition: all 0.3s ease;
	display: flex;
	justify-content: center;
	align-items: center;
}

.remove-item-btn:hover {
	background: #c82333;
	transform: scale(1.1);
}

.cart_thumb {
	max-width: 60px;
	max-height: 60px;
	border-radius: 4px;
}

.bold {
	font-weight: bold;
}

.quantity-selector {
	font-family: inherit;
	padding: 8px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	background: white;
	text-align: center;
	max-width: 80px;
	margin-left: auto;
}

/* Стили для комментария */
.comment-section {
	margin-top: 7px;
}

.comments {
	width: 100%;
	padding: 12px;
	border: 1px solid #ddd;
	border-radius: 8px;
	resize: vertical;
	font-family: inherit;
	margin-top: 8px;
}

.comments:focus {
	outline: none;
	border-color: #2c5aa0;
	box-shadow: 0 0 0 2px rgba(44, 90, 160, 0.1);
}

.save-status {
	margin-left: 10px;
	font-size: 0.9em;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.save-status.show {
	opacity: 1;
}

.save-status.saving {
	color: #ffc107;
}

.save-status.saved {
	color: #28a745;
}

.save-status.error {
	color: #dc3545;
}

/* Мобильные стили */
@media (max-width: 768px) {
	.cart-header {
		display: none;
	}

	.cart-item {
		flex-direction: row;
		flex-wrap: wrap;
		align-items: flex-start;
		padding: 15px;
		position: relative;
		background: white;
		margin-bottom: 10px;
		border-radius: 8px;
		box-shadow: 0 2px 4px rgba(0,0,0,0.1);
		border: 1px solid #e0e0e0;
	}

	.cart-col-image {
		width: 80px;
		margin-bottom: 0;
		margin-right: 15px;
		flex-shrink: 0;
	}

	.cart-col-product {
		flex: 1;
		min-width: 0;
		padding: 0;
		margin-bottom: 0;
		/* Защита от перекрытия кнопкой удаления */
		padding-right: 50px;
	}

	.product-info-mobile {
		margin-bottom: 10px;
		/* Обеспечиваем правильное отображение текста */
		word-wrap: break-word;
		overflow-wrap: break-word;
	}

	.product-info-mobile a {
		display: block;
		font-weight: 500;
		line-height: 1.3;
	}

	.mobile-price-line {
		display: flex;
		align-items: center;
		gap: 8px;
		font-size: 14px;
		padding: 8px 0;
		border-top: 1px solid #f0f0f0;
		margin-top: 8px;
		flex-wrap: wrap;
	}

	.mobile-total-price {
		margin-left: auto;
		color: #2c5aa0;
		font-size: 16px;
		font-weight: bold;
	}

	.cart-col-quantity,
	.cart-col-price,
	.cart-col-total {
		display: none !important;
	}

	.cart-col-remove {
		position: absolute;
		top: 15px;
		right: 15px;
		width: auto;
		z-index: 10;
	}

	.mobile-quantity {
		width: 70px;
		padding: 6px 8px;
		font-size: 14px;
	}

	.quantity-selector:not(.mobile-quantity) {
		display: none;
	}

	.cart-footer {
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
		padding: 20px;
		background: #f8f9fa;
		border-radius: 8px;
		gap: 10px;
	}

	.cart-footer > div {
		flex: 1;
		text-align: center;
		margin-bottom: 0;
	}

	.cart-footer .cart-col-product {
		font-weight: bold;
		text-align: left;
		display: flex !important;
		justify-content: flex-start;
		flex: 1;
	}

	.cart-footer .cart-col-quantity {
		display: flex !important;
		justify-content: center;
		font-weight: bold;
		flex: 1;
		text-align: center;
	}

	.cart-footer .cart-col-total {
		display: flex !important;
		justify-content: flex-end;
		font-weight: bold;
		flex: 1;
		text-align: right;
	}

	.cart-footer .cart-col-price,
	.cart-footer .cart-col-remove {
		display: none !important;
	}

	/* Убираем псевдо-элементы с текстом "Количество:" и "Сумма:" */
	.cart-footer .cart-col-quantity::before,
	.cart-footer .cart-col-total::before {
		content: none;
	}
}

/* Десктопные специфичные элементы */
@media (min-width: 769px) {
	.mobile-price-line,
	.mobile-quantity,
	.product-info-mobile {
		display: none;
	}

	.product-info-desktop {
		display: block;
	}

	#cart-container {
		background: white;
		border-radius: 8px;
		overflow: hidden;
		box-shadow: 0 2px 8px rgba(0,0,0,0.1);
	}
}

/* Анимации */
.cart-item.removing {
	opacity: 0;
	transform: translateX(-100%);
	transition: all 0.3s ease;
}

.quantity-selector:focus {
	outline: none;
	border-color: #2c5aa0;
	box-shadow: 0 0 0 2px rgba(44, 90, 160, 0.1);
}

.mobile-price-value {
	font-weight: bold;
}

/* Гарантируем отображение названия товара в десктопной версии */
.cart-col-product a {
	display: block;
	font-weight: 500;
	line-height: 1.3;
	text-decoration: none;
	color: #333;
}

.cart-col-product a:hover {
	text-decoration: underline;
}