/* Shop List (Cart & Wishlist) - Універсальні стилі
================================================== */

:root {
	--shop-list-width: 760px;
	--shop-list-padding: 30px;
	--shop-list-mobile-width: 100vw;
	--shop-list-mobile-padding: 20px;
}

/* Загальні стилі лайтбоксів
========================== */
.shop-list-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;
}

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

.shop-list-lightbox .lightbox-section {
	position: fixed;
	top: 0;
	right: -120vw;
	width: var(--shop-list-width);
	height: 100dvh;
	max-height: 100dvh;
	margin-top: 0;
	padding: var(--shop-list-padding);
	background: #fff;
	z-index: 9999;
	transition: right 0.3s ease;
	overflow-y: auto;
	border-radius: 0;
}

.shop-list-lightbox.active .lightbox-section {
	right: 0;
}

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

/* Кнопка закриття
================ */
.shop-list-lightbox .close-lightbox {
	position: absolute;
	top: var(--shop-list-padding);
	right: var(--shop-list-padding);
	padding: 0;
	background: transparent;
	border-radius: 7px;
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.3s ease;
	z-index: 1;
}

.shop-list-lightbox .close-lightbox img {
	width: 28px;
	height: 28px;
}

/* Хедер
====== */
.shop-list-lightbox .shop-list-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 30px;
	padding-right: 45px;
}

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

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

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

/* Тіло списку
=========== */
.shop-list-lightbox .shop-list-body {
	flex: 1;
	overflow-y: auto;
	margin: 0 -10px;
	padding: 0 10px;
}

.shop-list-lightbox .shop-list-items {
	display: flex;
	flex-direction: column;
}

/* Порожній список
=============== */
.shop-list-lightbox .shop-list-empty-message {
	text-align: center;
	padding: 60px 20px;
}

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

/* Футер (тільки для корзини)
========================== */
.shop-list-lightbox .shop-list-footer {
	margin-top: auto;
	padding-top: 30px;
	border-top: 1px solid var(--border);
}

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

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

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

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

/* Кнопки дій
=========== */
.shop-list-lightbox .shop-list-actions {
	display: flex;
	flex-direction: row;
	gap: var(--blocks-indent);
	overflow: hidden;
}

.shop-list-lightbox .shop-list-actions .btn {
	width: 100%;
}

/* Стани завантаження
================== */
.shop-list-lightbox .shop-list-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;
}

.shop-list-lightbox.loading .shop-list-loading {
	display: flex;
}

.shop-list-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); }
}

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

/* Upsell Block (тільки для корзини)
================================= */
.shop-list-lightbox .shop-list-upsell-wrapper {
	margin-top: 25px;
	padding-top: 25px;
	border-top: 1px solid var(--border);
}

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

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

.shop-list-lightbox .shop-list-upsell-header .upsell-swiper-buttons {
	margin: 0;
	gap: 8px;
}

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

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

.shop-list-lightbox .shop-list-upsell-products {
	position: relative;
}

.shop-list-lightbox .shop-list-upsell-products:not(.has-slider) {
	display: flex;
	flex-wrap: wrap;
	gap: 15px;
}

.shop-list-lightbox .shop-list-upsell-products.has-slider .product-card {
	width: auto;
}

/* Адаптив
======== */
@media (max-width: 768px) {
	.shop-list-lightbox .lightbox-section {
		width: var(--shop-list-mobile-width);
		right: -100%;
		padding: var(--shop-list-mobile-padding);
	}

	.shop-list-lightbox .close-lightbox {
		top: 20px;
		right: 20px;
		width: 32px;
		height: 32px;
	}

	.shop-list-lightbox .shop-list-header {
		margin-bottom: 20px;
		padding-right: 40px;
	}

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

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

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

	.shop-list-lightbox .shop-list-actions .btn {
		height: 45px;
		font-size: 14px;
	}

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

/* Специфічні налаштування для корзини
=================================== */
.cart-lightbox {
	--products-in-col: 4;
	--products-indent-w: 15px;
}

@media (max-width: 768px) {
	.cart-lightbox {
		--products-in-col: 2;
	}
}

/* Лічильники
========== */
.wishlist-counter:empty,
.cart-counter:empty {
	display: none;
}