/**
 * NNF Commerce — Wishlist Component (Floating Buttons, Badges, Drawer & Wishlist Page)
 * @package NNF_Commerce
 */

/* ==========================================================================
   NNF COMMERCE - NATIVE WISHLIST SYSTEM (WOODMART VEGETABLES INSPIRED)
   ========================================================================== */

/* 1. Header Wishlist Icon & Badge */
a.nnf-header-wishlist,
.nnf-header-wishlist {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	text-decoration: none;
	color: var(--wd-dark, #242424);
	position: relative;
	transition: color 0.2s ease;
	cursor: pointer;
}

.nnf-wishlist-circle-icon {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	border: 1.5px solid rgba(0, 0, 0, 0.1);
	background: #ffffff;
	color: var(--wd-dark, #242424);
	transition: all 0.25s ease;
}

.nnf-header-wishlist:hover .nnf-wishlist-circle-icon {
	border-color: var(--wd-primary, #8CBC67);
	color: var(--wd-primary, #8CBC67);
	box-shadow: 0 4px 12px rgba(140, 188, 103, 0.2);
}

.nnf-header-wishlist .nnf-wishlist-counter {
	position: absolute;
	top: -4px;
	right: -4px;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 9px;
	background: var(--wd-primary, #8CBC67);
	color: #ffffff;
	font-size: 10px;
	font-weight: 700;
	line-height: 18px;
	text-align: center;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
	transition: transform 0.2s ease, background-color 0.2s ease;
}

.nnf-header-wishlist:hover .nnf-wishlist-counter {
	transform: scale(1.1);
}

.nnf-wishlist-meta {
	display: flex;
	flex-direction: column;
	line-height: 1.2;
}

.nnf-wishlist-meta-title {
	font-size: 13px;
	font-weight: 600;
	color: var(--wd-dark, #242424);
}

@media (max-width: 991px) {
	.nnf-wishlist-meta {
		display: none;
	}
	.nnf-wishlist-circle-icon {
		width: 38px;
		height: 38px;
	}
}

/* 2. Product Card Wishlist Heart Button */
.nnf-wishlist-btn {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 9;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.95);
	backdrop-filter: blur(4px);
	border: 1px solid rgba(0, 0, 0, 0.06);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: #555555;
	transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
	padding: 0;
}

.nnf-wishlist-heart-icon {
	transition: transform 0.2s ease, fill 0.2s ease, stroke 0.2s ease;
}

.nnf-wishlist-btn:hover {
	background: #ffffff;
	color: #e74c3c;
	transform: scale(1.1);
	box-shadow: 0 4px 14px rgba(231, 76, 60, 0.22);
}

.nnf-wishlist-btn.added {
	color: #e74c3c;
	background: #ffffff;
}

.nnf-wishlist-btn.added .nnf-wishlist-heart-icon {
	fill: #e74c3c;
	stroke: #e74c3c;
}

.nnf-wishlist-btn.loading {
	pointer-events: none;
	opacity: 0.6;
}

.nnf-wishlist-btn-tooltip {
	position: absolute;
	right: calc(100% + 8px);
	top: 50%;
	transform: translateY(-50%);
	background: #1e293b;
	color: #ffffff;
	padding: 4px 10px;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 500;
	white-space: nowrap;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
	pointer-events: none;
	box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.nnf-wishlist-btn:hover .nnf-wishlist-btn-tooltip {
	opacity: 1;
	visibility: visible;
}

/* 3. Single Product Page Wishlist Button */
.nnf-single-wishlist-wrap {
	margin-top: 15px;
	margin-bottom: 20px;
}

.nnf-single-wishlist-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 20px;
	border-radius: 25px;
	border: 1.5px solid #e2e8f0;
	background: #ffffff;
	font-size: 13px;
	font-weight: 600;
	color: #334155;
	cursor: pointer;
	transition: all 0.25s ease;
}

.nnf-single-wishlist-btn:hover {
	border-color: #e74c3c;
	color: #e74c3c;
	box-shadow: 0 4px 12px rgba(231, 76, 60, 0.15);
}

.nnf-single-wishlist-btn.added {
	border-color: #fca5a5;
	background: #fff5f5;
	color: #e74c3c;
}

.nnf-single-wishlist-btn.added .nnf-wishlist-heart-icon {
	fill: #e74c3c;
	stroke: #e74c3c;
}

/* ==========================================================================
   4. WoodMart Vegetables Style Wishlist Page (Grid, Head, Bulk Actions)
   ========================================================================== */
.nnf-wishlist-page-wrapper {
	width: 100%;
}

/* Page Title Banner & Breadcrumbs */
.wd-page-title.page-title-default {
	background: #fbfbfb;
	border-bottom: 1px solid #eef0f3;
	padding: 24px 0 20px 0;
	margin-bottom: 30px;
}

.wd-page-title .entry-title.title {
	font-size: 32px;
	font-weight: 800;
	color: var(--wd-dark, #242424);
	margin: 0 0 6px 0;
	line-height: 1.2;
}

.wd-breadcrumbs {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: var(--wd-dark-muted, #777777);
}

.wd-breadcrumbs a {
	color: var(--wd-dark-muted, #777777);
	text-decoration: none;
	transition: color 0.15s ease;
}

.wd-breadcrumbs a:hover {
	color: var(--wd-primary, #8CBC67);
}

.wd-breadcrumbs .wd-delimiter {
	color: #bbb;
}

.wd-breadcrumbs .wd-last {
	color: var(--wd-dark, #242424);
	font-weight: 600;
}

/* Wishlist Head: Section Title */
.wd-wishlist-head {
	margin: 10px 0 16px 0;
}

.wd-wishlist-head .title {
	font-size: 14px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--wd-dark, #242424);
	margin: 0;
}

/* Bulk Actions Bar - Xóa tất cả */
.wd-wishlist-bulk-action {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	border-top: 1px solid #eef0f3;
	border-bottom: 1px solid #eef0f3;
	padding: 12px 0;
	margin-bottom: 24px;
}

a.nnf-wishlist-clear-all-btn,
button.nnf-wishlist-clear-all-btn,
.nnf-wishlist-clear-all-btn {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 13px;
	font-weight: 600;
	color: #64748b;
	text-decoration: none;
	padding: 7px 16px;
	border-radius: 6px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	cursor: pointer;
	transition: all 0.2s ease;
	line-height: 1;
}

.nnf-wishlist-clear-all-btn:hover {
	color: #ef4444;
	background: #fef2f2;
	border-color: #fecaca;
}

.nnf-wishlist-clear-all-btn .wd-action-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* Product Grid for Wishlist */
.woocommerce .wd-products-element ul.nnf-wishlist-grid,
.wd-products-element .nnf-wishlist-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 20px;
	list-style: none;
	padding: 0;
	margin: 0 0 50px 0;
}

/* Wishlist Item Card Controls - Nút xóa đơn lẻ đặt phía trên ảnh, không cần checkbox */
.nnf-wishlist-item,
ul.nnf-wishlist-grid li.product.nnf-wishlist-item {
	position: relative;
	background: #ffffff;
	border-radius: var(--wd-radius, 8px);
	padding: 0 0 14px 0;
	border: 1px solid var(--wd-border, #eaeaea);
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.nnf-wishlist-item:hover,
ul.nnf-wishlist-grid li.product.nnf-wishlist-item:hover {
	border-color: rgba(140, 188, 103, 0.4);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.nnf-wishlist-item .wd-wishlist-product-actions {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	padding: 8px 12px 6px 12px;
	width: 100%;
	box-sizing: border-box;
	background: #ffffff;
	z-index: 5;
}

/* Wishlist Item Image Wrap: Hiển thị tràn sát tuyệt đối mép trên, trái và phải của thẻ sản phẩm */
.nnf-wishlist-item .nnf-prod-img-wrap,
ul.nnf-wishlist-grid li.product.nnf-wishlist-item .nnf-prod-img-wrap {
	width: 100% !important;
	max-width: 100% !important;
	aspect-ratio: 1 / 1 !important;
	overflow: hidden !important;
	margin: 0 !important;
	padding: 0 !important;
	border-radius: var(--wd-radius, 8px) var(--wd-radius, 8px) 0 0 !important;
	position: relative !important;
	z-index: 4 !important;
	box-sizing: border-box !important;
}

.nnf-wishlist-item .nnf-prod-img-wrap > a,
ul.nnf-wishlist-grid li.product.nnf-wishlist-item .nnf-prod-img-wrap > a {
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	aspect-ratio: 1 / 1 !important;
	overflow: hidden !important;
	line-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
}

.nnf-wishlist-item .nnf-prod-img-wrap img,
ul.nnf-wishlist-grid li.product.nnf-wishlist-item .nnf-prod-img-wrap img,
.nnf-wishlist-item .nnf-prod-img-wrap .nnf-prod-img {
	width: 100% !important;
	min-width: 100% !important;
	max-width: 100% !important;
	height: 100% !important;
	aspect-ratio: 1 / 1 !important;
	object-fit: cover !important;
	display: block !important;
	margin: 0 !important;
	padding: 0 !important;
	border-radius: var(--wd-radius, 8px) var(--wd-radius, 8px) 0 0 !important;
	transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}

.nnf-wishlist-item:hover .nnf-prod-img-wrap img,
ul.nnf-wishlist-grid li.product.nnf-wishlist-item:hover .nnf-prod-img-wrap img {
	transform: scale(1.04) !important;
}

/* Wishlist Item Content & Title: Khối chữ bám sát ngay dưới ảnh */
.nnf-wishlist-item .nnf-prod-content {
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	justify-content: flex-start;
	background: #ffffff;
	margin-top: 8px;
	padding: 0 12px;
	width: 100%;
	box-sizing: border-box;
}

.nnf-wishlist-item .nnf-prod-title,
ul.nnf-wishlist-grid li.product .nnf-prod-title {
	font-size: 14px;
	font-weight: 700;
	margin: 0 0 4px 0;
	padding: 0;
	line-height: 1.35;
	height: 38px;
	min-height: 38px;
	max-height: 38px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
	word-break: break-word;
}

.nnf-wishlist-item .nnf-prod-title a,
ul.nnf-wishlist-grid li.product .nnf-prod-title a {
	color: var(--wd-dark, #242424);
	text-decoration: none;
	transition: color 0.2s ease;
}

.nnf-wishlist-item .nnf-prod-title a:hover,
ul.nnf-wishlist-grid li.product .nnf-prod-title a:hover {
	color: var(--wd-primary, #8CBC67);
}

.nnf-wishlist-item .wd-wishlist-product-remove a {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 12px;
	font-weight: 600;
	color: #718096;
	text-decoration: none;
	padding: 4px 10px;
	border-radius: 4px;
	background: #f3f4f6;
	border: 1px solid #e5e7eb;
	line-height: 1;
	transition: all 0.2s ease;
}

.nnf-wishlist-item .wd-wishlist-product-remove a:hover {
	color: #ef4444;
	background: #fef2f2;
	border-color: #fecaca;
}

.nnf-wishlist-item .wd-wishlist-product-remove .wd-action-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* Responsive Grid for Wishlist */
@media (max-width: 1024px) {
	.woocommerce .wd-products-element ul.nnf-wishlist-grid,
	.wd-products-element .nnf-wishlist-grid {
		grid-template-columns: repeat(3, 1fr);
		gap: 16px;
	}
}

@media (max-width: 768px) {
	.wd-page-title.page-title-default {
		padding: 16px 0;
		margin-bottom: 20px;
	}
	.wd-page-title .entry-title.title {
		font-size: 24px;
	}
	.woocommerce .wd-products-element ul.nnf-wishlist-grid,
	.wd-products-element .nnf-wishlist-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 12px;
	}
}

@media (max-width: 480px) {
	.woocommerce .wd-products-element ul.nnf-wishlist-grid,
	.wd-products-element .nnf-wishlist-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 10px;
	}
	.nnf-wishlist-item .wd-wishlist-product-actions {
		padding: 3px 6px;
		gap: 5px;
	}
	.nnf-wishlist-item .wd-wishlist-product-remove .wd-action-text {
		display: none;
	}
}

/* 5. Empty Wishlist State */
.nnf-empty-wishlist {
	padding: 70px 20px;
	background: #ffffff;
	border-radius: 12px;
	border: 1px solid #eef2f6;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
	margin: 20px 0;
	text-align: center;
}

.nnf-empty-wishlist-icon {
	color: #cbd5e1;
	margin-bottom: 20px;
}

.nnf-empty-wishlist-title {
	font-size: 22px;
	font-weight: 700;
	color: #1e293b;
	margin-bottom: 10px;
}

.nnf-empty-wishlist-message {
	color: #64748b;
	font-size: 15px;
	margin-bottom: 28px;
}

.woocommerce .nnf-empty-wishlist .return-to-shop a.button,
.nnf-empty-wishlist .return-to-shop a.button {
	background: var(--wd-primary, #8CBC67);
	color: #ffffff;
	padding: 12px 30px;
	border-radius: 25px;
	font-weight: 600;
	font-size: 14px;
	text-decoration: none;
	display: inline-block;
	transition: all 0.25s ease;
	box-shadow: 0 4px 12px rgba(140, 188, 103, 0.3);
}

.woocommerce .nnf-empty-wishlist .return-to-shop a.button:hover,
.nnf-empty-wishlist .return-to-shop a.button:hover {
	background: var(--wd-primary-hover, #315c24);
	color: #ffffff;
	text-decoration: none;
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(140, 188, 103, 0.45);
}

/* 6. Toast Notification */
.nnf-wishlist-toast {
	position: fixed;
	bottom: 25px;
	right: 25px;
	z-index: 999999;
	background: #1e293b;
	color: #ffffff;
	padding: 12px 22px;
	border-radius: 30px;
	font-size: 13px;
	font-weight: 500;
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
	display: inline-flex;
	align-items: center;
	gap: 10px;
	opacity: 0;
	transform: translateY(15px);
	transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
	pointer-events: none;
}

.nnf-wishlist-toast svg {
	color: #ef4444;
	flex-shrink: 0;
}

.nnf-wishlist-toast.show {
	opacity: 1;
	transform: translateY(0);
}

/* 7. Skeleton / Loading Spinner */
.nnf-wishlist-skeleton-loader {
	padding: 60px 20px;
	text-align: center;
}

.nnf-wishlist-spinner {
	width: 40px;
	height: 40px;
	border: 3px solid #e2e8f0;
	border-top-color: var(--wd-primary, #8CBC67);
	border-radius: 50%;
	animation: nnf-spin 0.8s linear infinite;
	margin: 0 auto 15px;
}

@keyframes nnf-spin {
	to { transform: rotate(360deg); }
}

/* 8. Mobile & Tablet Responsive Wishlist Table */
@media (max-width: 768px) {
	.nnf-wishlist-table thead {
		display: none;
	}

	.nnf-wishlist-table tbody tr {
		display: flex;
		flex-direction: column;
		padding: 20px 16px 16px;
		margin-bottom: 16px;
		border-radius: 12px;
		border: 1px solid #e2e8f0;
		position: relative;
		gap: 10px;
		background: #ffffff;
	}

	.nnf-wishlist-table .product-remove {
		position: absolute;
		top: 10px;
		right: 10px;
		width: auto;
	}

	.nnf-wishlist-table .product-thumbnail {
		width: 100%;
		text-align: center;
		padding: 0;
	}

	.nnf-wishlist-thumb-img {
		width: 110px;
		height: 110px;
		margin: 0 auto;
	}

	.nnf-wishlist-table .product-name {
		text-align: center;
		padding: 4px 0;
		font-size: 16px;
	}

	.nnf-wishlist-table .product-price {
		text-align: center;
		padding: 0;
	}

	.nnf-wishlist-table .product-stock-status {
		text-align: center;
		padding: 2px 0;
	}

	.nnf-wishlist-table .product-add-to-cart {
		width: 100%;
		text-align: center;
		padding: 10px 0 0;
	}

	.nnf-wishlist-add-to-cart,
	.nnf-wishlist-select-options {
		width: 100%;
		justify-content: center;
		padding: 12px;
		font-size: 14px;
	}
}


