/**
 * Cardis Wishlist styles.
 *
 * The base `.cardis-wishlist` button is styled by the theme (css/cardis-product.css).
 * Here we add the active state, the grid-card variant, the wishlist page layout, and a toast.
 */

/* ---------------------------------------------------------------- active state */
.cardis-wishlist.is-active {
	color: #1F73B7;
	border-color: #1F73B7;
}

.cardis-wishlist.is-active svg {
	fill: #1F73B7;
	stroke: #1F73B7;
}

.cardis-wishlist:focus-visible {
	outline: 2px solid #1F73B7;
	outline-offset: 2px;
}

/* ------------------------------------------------------------- grid-card variant */
.woocommerce ul.products li.product,
ul.products li.product {
	position: relative;
}

/* Compound selector (0,2,0) so it beats the theme's `.cardis-wishlist { top:0 }` in
   style.css, which loads after this file. The circle styling (border-radius, border,
   flex-centering) is repeated here because the theme's base `.cardis-wishlist` circle lives
   in cardis-product.css, which is only enqueued on single-product pages — so the grid /
   wishlist-page heart would otherwise render as a plain box. */
.cardis-wishlist.cardis-wishlist--loop {
	position: absolute;
	top: 8px;
	right: 8px;
	bottom: auto;
	left: auto;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0;
	background: #fff;
	border: 1px solid var(--cardis-gray-200, #ebebeb);
	border-radius: 50%;
	color: var(--cardis-gray-500, #777);
	cursor: pointer;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
	transition: color 0.2s, border-color 0.2s;
}

.cardis-wishlist.cardis-wishlist--loop:hover {
	color: #c0392b;
	border-color: #c0392b;
}

/* Keep the active (in-wishlist) blue winning over the loop base rule above. */
.cardis-wishlist.cardis-wishlist--loop.is-active {
	color: #1F73B7;
	border-color: #1F73B7;
}

.cardis-wishlist--loop svg {
	width: 18px;
	height: 18px;
}

/* ----------------------------------------------------------------- wishlist page */
.cardis-wishlist-page__loading,
.cardis-wishlist-page__empty {
	margin: 24px 0;
	font-size: 16px;
	color: #555;
}

.cardis-wishlist-page__empty a {
	color: #1F73B7;
	text-decoration: underline;
}

.cardis-wishlist-page .cardis-wishlist--loop {
	/* On the wishlist page the heart is the remove control — make it obvious. */
	color: #1F73B7;
	border-color: #1F73B7;
}

/* ------------------------------------------------------------------------- toast */
.cardis-wishlist-toast {
	position: fixed;
	left: 50%;
	bottom: 24px;
	z-index: 100000;
	max-width: 90vw;
	transform: translate(-50%, 12px);
	padding: 12px 18px;
	border-radius: 6px;
	background: #1f2937;
	color: #fff;
	font-size: 14px;
	line-height: 1.4;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.cardis-wishlist-toast.is-visible {
	opacity: 1;
	transform: translate(-50%, 0);
}

@media (prefers-reduced-motion: reduce) {
	.cardis-wishlist-toast {
		transition: opacity 0.2s ease;
		transform: translate(-50%, 0);
	}
}
