/* 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: #272727;
	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: 30px;
	right: 30px;
	padding: 0px;
	background: transparent;
	border-radius: 0;
	width: 24px;
	height: 24px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.3s ease;
	z-index: 1;
}

.cart-lightbox .close-lightbox:hover {
	opacity: 0.7;
}

.cart-lightbox .close-lightbox img {
	width: 16px;
	height: 16px;
	filter: brightness(0) invert(1);
}

/* Хедер корзини
-------------- */
.cart-lightbox .cart-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 30px;
	padding-right: 0;
}

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

.cart-lightbox .form-head img {
	display: none;
}

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

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

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

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

.cart-lightbox .cart-item:hover {
	background: transparent;
}

/* Зображення товару */
.cart-lightbox .product-image {
	flex: 0 0 50px;
	filter: none;
}

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

/* Інформація про товар */
.cart-lightbox .product-info {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.cart-lightbox .product-name {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
	font-weight: 400;
	font-size: 14px;
	line-height: 18px;
	color: #ffffff;
}

.cart-lightbox .product-variations {
	font-size: 12px;
	color: #999;
	line-height: 16px;
}

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

.cart-lightbox .product-price {
	font-weight: 500;
	font-size: 15px;
	color: #ffffff;
	margin-top: 2px;
	display: flex;
	align-items: center;
	gap: 8px;
}

.cart-lightbox .product-price del {
	font-size: 13px;
	color: #666;
	font-weight: 400;
}

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

.cart-lightbox .product-quantity .custom-quantity-input {
	display: flex;
	align-items: center;
	border: 1px solid #4A4A4A;
	border-radius: 5px;
	background: transparent;
	overflow: hidden;
}

.cart-lightbox .quantity-btn {
	width: 28px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: none;
	cursor: pointer;
	font-size: 16px;
	color: #ffffff;
	transition: all 0.3s ease;
}

.cart-lightbox .quantity-btn:hover {
	background: rgba(255, 255, 255, 0.1);
}

.cart-lightbox .quantity-display {
	width: 32px;
	height: 44px;
	border: none;
	padding: 0;
	text-align: center;
	font-size: 14px;
	font-weight: 400;
	background: transparent;
	color: #ffffff;
}

/* Кнопка видалення товару */
.cart-lightbox .product-remove {
	position: relative;
	top: auto;
	right: auto;
	display: flex;
	justify-content: center;
	align-items: center;
	width: 44px;
	height: 44px;
	background: #3D3D3D;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.3s ease;
	margin-left: 15px;
}

.cart-lightbox .product-remove:hover {
	background: #4A4A4A;
}

.cart-lightbox .product-remove img {
	width: 18px;
	height: 18px;
	filter: brightness(0) invert(1);
	transition: all 0.3s ease;
}

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

/* Порожня корзина
---------------- */
.cart-lightbox .cart-empty-message {
	text-align: center;
	padding: 60px 20px;
}

.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 #3D3D3D;
}

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

.cart-lightbox .cart-subtotal {
	display: flex;
	justify-content: space-between;
	align-items: center;
	width: fit-content;
	gap: 10px;
	font-size: 18px;
	font-weight: 400;
}

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

.cart-lightbox .cart-subtotal .subtotal-value {
	color: #ffffff;
	font-weight: 500;
}

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

.cart-lightbox .cart-actions .continue-shopping {
	display: none;
}

/* Стани завантаження та оновлення
-------------------------------- */
.cart-lightbox .cart-loading {
	display: none;
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(39, 39, 39, 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 #4A4A4A;
	border-top: 4px solid #ffffff;
	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(39, 39, 39, 0.5);
	border-radius: 0;
	z-index: 1;
}

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

	.cart-lightbox .close-lightbox {
		top: 20px;
		right: 20px;
		width: 24px;
		height: 24px;
	}

	.cart-lightbox .lightbox-content {
		padding-right: 0px;
	}

	.cart-lightbox .cart-header {
		margin-bottom: 20px;
		padding-right: 0;
	}

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

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

	.cart-lightbox .cart-item {
		padding: 0;
		flex-wrap: wrap;
		gap: 10px;
	}
	.cart-lightbox .cart-item  .product-info {
		flex: initial;
		width: calc(100% - 100px);
	}
	.cart-lightbox .product-quantity {
		margin-left: 55px;
	}
	.cart-lightbox .product-image {
		flex: 0 0 45px;
	}

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

	.cart-lightbox .product-name {
		font-size: 13px;
		line-height: 17px;
	}

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

	.cart-lightbox .product-remove {
		position: absolute;
		top: 0;
		right: 0;
		width: 40px;
		height: 40px;
	}

	.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 .quantity-display {
		height: 32px;
	}
	.cart-lightbox .quantity-btn {
		height: 32px;
	}
}

/* Upsell Block - Start
==================== */
.cart-lightbox .cart-upsell-wrapper {
	margin-top: 25px;
	padding-top: 25px;
	border-top: 1px solid #3D3D3D;
}

.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: #ffffff;
	margin: 0;
}

/* Кнопки навігації в хедері */
.cart-lightbox .cart-upsell-header .upsell-swiper-buttons > * {
	width: 35px;
	height: 35px;
}

.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;
}
.cart-lightbox .product-card .add-to-cart {
	display: flex;
	width: 100%;
	margin-top: 20px;
}
.cart-lightbox .product-card .product-stock {
	display: 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 */