/**
 * Woo Awesome Products Wishlist — front-end styles.
 *
 * Written to the BEM (Block__Element--Modifier) convention.
 * No CSS framework or library is used.
 */

/* ==========================================================================
   Block: wapw-wishlist-button (the heart toggle on shop/single product pages)
   ========================================================================== */

.wapw-wishlist-button {
	--wapw-accent: var(--tc-primary, #004d4c);

	display: inline-grid;
	place-items: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: var(--tc-r-md, 12px);
	background-color: rgba(255, 255, 255, 0.92);
	color: var(--wapw-accent);
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.15s ease;
}

.wapw-wishlist-button:hover {
	background-color: #ffffff;
	transform: scale(1.06);
}

.wapw-wishlist-button:active {
	transform: scale(0.94);
}

.wapw-wishlist-button:focus-visible {
	outline: 2px solid var(--wapw-accent);
	outline-offset: 2px;
}

.wapw-wishlist-button__icon {
	display: inline-flex;
	width: 18px;
	height: 18px;
}

.wapw-wishlist-button__svg {
	width: 100%;
	height: 100%;
	fill: none;
	stroke: currentColor;
	transition: fill 0.15s ease, transform 0.15s ease;
}

/* Icon-only button: the label stays for screen readers (aria-label also set). */
.wapw-wishlist-button__label {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Modifier: the product is currently in the wishlist (heart is "filled"). */
.wapw-wishlist-button--active .wapw-wishlist-button__svg {
	fill: currentColor;
}

/* Modifier: request in flight — dim the button and block re-clicks visually.
   `wapw-is-loading` is the same, for theme-owned buttons (Taasha Craft hearts). */
.wapw-wishlist-button--loading,
.wapw-is-loading {
	opacity: 0.6;
	pointer-events: none;
}

/* A little "pop" whenever the state changes. */
.wapw-wishlist-button--pulse .wapw-wishlist-button__svg {
	transform: scale(1.2);
}

/* ==========================================================================
   Block: wapw-wishlist-badge (the "N items" indicator usable anywhere)
   ========================================================================== */

.wapw-wishlist-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
	color: inherit;
	text-decoration: none;
}

.wapw-wishlist-badge__icon {
	display: inline-flex;
	width: 1.2em;
	height: 1.2em;
}

.wapw-wishlist-badge__svg {
	width: 100%;
	height: 100%;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.6;
}

.wapw-wishlist-badge__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.4em;
	height: 1.4em;
	padding: 0 0.3em;
	border-radius: 999px;
	background-color: var(--tc-primary, #004d4c);
	color: #ffffff;
	font-size: 0.75em;
	font-weight: 600;
	line-height: 1;
}

/* Modifier: hide the numeric badge when the wishlist is empty. */
.wapw-wishlist-badge--empty .wapw-wishlist-badge__count {
	background-color: #b5b5b5;
}

/* ==========================================================================
   Block: wapw-wishlist (the full wishlist listing page/shortcode)
   ========================================================================== */

.wapw-wishlist {
	margin: 1.5em 0;
}

.wapw-wishlist__empty {
	padding: 1em;
	border: 1px dashed #d6d6d6;
	border-radius: 4px;
	color: #6b6b6b;
	text-align: center;
}

.wapw-wishlist__table {
	width: 100%;
	border-collapse: collapse;
}

.wapw-wishlist__row--head {
	border-bottom: 2px solid #e2e2e2;
}

.wapw-wishlist__row {
	border-bottom: 1px solid #e9e9e9;
}

.wapw-wishlist__cell {
	padding: 0.75em 0.5em;
	text-align: left;
	vertical-align: middle;
}

.wapw-wishlist__cell--thumbnail {
	width: 4.5em;
}

.wapw-wishlist__cell--thumbnail img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 4px;
}

.wapw-wishlist__cell--actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5em;
}

.wapw-wishlist__link {
	color: inherit;
	text-decoration: none;
}

.wapw-wishlist__link:hover {
	text-decoration: underline;
}

.wapw-wishlist__add-to-cart {
	white-space: nowrap;
}

/* Remove the shared row entirely once its "remove" toggle succeeds. */
.wapw-wishlist__row--removed {
	display: none;
}

/* Small screens: stack the table into cards. */
@media screen and (max-width: 600px) {
	.wapw-wishlist__table,
	.wapw-wishlist__table thead,
	.wapw-wishlist__table tbody,
	.wapw-wishlist__table tr,
	.wapw-wishlist__table td {
		display: block;
		width: 100%;
	}

	.wapw-wishlist__row--head {
		position: absolute;
		width: 1px;
		height: 1px;
		padding: 0;
		margin: -1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
		border: 0;
	}

	.wapw-wishlist__row {
		padding: 0.75em 0;
	}

	.wapw-wishlist__cell {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 0.35em 0.5em;
	}

	.wapw-wishlist__cell[data-title]::before {
		content: attr(data-title);
		font-weight: 600;
		margin-right: 1em;
	}
}
