/**
 * Simple Wishlists - buttons, counter, floating heart and toasts.
 *
 * Loaded on shop and product pages (and anywhere a button or counter shows),
 * so it is kept small. The wishlist page has its own stylesheet.
 */

:root {
	--swlp-primary: #e0435f;
	--swlp-secondary: #a8243f;
	--swlp-ink: #2c3e50;
	--swlp-muted: #6b7280;
	--swlp-line: #e9ecef;
	--swlp-card-radius: 12px;
	--swlp-button-radius: 8px;
	--swlp-shadow: 0 1px 2px rgba( 15, 23, 42, 0.06), 0 6px 18px rgba( 15, 23, 42, 0.08);
}

.swlp-screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Button */

.swlp-button-wrap {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 12px;
	margin: 10px 0;
}

.swlp-button-wrap--single {
	margin: 14px 0;
}

/* Inside the add to cart form the button always gets a row of its own, flush
 * with the form's left edge. Squeezing it in beside the cart button only works
 * when there is room: themes that lay the form out with flex or grid (and every
 * theme on a phone) wrap it onto the next line, indented. Covers flex (full
 * basis), grid (all columns) and floated quantity/button layouts (clear).
 * Spacing is padding: a cleared box's top margin is swallowed by clearance. */
form.cart .swlp-button-wrap--single {
	display: flex;
	flex: 0 0 100%;
	grid-column: 1 / -1;
	clear: both;
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 12px 0 0;
}

form.cart .swlp-button-wrap--single.swlp-button-wrap--before-cart {
	padding: 0 0 12px;
}

.swlp-button {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: var(--swlp-button-radius);
	background: none;
	box-shadow: none;
	color: var(--swlp-ink);
	font: inherit;
	font-size: 0.95em;
	font-weight: 500;
	line-height: 1.3;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	cursor: pointer;
	transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.swlp-button:hover,
.swlp-button:focus {
	background: none;
	color: var(--swlp-primary);
}

.swlp-button:focus-visible {
	outline: 2px solid var(--swlp-primary);
	outline-offset: 3px;
}

.swlp-button__icon {
	display: inline-flex;
	flex: 0 0 auto;
	color: var(--swlp-primary);
}

.swlp-button__icon .swlp-icon {
	width: 1.35em;
	height: 1.35em;
	overflow: visible;
}

.swlp-button__icon .swlp-icon path,
.swlp-button__icon .swlp-icon polygon {
	fill: transparent;
	transition: fill 0.15s ease;
}

.swlp-button.is-active .swlp-button__icon .swlp-icon path,
.swlp-button.is-active .swlp-button__icon .swlp-icon polygon {
	fill: currentColor;
}

.swlp-button__label--added,
.swlp-button.is-active .swlp-button__label--add {
	display: none;
}

.swlp-button.is-active .swlp-button__label--added {
	display: inline;
}

.swlp-button.is-loading {
	cursor: progress;
	opacity: 0.75;
}

.swlp-button.is-popping .swlp-button__icon {
	animation: swlp-pop 0.4s ease;
}

@keyframes swlp-pop {

	0% {
		transform: scale(1);
	}

	40% {
		transform: scale(1.35);
	}

	100% {
		transform: scale(1);
	}
}

/* Styles */

.swlp-style-text .swlp-button__icon {
	display: none;
}

.swlp-style-text {
	color: var(--swlp-primary);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.swlp-style-button {
	padding: 0.7em 1.15em;
	border: 1.5px solid var(--swlp-line);
	background: #fff;
}

.swlp-style-button:hover,
.swlp-style-button:focus {
	border-color: var(--swlp-primary);
	background: #fff;
}

.swlp-style-button.is-active {
	border-color: var(--swlp-primary);
	background: color-mix(in srgb, var(--swlp-primary) 8%, #fff);
	color: var(--swlp-secondary);
}

.swlp-style-icon {
	justify-content: center;
	width: 2.5em;
	height: 2.5em;
	border: 1.5px solid var(--swlp-line);
	border-radius: 999px;
	background: #fff;
}

.swlp-style-icon:hover,
.swlp-style-icon:focus {
	border-color: var(--swlp-primary);
	background: #fff;
}

.swlp-style-icon .swlp-button__icon .swlp-icon {
	width: 1.25em;
	height: 1.25em;
}

.swlp-shape-square.swlp-style-button {
	border-radius: 0;
}

.swlp-shape-pill.swlp-style-button {
	border-radius: 999px;
}

.swlp-button__count {
	color: var(--swlp-muted);
	font-size: 0.85em;
}

/* Overlays */

.swlp-has-overlay,
.swlp-block-image-wrap {
	position: relative;
}

.swlp-button-wrap--overlay {
	position: absolute;
	z-index: 5;
	top: 10px;
	right: 10px;
	margin: 0;
}

.swlp-button-wrap--overlay .swlp-button {
	width: 2.4em;
	height: 2.4em;
	border: 0;
	background: rgba(255, 255, 255, 0.94);
	box-shadow: var(--swlp-shadow);
}

.swlp-button-wrap--overlay .swlp-button:hover,
.swlp-button-wrap--overlay .swlp-button:focus {
	background: #fff;
	transform: scale(1.06);
}

.swlp-overlay-single:not(.is-placed) {
	position: static;
}

.swlp-overlay-single.is-placed {
	top: 14px;
	right: 14px;
}

.swlp-overlay-single.is-placed .swlp-button {
	width: 2.8em;
	height: 2.8em;
}

/* Counter */

.swlp-counter {
	display: inline-flex;
	position: relative;
	align-items: center;
	gap: 6px;
	color: inherit;
	text-decoration: none;
}

.swlp-counter:hover,
.swlp-counter:focus {
	color: var(--swlp-primary);
}

.swlp-counter__icon {
	display: inline-flex;
}

.swlp-counter__icon .swlp-icon {
	width: 1.4em;
	height: 1.4em;
}

.swlp-counter__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.45em;
	height: 1.45em;
	padding: 0 0.4em;
	border-radius: 999px;
	background: var(--swlp-primary);
	color: #fff;
	font-size: 0.72em;
	font-weight: 700;
	line-height: 1;
}

.swlp-counter--badge .swlp-counter__count {
	position: absolute;
	top: -0.55em;
	right: -0.75em;
}

.swlp-counter.is-empty.swlp-counter--hide-zero .swlp-counter__count {
	display: none;
}

.swlp-menu-counter > .swlp-counter {
	padding-right: 0.8em;
}

/* Floating heart */

.swlp-floating {
	display: inline-flex;
	position: fixed;
	z-index: 9990;
	bottom: 24px;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border-radius: 999px;
	background: linear-gradient(135deg, var(--swlp-primary) 0%, var(--swlp-secondary) 100%);
	box-shadow: 0 10px 28px rgba( 15, 23, 42, 0.22);
	color: #fff;
	text-decoration: none;
	transition: transform 0.2s ease;
}

.swlp-floating:hover,
.swlp-floating:focus {
	color: #fff;
	transform: translateY(-2px);
}

.swlp-floating--bottom_right {
	right: 24px;
}

.swlp-floating--bottom_left {
	left: 24px;
}

.swlp-floating .swlp-icon {
	width: 26px;
	height: 26px;
}

.swlp-floating .swlp-icon path {
	fill: currentColor;
}

.swlp-floating .swlp-counter__count {
	position: absolute;
	top: -2px;
	right: -2px;
	border: 2px solid #fff;
	background: var(--swlp-ink);
}

.swlp-floating.is-empty.swlp-floating--hide-empty {
	display: none;
}

/* Toasts */

.swlp-toasts {
	display: flex;
	position: fixed;
	z-index: 99999;
	right: 20px;
	bottom: 20px;
	flex-direction: column;
	gap: 10px;
	width: min(380px, calc(100vw - 40px));
	pointer-events: none;
}

.swlp-toast {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 12px 12px 14px;
	border: 1px solid var(--swlp-line);
	border-left: 4px solid var(--swlp-primary);
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 12px 32px rgba( 15, 23, 42, 0.16);
	color: var(--swlp-ink);
	font-size: 14px;
	line-height: 1.4;
	pointer-events: auto;
	animation: swlp-toast-in 0.25s ease;
}

.swlp-toast.is-error {
	border-left-color: #d92d20;
}

.swlp-toast.is-leaving {
	opacity: 0;
	transform: translateY(8px);
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.swlp-toast__image {
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	border-radius: 8px;
	object-fit: cover;
}

.swlp-toast__body {
	display: flex;
	flex: 1 1 auto;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 12px;
	min-width: 0;
}

.swlp-toast__message {
	flex: 1 1 100%;
	margin: 0;
	font-weight: 600;
}

.swlp-toast__link,
.swlp-toast__undo {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--swlp-primary);
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}

.swlp-toast__link:hover,
.swlp-toast__undo:hover {
	background: none;
	color: var(--swlp-secondary);
}

.swlp-toast__close {
	align-self: flex-start;
	margin: 0;
	padding: 0 4px;
	border: 0;
	background: none;
	color: var(--swlp-muted);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}

.swlp-toast__close:hover {
	background: none;
	color: var(--swlp-ink);
}

@keyframes swlp-toast-in {

	from {
		opacity: 0;
		transform: translateY(10px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (max-width: 600px) {

	.swlp-toasts {
		right: 12px;
		bottom: 12px;
		left: 12px;
		width: auto;
	}

	form.cart .swlp-button-wrap--single {
		display: flex;
		margin: 12px 0 0;
	}
}

@media (prefers-reduced-motion: reduce) {

	.swlp-button,
	.swlp-floating,
	.swlp-toast,
	.swlp-toast.is-leaving,
	.swlp-button.is-popping .swlp-button__icon {
		animation: none;
		transition: none;
	}

	.swlp-toast.is-leaving {
		transform: none;
	}
}
