/**
 * SW WooCommerce Wishlist - front-end styles.
 * Written to be theme-neutral by default, with small overrides for
 * Woostify/Astra/Storefront under the body classes added by
 * SW_Wishlist_Compatibility::add_theme_body_class().
 */

/* ---------------------------------------------------------------------
   Button (loop + single product)
--------------------------------------------------------------------- */
.sw-wishlist-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 6px 4px;
	margin: 6px 0;
	color: #666;
	font-size: 13px;
	line-height: 1;
	transition: color 0.2s ease;
}

.sw-wishlist-btn:hover {
	color: #e2264d;
}

.sw-wishlist-btn.is-active {
	color: #e2264d;
}

.sw-wishlist-icon {
	display: block;
	flex: 0 0 auto;
}

.sw-wishlist-icon--filled {
	display: none;
}

.sw-wishlist-btn.is-active .sw-wishlist-icon--outline {
	display: none;
}

.sw-wishlist-btn.is-active .sw-wishlist-icon--filled {
	display: block;
}

.sw-wishlist-btn__label {
	white-space: nowrap;
}

.sw-wishlist-btn.sw-is-loading {
	opacity: 0.6;
	pointer-events: none;
}

/* Floating icon-on-image position */
.sw-wishlist-overlay {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 5;
}

.sw-wishlist-overlay .sw-wishlist-btn {
	background: #fff;
	border-radius: 50%;
	width: 36px;
	height: 36px;
	padding: 0;
	justify-content: center;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.sw-wishlist-overlay .sw-wishlist-btn__label {
	display: none;
}

/* WooCommerce's default loop <li> needs relative positioning for the
   overlay to anchor correctly; harmless if the theme already sets it. */
ul.products li.product,
.woocommerce ul.products li.product {
	position: relative;
}

/* ---------------------------------------------------------------------
   Wishlist count badge (menus / header)
--------------------------------------------------------------------- */
.sw-wishlist-count-widget {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: inherit;
	text-decoration: none;
	padding: 4px;
}

.sw-wishlist-count-badge {
	position: absolute;
	top: -6px;
	right: -8px;
	background: #e2264d;
	color: #fff;
	font-size: 10px;
	line-height: 1;
	min-width: 16px;
	height: 16px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 4px;
	font-weight: 600;
}

/* ---------------------------------------------------------------------
   Wishlist page table
--------------------------------------------------------------------- */
.sw-wishlist-wrapper {
	margin: 20px 0;
}

.sw-wishlist-empty {
	text-align: center;
	padding: 40px 20px;
}

.sw-wishlist-empty p {
	margin-bottom: 16px;
	font-size: 16px;
}

.sw-wishlist-table-wrap {
	overflow-x: auto;
}

.sw-wishlist-table {
	width: 100%;
	border-collapse: collapse;
}

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

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

.sw-col-image img {
	width: 64px;
	height: auto;
	border-radius: 4px;
	display: block;
}

.sw-in-stock {
	color: #2a9d5c;
	font-weight: 600;
}

.sw-out-of-stock {
	color: #c0392b;
	font-weight: 600;
}

.sw-col-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	white-space: nowrap;
}

.sw-move-to-cart,
.sw-select-options {
	white-space: nowrap;
}

.sw-remove-item {
	background: transparent;
	border: none;
	cursor: pointer;
	font-size: 20px;
	line-height: 1;
	color: #999;
	padding: 0 6px;
}

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

.sw-wishlist-table tr.sw-row-removing {
	opacity: 0.4;
	transition: opacity 0.2s ease;
}

/* Small screens: fall back to a stacked card layout */
@media (max-width: 600px) {
	.sw-wishlist-table thead {
		display: none;
	}
	.sw-wishlist-table,
	.sw-wishlist-table tbody,
	.sw-wishlist-table tr,
	.sw-wishlist-table td {
		display: block;
		width: 100%;
	}
	.sw-wishlist-table tr {
		border: 1px solid #eee;
		border-radius: 6px;
		margin-bottom: 14px;
		padding: 10px;
	}
	.sw-wishlist-table td {
		border-bottom: none;
		padding: 6px 0;
	}
	.sw-wishlist-table td[data-label]::before {
		content: attr(data-label);
		display: block;
		font-size: 11px;
		text-transform: uppercase;
		letter-spacing: 0.03em;
		color: #999;
		margin-bottom: 2px;
	}
}

/* ---------------------------------------------------------------------
   Toast notification (small "Added to wishlist" popup)
--------------------------------------------------------------------- */
.sw-wishlist-toast {
	position: fixed;
	bottom: 24px;
	right: 24px;
	background: #222;
	color: #fff;
	padding: 10px 18px;
	border-radius: 4px;
	font-size: 13px;
	z-index: 9999;
	opacity: 0;
	transform: translateY(10px);
	transition: opacity 0.25s ease, transform 0.25s ease;
	pointer-events: none;
}

.sw-wishlist-toast.is-visible {
	opacity: 1;
	transform: translateY(0);
}

/* ---------------------------------------------------------------------
   Theme-specific tweaks
--------------------------------------------------------------------- */

/* Woostify wraps loop items with extra padding; nudge the overlay in a touch */
body.sw-theme-woostify .sw-wishlist-overlay {
	top: 14px;
	right: 14px;
}

body.sw-theme-woostify .sw-wishlist-btn {
	font-size: 12px;
}

/* Astra's add-to-cart button already has margin; tighten the gap */
body.sw-theme-astra .sw-wishlist-btn {
	margin-top: 2px;
}
