/*
 * Favourites (inc/wishlist.php, js/wishlist.js): heart buttons on cards and the product page,
 * My Account → Обране and the toast. The header's language: Montserrat, the
 * slate ink, the brand orange for the saved heart, hairlines; the glyphs are Phosphor (inc/header.php).
 */

:root {
	--ses-wl-ink: #212b36;
	--ses-wl-text: #4a5561;
	--ses-wl-muted: #7a838c;
	--ses-wl-accent: #f48511;
	--ses-wl-accent-dark: #c96a07;
	--ses-wl-line: #e3e6e9;
	--ses-wl-soft: #f4f6f7;
	--ses-wl-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Heart button: the outline, and the filled heart over it once the product is saved. */

.ses-wishlist-btn {
	position: relative;
	display: inline-grid;
	place-items: center;
	box-sizing: border-box;
	margin: 0;
	padding: 0;
	border: 1px solid var(--ses-wl-line);
	border-radius: 0;
	background: #fff;
	color: var(--ses-wl-ink);
	line-height: 1;
	vertical-align: middle;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: border-color 0.2s, color 0.2s, transform 0.15s;
}

.ses-wishlist-btn > svg {
	grid-area: 1 / 1;
	display: block;
	width: 20px;
	height: 20px;
}

.ses-wishlist-btn__fill {
	color: var(--ses-wl-accent);
	opacity: 0;
	transform: scale(0.6);
	transition: opacity 0.2s, transform 0.3s var(--ses-wl-ease);
}

.ses-wishlist-btn.woosw-added .ses-wishlist-btn__fill {
	opacity: 1;
	transform: none;
}

.ses-wishlist-btn.woosw-added .ses-icon {
	color: var(--ses-wl-accent);
}

/* css/base.css paints every focused or hovered button pink. */
.ses-wishlist-btn:hover,
.ses-wishlist-btn:focus {
	background: #fff;
	color: var(--ses-wl-ink);
	outline: 0;
}

.ses-wishlist-btn:active {
	transform: scale(0.94);
}

.ses-wishlist-btn:focus-visible {
	outline: 2px solid var(--ses-wl-accent);
	outline-offset: 2px;
}

/* Set by js/wishlist.js right after adding, so hearts saved earlier do not pop on every page load. */
.ses-wishlist-btn.is-popped > svg {
	animation: ses-wishlist-pop 0.35s ease;
}

.ses-wishlist-btn.woosw-adding {
	pointer-events: none;
}

.ses-wishlist-btn.woosw-adding > svg {
	animation: ses-wishlist-pulse 0.8s ease-in-out infinite;
}

@keyframes ses-wishlist-pop {
	50% { transform: scale(1.2); }
}

@keyframes ses-wishlist-pulse {
	50% { opacity: 0.35; }
}

@media (hover: hover) {
	.ses-wishlist-btn:hover {
		border-color: var(--ses-wl-ink);
	}
}

/* On a card the heart sits in .ses-card-actions beside "Додати в кошик": css/product-card.css. */

/*
 * On the product page: a square the height of "Додати в кошик", right of it. Elementor's add to cart
 * widget paints every button in the form dark and spaces them by --button-spacing, hence the weight.
 */
.cart button.ses-wishlist-btn.ses-wishlist-btn--single.woosw-btn.woosw-btn-has-icon {
	width: 46px;
	height: 46px;
	margin-inline-start: 10px;
	border: 1px solid var(--ses-wl-line);
	background: #fff;
	color: var(--ses-wl-ink);
}

@media (hover: hover) {
	.cart button.ses-wishlist-btn.ses-wishlist-btn--single.woosw-btn.woosw-btn-has-icon:hover {
		border-color: var(--ses-wl-ink);
	}
}

.ses-wishlist-btn--single > svg {
	width: 22px;
	height: 22px;
}

/* My Account → Обране */

.ses-wishlist__head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px 24px;
	margin-bottom: 24px;
}

.ses-wishlist .ses-wishlist__title {
	margin: 0 0 6px;
	color: var(--ses-wl-ink);
	font-family: Montserrat, sans-serif;
	font-size: 24px;
	font-weight: 500;
	line-height: 1.3;
}

.ses-wishlist__count {
	color: var(--ses-wl-muted);
	font-size: 14px;
	line-height: 1.4;
}

.ses-wishlist__sort {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.ses-wishlist .ses-wishlist__chip {
	display: inline-flex;
	align-items: center;
	min-height: 36px;
	padding: 0 16px;
	border: 1px solid var(--ses-wl-line);
	border-radius: 999px;
	color: var(--ses-wl-text);
	font-family: Montserrat, sans-serif;
	font-size: 13px;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}

.ses-wishlist .ses-wishlist__chip:hover {
	border-color: var(--ses-wl-ink);
	color: var(--ses-wl-ink);
}

.ses-wishlist .ses-wishlist__chip[aria-current] {
	border-color: var(--ses-wl-ink);
	background: var(--ses-wl-ink);
	color: #fff;
}

/* The account column is narrower than the shop: as many cards as fit, 200px or wider. */
.woocommerce .ses-wishlist ul.products {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 32px 24px;
	margin: 0;
}

.woocommerce .ses-wishlist ul.products::before,
.woocommerce .ses-wishlist ul.products::after {
	display: none;
}

.woocommerce .ses-wishlist ul.products li.product {
	float: none;
	width: auto;
	margin: 0;
	transition: opacity 0.3s;
}

/* The shop's card colours (there they come from Elementor's archive template; css/base.css paints links pink). */
.woocommerce .ses-wishlist ul.products li.product a,
.woocommerce .ses-wishlist ul.products li.product .price {
	color: var(--ses-wl-ink);
}

.woocommerce .ses-wishlist ul.products li.product .add_to_cart_button {
	color: #fff;
}

@media (max-width: 599px) {
	.woocommerce .ses-wishlist ul.products {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 32px 16px;
	}
}

/* Removed here: faded until the page reloads, so "Повернути" in the toast can bring it back. */
.woocommerce .ses-wishlist ul.products li.product.is-removed {
	opacity: 0.45;
}

.ses-wishlist [hidden] {
	display: none !important;
}

.ses-wishlist__empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 56px 24px;
	border: 1px solid var(--ses-wl-line);
	background: var(--ses-wl-soft);
	text-align: center;
}

.ses-wishlist__empty .ses-icon {
	margin-bottom: 8px;
	color: var(--ses-wl-accent);
}

.ses-wishlist__empty-title {
	color: var(--ses-wl-ink);
	font-family: Montserrat, sans-serif;
	font-size: 18px;
	font-weight: 500;
	line-height: 1.3;
}

.ses-wishlist__empty-text {
	max-width: 360px;
	color: var(--ses-wl-muted);
	font-size: 14px;
	line-height: 1.5;
}

.ses-wishlist .ses-wishlist__empty-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 44px;
	margin-top: 16px;
	padding: 0 28px;
	background: var(--ses-wl-ink);
	color: #fff;
	font-family: Montserrat, sans-serif;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-decoration: none;
	text-transform: uppercase;
	transition: background-color 0.2s;
}

.ses-wishlist .ses-wishlist__empty-link:hover,
.ses-wishlist .ses-wishlist__empty-link:focus-visible {
	background: var(--ses-wl-accent);
	color: #fff;
}

/* Toast: bottom right, left of the floating contact button (css/contact.css) on wide screens. */

.ses-toast {
	position: fixed;
	right: 96px;
	bottom: 24px;
	z-index: 9999998; /* over the drawers (100000) */
	display: flex;
	align-items: center;
	gap: 14px;
	box-sizing: border-box;
	width: min(420px, calc(100vw - 32px));
	padding: 12px;
	border: 1px solid var(--ses-wl-line);
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 16px 40px rgba(33, 43, 54, 0.14);
	color: var(--ses-wl-ink);
	font-family: Montserrat, sans-serif;
	-webkit-font-smoothing: antialiased;
	opacity: 0;
	visibility: hidden;
	transform: translateY(12px);
	transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
}

.ses-toast.is-visible {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.ses-toast__image {
	flex: 0 0 56px;
	width: 56px;
	height: 56px;
	border-radius: 8px;
	background: var(--ses-wl-soft);
	object-fit: contain;
}

.ses-toast__body {
	flex: 1 1 auto;
	min-width: 0;
}

.ses-toast__title {
	font-size: 15px;
	font-weight: 500;
	line-height: 1.3;
}

.ses-toast__text {
	display: -webkit-box;
	margin-top: 2px;
	overflow: hidden;
	color: var(--ses-wl-muted);
	font-size: 13px;
	line-height: 1.4;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.ses-toast .ses-toast__action {
	flex: 0 0 auto;
	padding: 8px 4px;
	color: var(--ses-wl-accent-dark);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-decoration: none;
	text-transform: uppercase;
}

.ses-toast .ses-toast__action:hover,
.ses-toast .ses-toast__action:focus-visible {
	color: var(--ses-wl-ink);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.ses-toast .ses-toast__close {
	position: relative;
	flex: 0 0 28px;
	align-self: flex-start;
	width: 28px;
	height: 28px;
	margin: -4px -4px 0 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--ses-wl-muted);
	outline: 0;
	cursor: pointer;
}

.ses-toast .ses-toast__close:hover,
.ses-toast .ses-toast__close:focus-visible {
	background: var(--ses-wl-soft);
	color: var(--ses-wl-ink);
}

.ses-toast__close::before,
.ses-toast__close::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 12px;
	height: 1.5px;
	background: currentColor;
	transform: translate(-50%, -50%) rotate(45deg);
}

.ses-toast__close::after {
	transform: translate(-50%, -50%) rotate(-45deg);
}

.ses-toast [hidden] {
	display: none;
}

/* Phones: across the screen above the contact button; the action moves under the text. */
@media screen and (max-width: 599px) {
	.ses-toast {
		right: 16px;
		bottom: calc(80px + env(safe-area-inset-bottom, 0px));
		left: 16px;
		display: grid;
		grid-template-columns: minmax(0, 1fr) 28px;
		grid-template-areas:
			'body close'
			'action close';
		align-items: start;
		gap: 2px 12px;
		width: auto;
	}

	.ses-toast--image {
		grid-template-columns: 56px minmax(0, 1fr) 28px;
		grid-template-areas:
			'image body close'
			'image action close';
	}

	.ses-toast__image {
		grid-area: image;
		align-self: center;
	}

	.ses-toast__body {
		grid-area: body;
	}

	.ses-toast .ses-toast__action {
		grid-area: action;
		justify-self: start;
		padding: 6px 0 2px;
	}

	.ses-toast .ses-toast__close {
		grid-area: close;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ses-toast,
	.ses-toast.is-visible {
		transform: none;
	}

	.ses-wishlist-btn.is-popped > svg,
	.ses-wishlist-btn.woosw-adding > svg {
		animation: none;
	}
}
