/*
 * Presentation layer over the Save To Wishlist plugin.
 *
 * Selectors below belong to that plugin and may change when it updates. They are kept
 * in this one file so an update has a single place to re-check.
 */

/* Confirmation: corner notice instead of a blocking dialog ---------------- */

.stw-modal {
	position: fixed;
	inset: auto 1rem 1rem auto;
	z-index: 99999;
	width: auto;
	max-width: min(22rem, calc(100vw - 2rem));
	height: auto;
	background: none;
	/* Display is left to the plugin: forcing it showed the notice on every page load. */
	animation: groundwell-wishlist-in 0.18s ease-out both;
}

/* The plugin darkens the page with a backdrop on the modal container. */
.stw-modal::before,
.stw-modal::after,
.stw-mobile-lists-backdrop {
	display: none !important;
}

.stw-modal-content {
	width: auto;
	max-width: none;
	margin: 0;
	padding: 0.85rem 1rem;
	background: var(--awb-color1, #ffffff);
	color: var(--awb-color7, #212326);
	border: 1px solid var(--awb-color3, #f2f3f5);
	border-left: 3px solid var(--awb-color5, #d97a66);
	border-radius: 6px;
	box-shadow: 0 6px 24px rgba(33, 35, 38, 0.14);
	font-size: 0.9rem;
	line-height: 1.45;
	text-align: left;
}

.stw-modal-header {
	padding: 0;
	border: 0;
	font-weight: 600;
}

.stw-modal-body {
	padding: 0.25rem 0 0;
	border: 0;
}

.stw-modal-footer {
	padding: 0.5rem 0 0;
	border: 0;
	display: flex;
	gap: 0.5rem;
	justify-content: flex-start;
}

.stw-modal-button {
	background: none;
	border: 0;
	padding: 0;
	color: var(--awb-color5, #d97a66);
	font-weight: 600;
	text-decoration: underline;
	cursor: pointer;
}

.stw-modal-button:hover,
.stw-modal-button:focus-visible {
	color: var(--awb-color7, #212326);
}

@keyframes groundwell-wishlist-in {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.stw-modal { animation: none; }
}

/* Wishlist controls in the site palette ----------------------------------- */

.save-to-wishlist-cart-button,
.saveto-wishlist-popup-content-form-button {
	background: var(--awb-color5, #d97a66);
	border: 1px solid var(--awb-color5, #d97a66);
	color: var(--awb-color1, #ffffff);
	border-radius: 4px;
}

.save-to-wishlist-cart-button:hover,
.saveto-wishlist-popup-content-form-button:hover {
	background: var(--awb-color7, #212326);
	border-color: var(--awb-color7, #212326);
}

.saveto-wishlist-popup-content-form-button-cancel {
	background: none;
	border: 1px solid var(--awb-color3, #f2f3f5);
	color: var(--awb-color6, #434549);
	border-radius: 4px;
}

/* Remove should read as quiet, not as danger. */
.stw-removing,
.saveto-wishlist-item .stw-close {
	color: var(--awb-color6, #434549);
	background: none;
	border: 0;
}

.stw-removing:hover,
.saveto-wishlist-item .stw-close:hover {
	color: var(--awb-color5, #d97a66);
}

/* Saved state on the heart, so the control confirms itself. */
.stw-icon-heart.stw-active,
.save-to-wishlist-button.stw-active .stw-icon {
	color: var(--awb-color5, #d97a66);
	fill: var(--awb-color5, #d97a66);
}

/* Shop loop: heart in the image corner, not a bar across it ---------------- */

.products .product {
	position: relative;
}

.products .product .save-to-wishlist-button {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	z-index: 2;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--awb-color1, #ffffff);
	border: 1px solid var(--awb-color3, #f2f3f5);
	border-radius: 50%;
	box-shadow: 0 2px 8px rgba(33, 35, 38, 0.12);
	overflow: hidden;
	line-height: 1;
}

/*
 * The label text comes from the plugin's JavaScript configuration and cannot be changed
 * from CSS. Hiding it visually leaves the icon as the control and removes the confusing
 * "Remove from Wishlist" wording, while keeping the text available to screen readers.
 */
.products .product .save-to-wishlist-button > span:not([class*="icon"]),
.products .product .save-to-wishlist-button .save-to-wishlist-button-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.products .product .save-to-wishlist-button .stw-icon,
.products .product .save-to-wishlist-button svg {
	width: 20px;
	height: 20px;
	color: var(--awb-color5, #d97a66);
}
