/* Cart Sidebar - Стилі для бокової корзини
========================================= */

.cart-lightbox {
	--full-width: 760px;
	--container-indent: 80px;
	--scroll-bar: 3px;
	--products-in-col: 4;
	--products-indent-w: 15px;
}
@media (max-width: 768px) {
	.cart-lightbox {
		--full-width: 100vw;
		--container-indent: 20px;
		--scroll-bar: 0px;
		--products-in-col: 2;
	}
}
/* Загальні стилі та позиціонування лайтбокса
------------------------------------------ */
.cart-lightbox .lightbox-background {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	z-index: 9998;
	opacity: 0;
	visibility: hidden;
	transition: all 0.3s ease;
}

.cart-lightbox.active .lightbox-background {
	opacity: 1;
	visibility: visible;
}

.cart-lightbox .lightbox-section {
	position: fixed;
	top: 0;
	right: -120vw;
	width: 760px;
	height: 100dvh !important;
	max-height: 100dvh !important;
	margin-top: 0 !important;
	padding: 30px;
	background: #fff;
	z-index: 9999;
	transition: right 0.3s ease;
	overflow-y: auto;
	border-radius: 0px;
}

.cart-lightbox.active .lightbox-section {
	right: 0;
}

.cart-lightbox .lightbox-content {
	display: flex;
	flex-direction: column;
	height: 100%;
	max-height: 100%;
}

/* Кнопка закриття
---------------- */
.cart-lightbox .close-lightbox {
	position: absolute;
	top: 20px;
	right: 20px;
	padding: 0px;
	width: 35px;
	height: 35px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.3s ease;
	z-index: 1;
}

.cart-lightbox .close-lightbox img {
	width: 24px;
	height: 24px;
}

/* Хедер корзини
-------------- */
.cart-lightbox .cart-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 30px;
	padding-right: 45px; /* Відступ для кнопки закриття */
}

.cart-lightbox .form-head {
	display: flex;
	align-items: center;
	gap: 15px;
}

.cart-lightbox .form-head img {
	width: 32px;
	height: 32px;
	object-fit: contain;
}

.cart-lightbox .form-head .h2 {
	margin: 0;
	font-size: 24px;
	line-height: 28px;
}

/* Тіло корзини та список товарів
------------------------------- */
.cart-lightbox .cart-body {
	overflow-y: auto;
}

.cart-lightbox .cart-items {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

/* Елемент товару в корзині
------------------------- */
.cart-lightbox .cart-item {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 15px;
	transition: all 0.3s ease;
}

/* Зображення товару */
.cart-lightbox .product-image {
	flex: 0 0 80px;
	border: 1px solid #f3f3f3;
	border-radius: 8px;
}

.cart-lightbox .product-image img {
	width: 80px;
	height: 80px;
	object-fit: cover;
	border-radius: 8px;
}

/* Інформація про товар */
.cart-lightbox .product-info {
	display: flex;
	flex-direction: column;
	gap: 8px;
	width: calc(100% - 350px);
}

.cart-lightbox .product-name {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
	font-weight: 500;
	font-size: 16px;
	line-height: 20px;
	color: var(--black);
}

.cart-lightbox .product-variations {
	font-size: 13px;
	color: #666;
	line-height: 18px;
}

.cart-lightbox .variation-item {
	margin-bottom: 2px;
}

.cart-lightbox .product-price {
	font-weight: 600;
	font-size: 16px;
	margin-top: 5px;
}

/* Управління кількістю товару
---------------------------- */
.cart-lightbox .product-quantity {
	position: relative;
	margin: 0 auto;
}

.cart-lightbox .product-quantity .custom-quantity-input {
	display: flex;
	align-items: center;
	border: 1px solid #234b5a;
	border-radius: 60px;
	background: #fff;
	overflow: hidden;
}

.cart-lightbox .quantity-btn {
	width: 30px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	border: none;
	cursor: pointer;
	font-size: 18px;
	font-weight: 600;
	color: #666;
	transition: all 0.3s ease;
}
.cart-lightbox .quantity-display {
	width: 20px;
	height: 40px;
	border: none;
	padding: 0;
	text-align: center;
	font-size: 14px;
	font-weight: 600;
}

/* Кнопка видалення товару */
.cart-lightbox .product-remove {
	position: relative;
	display: flex;
	justify-content: center;
	align-items: center;
	width: 30px;
	height: 30px;
	margin-top: 5px;
	cursor: pointer;
	transition: all 0.3s ease;
}

.cart-lightbox .product-remove img {
	width: 26px;
	height: 26px;
	object-fit: contain;
	transition: all 0.3s ease;
}

.cart-lightbox .product-remove span {
	display: none;
}

/* Порожня корзина
---------------- */
.cart-lightbox .cart-empty-message {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 60px 20px;
	gap: 20px;
	margin-top: auto;
	height: 80dvh;
}

.cart-lightbox .cart-empty-message p {
	font-size: 16px;
	color: #999;
	margin: 0;
}

/* Футер корзини
-------------- */
.cart-lightbox .cart-footer {
	margin-top: auto;
	padding-top: 30px;
	border-top: 1px solid var(--border);
}

.cart-lightbox .cart-total {
	margin-bottom: 20px;
}

.cart-lightbox .cart-subtotal {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 18px;
	font-weight: 600;
}

.cart-lightbox .cart-subtotal span:first-child {
	color: #666;
}

.cart-lightbox .cart-subtotal .subtotal-value {
	color: var(--accent);
}

/* Кнопки дій */
.cart-lightbox .cart-actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.cart-lightbox .cart-actions .btn {
	width: 100%;
	justify-content: center;
	height: 50px;
}

.cart-lightbox .cart-actions .btn img {
	width: 20px;
	height: 20px;
	margin-right: 8px;
}

/* Стани завантаження та оновлення
-------------------------------- */
.cart-lightbox .cart-loading {
	display: none;
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(255, 255, 255, 0.9);
	z-index: 10;
	justify-content: center;
	align-items: center;
}

.cart-lightbox.loading .cart-loading {
	display: flex;
}

.cart-lightbox .loader-spinner {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 4px solid #f3f3f3;
	border-top: 4px solid var(--primary);
	animation: spin 0.8s linear infinite;
}

@keyframes spin {
	0% {
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(360deg);
	}
}

.cart-lightbox.loading .cart-body {
	opacity: 0.6;
	pointer-events: none;
}

.cart-lightbox .cart-item.updating {
	position: relative;
	opacity: 0.7;
	pointer-events: none;
}

.cart-lightbox .cart-item.updating:after {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(255, 255, 255, 0.5);
	border-radius: 10px;
	z-index: 1;
}

/* Адаптивні стилі
---------------- */
@media (max-width: 768px) {
	.cart-lightbox .lightbox-section {
		width: 100%;
		max-width: 100%;
		right: -100%;
		padding: 10px;
	}

	.cart-lightbox .close-lightbox {
		top: 20px;
		right: 20px;
		width: 32px;
		height: 32px;
	}
	.cart-lightbox .lightbox-content {
		padding-right: 0px;
	}
	.cart-lightbox .cart-header {
		margin-bottom: 20px;
		padding-right: 40px;
	}

	.cart-lightbox .form-head .h2 {
		font-size: 20px;
		line-height: 24px;
	}

	.cart-lightbox .cart-items {
		gap: 15px;
	}

	.cart-lightbox .cart-item {
		padding: 12px;
	}

	.cart-lightbox .product-image {
		flex: 0 0 60px;
	}

	.cart-lightbox .product-image img {
		width: 60px;
		height: 60px;
	}

	.cart-lightbox .product-name {
		font-size: 14px;
		line-height: 18px;
	}

	.cart-lightbox .product-price {
		font-size: 15px;
	}

	.cart-lightbox .cart-footer {
		padding-top: 20px;
	}

	.cart-lightbox .cart-subtotal {
		font-size: 16px;
	}

	.cart-lightbox .cart-actions .btn {
		height: 45px;
		font-size: 14px;
	}
	.cart-lightbox .continue-shopping {
		display: none;
	}
	.cart-lightbox .product-info {
		width: calc(100% - 0px);
		gap: 4px;
	}
	.cart-lightbox .quantity-display {
		width: 12px;
		height: 30px;
		font-size: 12px;
		font-weight: 500;
	}
	.cart-lightbox .product-remove {
		width: 20px;
		height: 20px;
		margin-top: 5px;
	}
	.cart-lightbox .product-remove img {
		width: 20px;
		height: 20px;
		min-width: 20px;
	}
	.cart-lightbox .quantity-btn {
		width: 26px;
		height: 30px;
		font-weight: 500;
	}
}

/* Upsell Block - Start
==================== */
.cart-lightbox .cart-upsell-wrapper {
	margin-top: 25px;
	padding-top: 25px;
	padding-right: 10px;
	border-top: 1px solid var(--border);
}

.cart-lightbox .cart-upsell-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 15px;
}

.cart-lightbox .cart-upsell-header .h3 {
	font-size: 18px;
	line-height: 22px;
	color: var(--black);
	margin: 0;
}

/* Кнопки навігації в хедері */
.cart-lightbox .cart-upsell-header .upsell-swiper-buttons {
	margin: 0;
	gap: 8px;
}

.cart-lightbox .cart-upsell-header .upsell-swiper-buttons > * {
	width: 32px;
	height: 32px;
}

.cart-lightbox .cart-upsell-header .upsell-swiper-buttons img {
	width: 10px;
}

.cart-lightbox .cart-upsell-products {
	position: relative;
}

/* Стилі для карточок товарів без слайдера */
.cart-lightbox .cart-upsell-products:not(.has-slider) {
	display: flex;
	flex-wrap: wrap;
	gap: 15px;
}

/* Стилі для карточок товарів в слайдері */
.cart-lightbox .cart-upsell-products.has-slider .product-card {
	width: auto;
}

/* Анімація при додаванні в корзину */
.cart-lightbox .cart-upsell-products .product-card.adding-to-cart {
	opacity: 0.5;
	pointer-events: none;
}

/* Адаптив для мобільних */
@media (max-width: 768px) {
	.cart-lightbox .cart-upsell-wrapper {
		margin-top: 20px;
		padding-top: 20px;
	}

	.cart-lightbox .cart-upsell-header .h3 {
		font-size: 16px;
		line-height: 20px;
	}

	.cart-lightbox .cart-upsell-products:not(.has-slider) .product-card {
		width: calc(50% - 7.5px);
	}
}
/* Upsell Block - End */
