/**
 * Simple Wishlist styles.
 */

/* Product card / loop buttons */
.wc-sw-add-to-wishlist {
	cursor: pointer;
	transition: all 0.2s ease;
}

.wc-sw-add-to-wishlist.is-on-wishlist {
	/* User can style this, e.g. filled heart */
	opacity: 0.9;
}

.wc-sw-add-to-wishlist.loading {
	opacity: 0.6;
	pointer-events: none;
}

/* Wishlist page */
.sw-wishlist-page {
	margin-top: 1em;
}

.sw-wishlist-lists-nav {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1rem;
	margin-bottom: 1.5rem;
	border-bottom: 1px solid #e0e0e0;
	padding-bottom: 1rem;
}

.sw-lists-tabs {
	display: flex;
	flex-wrap: wrap;
	list-style: none;
	margin: 0;
	padding: 0;
	gap: 0.5rem;
}

.sw-lists-tabs li {
	margin: 0;
}

.sw-lists-tabs a {
	display: inline-block;
	padding: 0.5rem 1rem;
	text-decoration: none;
	border: 1px solid #ddd;
	border-radius: 4px;
	background: #f9f9f9;
	color: inherit;
}

.sw-lists-tabs li.active a {
	background: #333;
	color: #fff;
	border-color: #333;
}

.sw-lists-tabs .count {
	font-size: 0.85em;
	opacity: 0.8;
}

.sw-lists-tabs .default-badge {
	display: inline-block;
	font-size: 0.75em;
	background: #eee;
	padding: 0.1em 0.4em;
	border-radius: 3px;
	margin-left: 0.3em;
}

.sw-lists-tabs li.active .default-badge {
	background: rgba(255, 255, 255, 0.2);
}

.sw-create-list {
	margin-left: auto;
}

.sw-create-list-form {
	display: flex;
	gap: 0.5rem;
	align-items: center;
	flex-wrap: wrap;
}

.sw-create-list-form input[type="text"] {
	min-width: 200px;
}

/* List content */
.sw-wishlist-list {
	display: none;
}

.sw-wishlist-list.active {
	display: block;
}

.sw-list-header {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	margin-bottom: 1.5rem;
}

.sw-list-header h2 {
	margin: 0;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.sw-list-header .button-link {
	background: none;
	border: none;
	cursor: pointer;
	padding: 0.2em;
	font-size: 1em;
	line-height: 1;
}

.sw-list-actions {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.sw-empty-list {
	padding: 2rem;
	text-align: center;
	background: #f9f9f9;
	border-radius: 4px;
}

/* Table – inspired by WooCommerce cart */
.sw-wishlist-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 1.5rem;
}

.sw-wishlist-table th,
.sw-wishlist-table td {
	padding: 0.75rem;
	border-bottom: 1px solid #e0e0e0;
	vertical-align: middle;
	text-align: left;
}

.sw-wishlist-table th {
	font-weight: 600;
	background: #fafafa;
}

.sw-wishlist-table .product-thumbnail img {
	max-width: 80px;
	height: auto;
	display: block;
}

.sw-wishlist-table .product-remove .remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.5em;
	height: 1.5em;
	font-size: 1.4em;
	line-height: 1;
	border: none;
	background: transparent;
	color: #a00;
	cursor: pointer;
	text-decoration: none;
}

.sw-wishlist-table .product-remove .remove:hover {
	color: #000;
}

.sw-wishlist-table .in-stock {
	color: #0a0;
}

.sw-wishlist-table .out-of-stock {
	color: #a00;
}

.sw-wishlist-table .sw-not-available {
	color: #999;
	font-size: 0.9em;
}

/* Responsive */
@media (max-width: 768px) {
	.sw-wishlist-table thead {
		display: none;
	}

	.sw-wishlist-table td {
		display: flex;
		justify-content: space-between;
		align-items: center;
		border: none;
		padding: 0.4rem 0;
	}

	.sw-wishlist-table td::before {
		content: attr(data-title);
		font-weight: 600;
		margin-right: 1rem;
	}

	.sw-wishlist-table .product-thumbnail,
	.sw-wishlist-table .product-remove,
	.sw-wishlist-table .product-add-to-cart {
		justify-content: flex-start;
	}

	.sw-wishlist-table .product-thumbnail::before,
	.sw-wishlist-table .product-remove::before,
	.sw-wishlist-table .product-add-to-cart::before {
		display: none;
	}

	.sw-list-header {
		flex-direction: column;
		align-items: flex-start;
	}
}

/* ------------------------------------------------------------------ */
/*  Multi-list modal                                                  */
/* ------------------------------------------------------------------ */

body.sw-modal-open {
	overflow: hidden;
}

.sw-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.sw-modal {
	background: #fff;
	border-radius: 8px;
	max-width: 420px;
	width: 100%;
	max-height: 90vh;
	overflow: auto;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.sw-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1rem 1.25rem;
	border-bottom: 1px solid #e5e5e5;
}

.sw-modal-header h3 {
	margin: 0;
	font-size: 1.15rem;
}

.sw-modal-close {
	background: none;
	border: none;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	padding: 0.25rem;
	color: #666;
}

.sw-modal-close:hover {
	color: #000;
}

.sw-modal-body {
	padding: 1.25rem;
}

.sw-modal-lists {
	list-style: none;
	margin: 0;
	padding: 0;
}

.sw-modal-lists li {
	margin: 0 0 0.75rem;
}

.sw-modal-lists label {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	cursor: pointer;
	font-weight: normal;
}

.sw-modal-lists input[type="checkbox"] {
	width: 1.15em;
	height: 1.15em;
	margin: 0;
	flex-shrink: 0;
}

.sw-modal-lists .default-badge {
	font-size: 0.75em;
	background: #eee;
	padding: 0.1em 0.4em;
	border-radius: 3px;
	margin-left: 0.35em;
	vertical-align: middle;
}

.sw-modal-footer {
	display: flex;
	justify-content: flex-end;
	gap: 0.5rem;
	padding: 1rem 1.25rem;
	border-top: 1px solid #e5e5e5;
	background: #fafafa;
	border-radius: 0 0 8px 8px;
}

/* Loading / removing state for wishlist table rows */
.sw-wishlist-table tr.is-loading {
	opacity: 0.55;
	pointer-events: none;
	position: relative;
}

.sw-wishlist-table tr.is-loading::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.4);
}

.sw-wishlist-table tr.is-removing {
	transition: opacity 0.3s ease;
}

/* ------------------------------------------------------------------ */
/*  Slide-out panel (header wishlist)                                 */
/* ------------------------------------------------------------------ */

.sw-slideout-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.4);
	z-index: 99998;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0.25s ease;
}

.sw-slideout-overlay.is-open {
	opacity: 1;
	visibility: visible;
}

.sw-slideout {
	position: fixed;
	top: 0;
	right: 0;
	width: 100%;
	max-width: 380px;
	height: 100%;
	background: #fff;
	z-index: 99999;
	box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
	display: flex;
	flex-direction: column;
	transform: translateX(100%);
	transition: transform 0.3s ease;
}

.sw-slideout.is-open {
	transform: translateX(0);
}

.sw-slideout-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1rem 1.25rem;
	border-bottom: 1px solid #e5e5e5;
	flex-shrink: 0;
}

.sw-slideout-header h3 {
	margin: 0;
	font-size: 1.15rem;
}

.sw-slideout-close {
	background: none;
	border: none;
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
	padding: 0.25rem;
	color: #666;
}

.sw-slideout-close:hover {
	color: #000;
}

.sw-slideout-body {
	flex: 1;
	overflow-y: auto;
	padding: 1rem 1.25rem;
}

.sw-slideout-empty {
	text-align: center;
	padding: 2rem 1rem;
	color: #666;
}

.sw-slideout-item {
	display: flex;
	gap: 0.75rem;
	padding: 0.75rem 0;
	border-bottom: 1px solid #eee;
	align-items: flex-start;
}

.sw-slideout-item:last-child {
	border-bottom: none;
}

.sw-slideout-item img {
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: 4px;
	flex-shrink: 0;
}

.sw-slideout-item-info {
	flex: 1;
	min-width: 0;
}

.sw-slideout-item-info a {
	font-weight: 600;
	text-decoration: none;
	color: inherit;
	display: block;
	margin-bottom: 0.25rem;
}

.sw-slideout-item-info .price {
	font-size: 0.9em;
	color: #333;
}

.sw-slideout-item-remove {
	background: none;
	border: none;
	color: #a00;
	cursor: pointer;
	font-size: 1.2rem;
	padding: 0.2rem;
	line-height: 1;
	flex-shrink: 0;
}

.sw-slideout-item-remove:hover {
	color: #000;
}

.sw-slideout-item.is-loading {
	opacity: 0.45;
	pointer-events: none;
	position: relative;
	transition: opacity 0.2s ease;
}

.sw-slideout-item.is-loading::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.5);
	border-radius: 4px;
}

.sw-slideout-footer {
	padding: 1rem 1.25rem;
	border-top: 1px solid #e5e5e5;
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.sw-slideout-footer .button {
	width: 100%;
	text-align: center;
}

/* Header toggle button */
.sw-wishlist-toggle {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	cursor: pointer;
	text-decoration: none;
	color: inherit;
	background: none;
	border: none;
	font: inherit;
	padding: 0.25rem 0.5rem;
}

.sw-wishlist-toggle .sw-wishlist-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.25em;
	height: 1.25em;
	padding: 0 0.3em;
	font-size: 0.75em;
	font-weight: 600;
	background: #333;
	color: #fff;
	border-radius: 999px;
	line-height: 1;
}

body.sw-slideout-open {
	overflow: hidden;
}
