/**
 * Wishlist Styles
 *
 * @package Astra Child
 */

/* ==========================================================================
   Wishlist Button - Product Loop (on thumbnail)
   ========================================================================== */

/* Button in product loop - positioned on thumbnail (bottom-left corner) */
.astra-shop-thumbnail-wrap .ceit-wishlist-btn {
	position: absolute;
	bottom: 10px;
	left: 10px;
	z-index: 10;
	width: 36px;
	height: 36px;
	padding: 0;
	background: #fff;
	border: none;
	border-radius: 50%;
	color: #666;
	cursor: pointer;
	transition: all 0.2s ease;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	opacity: 0;
	transform: translateY(5px);
}

.astra-shop-thumbnail-wrap:hover .ceit-wishlist-btn {
	opacity: 1;
	transform: translateY(0);
}

.astra-shop-thumbnail-wrap .ceit-wishlist-btn:hover {
	background: #fff;
	color: #e74c3c;
}

.astra-shop-thumbnail-wrap .ceit-wishlist-btn--active {
	color: #e74c3c;
	opacity: 1;
	transform: translateY(0);
}

.astra-shop-thumbnail-wrap .ceit-wishlist-btn--active:hover {
	color: #c0392b;
}

/* ==========================================================================
   Wishlist Button - Single Product & Default
   ========================================================================== */

.ceit-wishlist-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 50%;
	color: #999;
	cursor: pointer;
	transition: all 0.2s ease;
}

.ceit-wishlist-btn:hover {
	color: #e74c3c;
	border-color: #e74c3c;
	background: #fff;
}

.ceit-wishlist-btn--active {
	color: #e74c3c;
	border-color: #e74c3c;
}

.ceit-wishlist-btn--loading {
	pointer-events: none;
	position: relative;
}

.ceit-wishlist-btn--loading .ceit-wishlist-btn__icon {
	opacity: 0;
}

.ceit-wishlist-btn--loading::after {
	content: '';
	position: absolute;
	width: 16px;
	height: 16px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: ceit-wishlist-spin 0.6s linear infinite;
}

/* Loading state in thumbnail - keep button visible */
.astra-shop-thumbnail-wrap .ceit-wishlist-btn--loading {
	opacity: 1;
	transform: translateY(0);
}

@keyframes ceit-wishlist-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Success animation */
.ceit-wishlist-btn--success {
	animation: ceit-wishlist-pulse 0.4s ease;
}

/* Success state in thumbnail - keep button visible */
.astra-shop-thumbnail-wrap .ceit-wishlist-btn--success {
	opacity: 1;
	transform: translateY(0);
}

@keyframes ceit-wishlist-pulse {
	0% {
		transform: scale(1);
	}

	50% {
		transform: scale(1.2);
	}

	100% {
		transform: scale(1);
	}
}

.ceit-wishlist-btn__icon {
	flex-shrink: 0;
	transition: transform 0.2s ease;
}

/* ==========================================================================
   Wishlist Page
   ========================================================================== */

.ceit-wishlist {
	margin: 30px 0;
}

/* Empty State */
.ceit-wishlist__empty {
	text-align: center;
	padding: 60px 20px;
	background: #f9f9f9;
	border-radius: 8px;
}

.ceit-wishlist__empty-icon {
	color: #ccc;
	margin-bottom: 20px;
}

.ceit-wishlist__empty-title {
	font-size: 24px;
	margin: 0 0 10px;
	color: #333;
}

.ceit-wishlist__empty-text {
	color: #666;
	margin: 0 0 20px;
	max-width: 400px;
	margin-left: auto;
	margin-right: auto;
}

.ceit-wishlist__empty-btn {
	display: inline-block;
}

/* Actions */
.ceit-wishlist__actions {
	margin-bottom: 20px;
	text-align: right;
}

.ceit-wishlist__clear {
	background: #f5f5f5;
	border: 1px solid #ddd;
	color: #666;
}

.ceit-wishlist__clear:hover {
	background: #eee;
	border-color: #ccc;
	color: #333;
}

.ceit-wishlist__clear--loading {
	pointer-events: none;
	position: relative;
	color: transparent !important;
}

.ceit-wishlist__clear--loading::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 16px;
	height: 16px;
	margin: -8px 0 0 -8px;
	border: 2px solid #666;
	border-right-color: transparent;
	border-radius: 50%;
	animation: ceit-wishlist-spin 0.6s linear infinite;
}

/* Grid */
.ceit-wishlist__grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 24px;
}

.ceit-wishlist__item {
	position: relative;
	background: #fff;
	border: 1px solid #eee;
	border-radius: 8px;
	padding: 15px;
	transition: box-shadow 0.2s ease;
}

.ceit-wishlist__item:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ceit-wishlist__remove {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 28px;
	height: 28px;
	padding: 0;
	background: #f5f5f5;
	border: none;
	border-radius: 50%;
	color: #999;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
	z-index: 1;
}

.ceit-wishlist__remove:hover {
	background: var(--ceit-color-primary);
	color: #fff;
}

.ceit-wishlist__remove.ceit-wishlist-btn--loading {
	pointer-events: none;
}

.ceit-wishlist__remove.ceit-wishlist-btn--loading svg {
	opacity: 0;
}

.ceit-wishlist__remove.ceit-wishlist-btn--loading::after {
	content: '';
	position: absolute;
	width: 14px;
	height: 14px;
	border: 2px solid #999;
	border-right-color: transparent;
	border-radius: 50%;
	animation: ceit-wishlist-spin 0.6s linear infinite;
}

.ceit-wishlist__item-link {
	display: block;
	text-decoration: none;
	color: inherit;
}

.ceit-wishlist__item-image {
	margin-bottom: 12px;
	text-align: center;
}

.ceit-wishlist__item-image img {
	max-width: 100%;
	height: auto;
	border-radius: 4px;
}

.ceit-wishlist__item-title {
	font-size: 14px;
	font-weight: 600;
	margin: 0 0 8px;
	color: #333;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.ceit-wishlist__item-link:hover .ceit-wishlist__item-title {
	color: var(--ceit-color-primary, #0073aa);
}

.ceit-wishlist__item-price {
	font-size: 16px;
	font-weight: 600;
	color: #333;
	margin-bottom: 8px;
}

.ceit-wishlist__item-price del {
	color: #999;
	font-weight: 400;
	font-size: 13px;
}

.ceit-wishlist__item-price ins {
	text-decoration: none;
	color: var(--ceit-color-primary);
}

.ceit-wishlist__item-stock {
	margin-bottom: 12px;
}

.ceit-wishlist__stock {
	display: inline-block;
	padding: 3px 8px;
	border-radius: 3px;
	font-size: 11px;
	font-weight: 500;
}

.ceit-wishlist__stock--in-stock {
	background: #e8f5e9;
	color: #2e7d32;
}

.ceit-wishlist__stock--out-of-stock {
	background: #ffebee;
	color: #c62828;
}

.ceit-wishlist__stock--on-backorder {
	background: #fff3e0;
	color: #ef6c00;
}

.ceit-wishlist__item-actions {
	margin-top: auto;
}

.ceit-wishlist__item-actions .button {
	width: 100%;
	text-align: center;
}

.ceit-wishlist__unavailable {
	display: block;
	padding: 10px;
	background: #f5f5f5;
	color: #999;
	border-radius: 4px;
	font-size: 13px;
	text-align: center;
}

/* ==========================================================================
   Header Wishlist Count
   ========================================================================== */

.ceit-main-bar__icon-link--wishlist {
	position: relative;
}

.ceit-main-bar__wishlist-count {
	position: absolute;
	top: -5px;
	right: -5px;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	background: var(--ceit-color-primary, var(--ceit-color-primary));
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	line-height: 18px;
	text-align: center;
	border-radius: 9px;
	transition: transform 0.2s ease;
	@media (max-width: 576px) {
		width: 14px;
		min-width: 14px;
		height: 14px;
		padding: 0;
		font-size: 10px;
	}
}

.ceit-main-bar__wishlist-count--pulse {
	animation: ceit-wishlist-counter-pulse 0.4s ease;
}

@keyframes ceit-wishlist-counter-pulse {
	0% {
		transform: scale(1);
	}

	50% {
		transform: scale(1.4);
	}

	100% {
		transform: scale(1);
	}
}

/* ==========================================================================
   Wishlist Notice
   ========================================================================== */

.ceit-wishlist-notice {
	position: fixed;
	bottom: 20px;
	right: 20px;
	z-index: 9999;
	display: flex;
	align-items: center;
	gap: 15px;
	padding: 15px 20px;
	background: #333;
	color: #fff;
	border-radius: 6px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
	transform: translateY(100px);
	opacity: 0;
	transition: all 0.3s ease;
}

.ceit-wishlist-notice--visible {
	transform: translateY(0);
	opacity: 1;
}

.ceit-wishlist-notice--success {
	background: var(--ceit-color-primary);
}

.ceit-wishlist-notice--error {
	background: #333;
}

.ceit-wishlist-notice__text {
	flex: 1;
}

.ceit-wishlist-notice__link {
	display: inline-block;
	padding: 6px 14px;
	background: rgba(255, 255, 255, 0.2);
	color: #fff;
	text-decoration: none;
	border-radius: 4px;
	font-size: 13px;
	font-weight: 500;
	transition: background 0.2s ease;
	white-space: nowrap;
}

.ceit-wishlist-notice__link:hover {
	background: rgba(255, 255, 255, 0.3);
	color: #fff;
}

.ceit-wishlist-notice__close {
	width: 24px;
	height: 24px;
	padding: 0;
	background: rgba(255, 255, 255, 0.2);
	border: none;
	border-radius: 50%;
	color: #fff;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s ease;
}

.ceit-wishlist-notice__close:hover {
	background: rgba(255, 255, 255, 0.3);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
	.ceit-wishlist__grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 768px) {
	.ceit-wishlist__grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 16px;
	}

	.ceit-wishlist-notice {
		left: 20px;
		right: 20px;
		bottom: 10px;
	}
}

@media (max-width: 480px) {
	.ceit-wishlist__grid {
		grid-template-columns: 1fr;
	}
}