/**
 * Quick view & wishlist styles
 */

.yunfanzhi-product-card .product-card-inner {
	position: relative;
}

.yunfanzhi-product-card .woocommerce-loop-product__link {
	position: relative;
	display: block;
}

.product-card-actions {
	position: absolute;
	top: 12px;
	right: 12px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	opacity: 0;
	transform: translateY(4px);
	transition: opacity var(--transition), transform var(--transition);
	z-index: 2;
}

.yunfanzhi-product-card:hover .product-card-actions,
.yunfanzhi-product-card:focus-within .product-card-actions {
	opacity: 1;
	transform: translateY(0);
}

.product-action-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.95);
	color: var(--color-text);
	box-shadow: var(--shadow-md);
	cursor: pointer;
	transition: background var(--transition), color var(--transition), transform var(--transition);
}

.product-action-btn:hover,
.product-action-btn.is-active {
	background: var(--color-primary);
	color: #fff;
}

.product-action-btn.is-loading {
	opacity: 0.6;
	pointer-events: none;
}

.product-action-btn.is-active svg {
	fill: currentColor;
}

/* Header wishlist */
.header-wishlist {
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	padding: 8px;
	border-radius: var(--radius);
	color: var(--color-text);
	transition: background var(--transition);
}

.header-wishlist:hover {
	background: var(--color-bg-alt);
	color: var(--color-primary);
}

.wishlist-count {
	position: absolute;
	top: 0;
	right: 0;
	background: var(--color-accent);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	min-width: 18px;
	height: 18px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.wishlist-count.is-empty {
	display: none;
}

/* Header saved list */
.header-saved-list {
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	padding: 8px;
	border-radius: var(--radius);
	color: var(--color-text);
	transition: background var(--transition);
}

.header-saved-list:hover {
	background: var(--color-bg-alt);
	color: var(--color-primary);
}

.saved-list-count {
	position: absolute;
	top: 0;
	right: 0;
	background: var(--color-primary);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	min-width: 18px;
	height: 18px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.saved-list-count.is-empty {
	display: none;
}

.mini-cart-save-later {
	display: block;
	margin-top: 4px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--color-primary);
	font-size: 12px;
	cursor: pointer;
	text-decoration: underline;
}

.mini-cart-save-later:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* Quick view modal */
.quick-view-modal {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	opacity: 0;
	visibility: hidden;
	transition: opacity var(--transition), visibility var(--transition);
}

.quick-view-modal[aria-hidden="false"] {
	opacity: 1;
	visibility: visible;
}

body.quick-view-open {
	overflow: hidden;
}

.quick-view-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.6);
	backdrop-filter: blur(4px);
}

.quick-view-panel {
	position: relative;
	width: min(920px, 100%);
	max-height: 90vh;
	overflow-y: auto;
	background: var(--color-bg);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-md);
	padding: 32px;
}

.quick-view-close {
	position: absolute;
	top: 12px;
	right: 16px;
	background: none;
	border: none;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	color: var(--color-text-muted);
	z-index: 1;
}

.quick-view-close:hover {
	color: var(--color-text);
}

.quick-view-product {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 32px;
	align-items: start;
}

.quick-view-gallery img {
	width: 100%;
	border-radius: var(--radius-lg);
}

.quick-view-title {
	font-size: 24px;
	margin: 0 0 12px;
	color: var(--color-text);
}

.quick-view-price {
	font-size: 22px;
	font-weight: 700;
	color: var(--color-primary);
	margin-bottom: 16px;
}

.quick-view-desc {
	color: var(--color-text-muted);
	line-height: 1.7;
	margin-bottom: 24px;
}

.quick-view-actions {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

.quick-view-loader,
.quick-view-error {
	text-align: center;
	padding: 48px 24px;
	color: var(--color-text-muted);
}

.single-product .single-wishlist-btn {
	margin-left: 12px;
}

.single-wishlist-btn.is-active {
	background: var(--color-primary);
	color: #fff;
	border-color: var(--color-primary);
}

/* Wishlist page */
.wishlist-header {
	margin-bottom: 32px;
}

.wishlist-title {
	font-size: 32px;
	margin: 0 0 8px;
}

.wishlist-count-text {
	color: var(--color-text-muted);
	margin: 0;
}

.wishlist-empty {
	text-align: center;
	padding: 64px 24px;
	background: var(--color-bg-alt);
	border-radius: var(--radius-lg);
}

.wishlist-empty p {
	margin: 0 0 24px;
	color: var(--color-text-muted);
}

.wishlist-products {
	margin-top: 24px;
}

/* Compare */
.header-compare {
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	padding: 8px;
	border-radius: var(--radius);
	color: var(--color-text);
	transition: background var(--transition);
}

.header-compare:hover {
	background: var(--color-bg-alt);
	color: var(--color-primary);
}

.compare-count {
	position: absolute;
	top: 0;
	right: 0;
	background: var(--color-primary);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	min-width: 18px;
	height: 18px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.compare-count.is-empty {
	display: none;
}

/* Loop second image hover */
.product-card-image-wrap {
	position: relative;
	overflow: hidden;
	display: block;
}

.product-card-image-wrap img {
	display: block;
	width: 100%;
	height: auto;
	transition: opacity 0.35s ease, transform 0.35s ease;
}

.product-card-image-wrap .product-hover-image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0;
}

.yunfanzhi-product-card:hover .product-card-image-wrap .product-hover-image,
.yunfanzhi-product-card:focus-within .product-card-image-wrap .product-hover-image {
	opacity: 1;
}

.yunfanzhi-product-card:hover .product-card-image-wrap > img:not(.product-hover-image),
.yunfanzhi-product-card:focus-within .product-card-image-wrap > img:not(.product-hover-image) {
	opacity: 0;
}

.compare-bar {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	background: var(--color-bg);
	border-top: 1px solid var(--color-border);
	box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
	padding: 12px 0;
	z-index: 95;
}

.compare-bar-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
}

.compare-bar-text {
	font-size: 14px;
	font-weight: 600;
	color: var(--color-text);
}

.compare-bar-actions {
	display: flex;
	gap: 8px;
}

.compare-page {
	padding: 48px 0;
}

.compare-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 32px;
}

.compare-title {
	font-size: 32px;
	margin: 0;
}

.compare-empty {
	text-align: center;
	padding: 64px 24px;
	background: var(--color-bg-alt);
	border-radius: var(--radius-lg);
}

.compare-table-wrap {
	overflow-x: auto;
}

.compare-table {
	width: 100%;
	border-collapse: collapse;
	min-width: 640px;
}

.compare-table th,
.compare-table td {
	padding: 16px;
	border: 1px solid var(--color-border);
	text-align: center;
	vertical-align: top;
}

.compare-table thead th {
	background: var(--color-bg-alt);
	font-weight: 600;
}

.compare-table tbody td:first-child {
	font-weight: 600;
	background: var(--color-bg-alt);
	text-align: left;
	white-space: nowrap;
}

.compare-product-col {
	position: relative;
	min-width: 160px;
}

.compare-product-col img {
	max-width: 120px;
	margin: 0 auto 8px;
	border-radius: var(--radius);
}

.compare-product-name {
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: var(--color-text);
}

.compare-remove-btn {
	position: absolute;
	top: 8px;
	right: 8px;
	background: var(--color-bg);
	border: 1px solid var(--color-border);
	border-radius: 50%;
	width: 28px;
	height: 28px;
	cursor: pointer;
	font-size: 18px;
	line-height: 1;
	color: var(--color-text-muted);
}

.compare-remove-btn:hover {
	background: var(--color-danger);
	border-color: var(--color-danger);
	color: #fff;
}

.single-compare-btn.is-active {
	background: var(--color-primary);
	color: #fff;
	border-color: var(--color-primary);
}

.recently-viewed-section {
	padding-top: 48px;
	border-top: 1px solid var(--color-border);
	margin-top: 48px;
}

@media (max-width: 768px) {
	.product-card-actions {
		opacity: 1;
		transform: none;
	}

	.quick-view-product {
		grid-template-columns: 1fr;
		gap: 20px;
	}

	.quick-view-panel {
		padding: 24px 20px;
	}
}
