/**
 * Кастомная корзина [custom_cart] — стиль 2026
 */

.custom-cart {
	--cc-radius: 14px;
	--cc-radius-sm: 10px;
	--cc-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
	--cc-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.08);
	--cc-border: 1px solid rgba(0, 0, 0, 0.06);
	--cc-accent: #ca0815;
	--cc-accent-hover: #a30610;
	--cc-text-muted: #64748b;
	--cc-bg: #fff;
	--cc-bg-soft: #f8fafc;
	margin: 0;
	font-family: inherit;
	position: relative;
}

/* Прелоадер корзины */
.custom-cart__loader {
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.85);
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
	z-index: 10;
	border-radius: var(--cc-radius);
	pointer-events: none;
}
.custom-cart__loader--active {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}
.custom-cart__loader-spinner {
	width: 40px;
	height: 40px;
	border: 3px solid var(--cc-bg-soft);
	border-top-color: var(--cc-accent);
	border-radius: 50%;
	animation: custom-cart-spin 0.7s linear infinite;
}
@keyframes custom-cart-spin {
	to { transform: rotate(360deg); }
}

/* Пустая корзина */
.custom-cart--empty {
	text-align: center;
	padding: 3rem 2rem;
	background: var(--cc-bg-soft);
	border-radius: var(--cc-radius);
}

.custom-cart__empty-text {
	margin: 0 0 1.25rem;
	color: var(--cc-text-muted);
	font-size: 1.05rem;
}

/* Список товаров — карточки */
.custom-cart__items {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	margin-bottom: 1.5rem;
}

.custom-cart__item {
	display: grid;
	grid-template-columns: 88px 1fr auto auto auto;
	align-items: center;
	gap: 1.25rem;
	padding: 1.25rem;
	background: var(--cc-bg);
	border: var(--cc-border);
	border-radius: var(--cc-radius);
	box-shadow: var(--cc-shadow);
	transition: box-shadow 0.2s ease;
}

.custom-cart__item:hover {
	box-shadow: var(--cc-shadow-hover);
}

.custom-cart__item-image {
	border-radius: var(--cc-radius-sm);
	overflow: hidden;
}

.custom-cart__item-image img {
	width: 88px;
	height: 88px;
	object-fit: cover;
	display: block;
}

.custom-cart__item-name {
	font-weight: 600;
	font-size: 1rem;
	text-decoration: none;
	color: inherit;
	line-height: 1.35;
	transition: color 0.2s;
}

.custom-cart__item-name:hover {
	color: var(--cc-accent);
}

.custom-cart__item-price {
	font-size: 0.9rem;
	color: var(--cc-text-muted);
}

/* Количество — минималистичный контрол */
.custom-cart__qty-wrap {
	display: inline-flex;
	align-items: center;
	background: var(--cc-bg-soft);
	border: var(--cc-border);
	border-radius: 999px;
	padding: 2px;
	gap: 0;
}

.custom-cart__qty-wrap .custom-cart__input-qty {
	width: 2.5rem;
	min-width: 2.5rem;
	margin: 0;
	padding: 0.4rem 0.2rem;
	border: none;
	background: transparent;
	border-radius: 0;
	text-align: center;
	font-size: 0.95rem;
	font-weight: 600;
	color: #0f172a;
}

.custom-cart__qty-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	min-width: 2rem;
	min-height: 2rem;
	padding: 0;
	border: none;
	background: transparent;
	color: var(--cc-text-muted);
	font-size: 1.1rem;
	line-height: 1;
	cursor: pointer;
	border-radius: 50%;
	transition: color 0.2s, background 0.2s;
}

.custom-cart__qty-btn:hover {
	color: #0f172a;
	background: rgba(0, 0, 0, 0.06);
}

.custom-cart__qty-btn--plus:hover {
	color: var(--cc-accent);
	background: rgba(202, 8, 21, 0.08);
}

.custom-cart__item-total {
	font-weight: 700;
	font-size: 1.05rem;
	white-space: nowrap;
	color: #0f172a;
}

/* Удалить */
.custom-cart__remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	font-size: 1.25rem;
	line-height: 1;
	text-decoration: none;
	color: var(--cc-text-muted);
	background: transparent;
	border: var(--cc-border);
	border-radius: 50%;
	transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.custom-cart__remove:hover {
	color: var(--cc-accent);
	background: rgba(202, 8, 21, 0.06);
	border-color: rgba(202, 8, 21, 0.2);
}

.custom-cart__remove-icon {
	display: block;
	width: 16px;
	height: 16px;
	pointer-events: none;
}

/* Кнопки в блоке итогов */
.custom-cart__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.75rem 1.5rem;
	border-radius: var(--cc-radius-sm);
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}

.custom-cart__btn:active {
	transform: scale(0.98);
}

.custom-cart__btn--shop {
	background: var(--cc-accent);
	color: #fff;
	border: none;
}

.custom-cart__btn--shop:hover {
	background: var(--cc-accent-hover);
	color: #fff;
}

/* Продолжить покупки — вторичная */
.custom-cart__btn--shop-link {
	background: transparent;
	color: #0f172a;
	border: 2px solid rgba(0, 0, 0, 0.12);
}

.custom-cart__btn--shop-link:hover {
	background: var(--cc-bg-soft);
	border-color: rgba(0, 0, 0, 0.2);
	color: #0f172a;
}

/* Перейти к оформлению — красная, основная */
.custom-cart__btn--checkout {
	background: var(--cc-accent);
	color: #fff;
	border: none;
	text-align: center;
}

.custom-cart__btn--checkout:hover {
	background: var(--cc-accent-hover);
	color: #fff;
}

/* Блок итогов */
.custom-cart__totals {
	background: var(--cc-bg);
	border: var(--cc-border);
	border-radius: var(--cc-radius);
	padding: 1.5rem;
	box-shadow: var(--cc-shadow);
}

.custom-cart__totals-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 0.5rem;
	font-size: 0.95rem;
}

.custom-cart__totals-row--total {
	font-size: 1.2rem;
	font-weight: 700;
	margin-top: 0.75rem;
	margin-bottom: 0;
	padding-top: 0.75rem;
	border-top: 2px solid rgba(0, 0, 0, 0.06);
	color: #0f172a;
}

.custom-cart__totals-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: 1.25rem;
}

.custom-cart__totals-actions .custom-cart__btn {
	flex: 1;
	min-width: 140px;
	box-sizing: border-box;
}

.custom-cart__totals-actions .custom-cart__btn--checkout {
	flex: 1.2;
	min-width: 180px;
}

/* Адаптив */
@media (max-width: 640px) {
	.custom-cart__item {
		grid-template-columns: 72px 1fr;
		grid-template-rows: auto auto;
		gap: 0.75rem;
		padding: 1rem;
		position: relative;
	}

	.custom-cart__item-qty,
	.custom-cart__item-total {
		grid-column: 2;
	}

	.custom-cart__item-remove {
		position: absolute;
		top: 0.5rem;
		right: 0.5rem;
		grid-column: unset;
		grid-row: unset;
		margin: 0;
	}

	.custom-cart__item-image {
		grid-row: 1 / -1;
	}

	.custom-cart__item-image img {
		width: 72px;
		height: 72px;
	}

	.custom-cart__totals-actions {
		flex-direction: column;
	}

	.custom-cart__totals-actions .custom-cart__btn,
	.custom-cart__totals-actions .custom-cart__btn--checkout {
		width: 100%;
		min-width: 0;
		flex: none;
	}
}
