/*
 * est_wishlist 1.0.0
 *
 * Цвет акцента задаётся в настройках модуля и приходит переменной --ewl-accent.
 * julytheme красит все button через inline-стили в шапке, подключённые позже
 * этого файла (в том числе .product-thumb button:hover), поэтому у кнопок
 * модуля внешний вид закреплён через !important.
 */

:root {
	--ewl-accent: #950051;
	--ewl-price: #c1036d;
	--ewl-soft: #f9e6ef;
	--ewl-ok: #1d7a3e;
}

/* ---------------------------------------------------------------- иконка */

.ewl-ic {
	display: block;
	width: 20px;
	height: 20px;
	overflow: visible;
}

.ewl-ic path {
	fill: transparent;
	stroke: currentColor;
	stroke-width: 1.9;
	stroke-linejoin: round;
	transition: fill .2s ease;
}

.ewl-on .ewl-ic path,
.ewl-empty__ic .ewl-ic path {
	fill: currentColor;
}

.ewl-ic-line {
	display: block;
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* ---------------------------------------------------------------- сердечко */

.ewl-btn {
	position: relative;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 36px !important;
	height: 36px !important;
	min-width: 0 !important;
	margin: 0;
	padding: 0 !important;
	border: 1px solid #e3e3e3 !important;
	border-radius: 50% !important;
	background: #fff !important;
	color: #8e8e8e !important;
	line-height: 1 !important;
	box-shadow: none !important;
	text-transform: none !important;
	cursor: pointer;
	vertical-align: middle;
	-webkit-tap-highlight-color: transparent;
	transition: color .2s, background-color .2s, border-color .2s !important;
}

.ewl-btn:hover,
.ewl-btn:focus {
	color: var(--ewl-accent) !important;
	background: #fff !important;
	outline: none;
}

.ewl-btn:focus-visible {
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ewl-accent) !important;
}

.ewl-btn.ewl-on,
.ewl-btn.ewl-on:hover {
	color: var(--ewl-accent) !important;
	border-color: transparent !important;
	background: var(--ewl-soft) !important;
	background: color-mix(in srgb, var(--ewl-accent) 11%, #fff) !important;
}

.ewl-btn .ewl-ic {
	transition: transform .15s ease;
}

.ewl-btn:active .ewl-ic {
	transform: scale(.82);
}

/* Вспышка при добавлении: кольцо + разлетающиеся точки + «пружина» сердца. */
.ewl-btn::before,
.ewl-btn::after,
.ewl-save::before,
.ewl-save::after {
	content: '';
	position: absolute;
	pointer-events: none;
	opacity: 0;
}

.ewl-btn::before,
.ewl-save::before {
	top: -1px;
	right: -1px;
	bottom: -1px;
	left: -1px;
	border: 2px solid var(--ewl-accent);
	border-radius: inherit;
}

.ewl-btn::after,
.ewl-save::after {
	left: 50%;
	top: 50%;
	width: 4px;
	height: 4px;
	margin: -2px 0 0 -2px;
	border-radius: 50%;
	box-shadow:
		0 -23px 0 var(--ewl-accent),
		20px -11px 0 #f19bc2,
		20px 11px 0 var(--ewl-accent),
		0 23px 0 #f19bc2,
		-20px 11px 0 var(--ewl-accent),
		-20px -11px 0 #f19bc2;
}

.ewl-burst .ewl-ic {
	animation: ewl-pop .5s cubic-bezier(.3, 1.6, .5, 1);
}

.ewl-burst::before {
	animation: ewl-ring .5s ease-out;
}

.ewl-burst::after {
	animation: ewl-dots .6s ease-out;
}

@keyframes ewl-pop {
	0% { transform: scale(.55); }
	55% { transform: scale(1.28); }
	100% { transform: scale(1); }
}

@keyframes ewl-ring {
	0% { transform: scale(.6); opacity: .85; }
	100% { transform: scale(1.75); opacity: 0; }
}

@keyframes ewl-dots {
	0% { transform: scale(.3); opacity: 1; }
	70% { opacity: 1; }
	100% { transform: scale(1.15); opacity: 0; }
}

/* ---------------------------------------------------------------- карточка товара */

/* Старое сердечко темы на фото больше не нужно. */
.product-thumb .wishcomp .wishlist,
#product .links .cart-wishlist {
	display: none !important;
}

/* По умолчанию — справа в строке цены. */
.ewl-host--price {
	position: relative;
	min-height: 36px;
	padding-right: 44px !important;
}

.ewl-host--price > .ewl-btn {
	position: absolute !important;
	right: 0;
	top: 50%;
	margin-top: -20px;
}

/* Вариант «у кнопки Купить». */
.ewl-host--button {
	position: relative;
	padding-right: 44px !important;
}

.ewl-host--button > .ewl-btn {
	position: absolute !important;
	right: 0;
	top: 50%;
	margin-top: -18px;
	float: none !important;
}

.ewl-host--caption {
	position: relative;
}

.ewl-host--caption > .ewl-btn {
	position: absolute !important;
	right: 0;
	top: 0;
}

/* ---------------------------------------------------------------- страница товара */

.ewl-btn.ewl-btn--product {
	width: 46px !important;
	height: 38px !important;
	margin: 0 4px 10px 4px;
	border-radius: 4px !important;
	border-color: #dcdcdc !important;
	vertical-align: top;
}

.ewl-btn--product .ewl-ic {
	width: 22px;
	height: 22px;
}

.ewl-btn.ewl-btn--product.ewl-on {
	border-color: var(--ewl-accent) !important;
}

.ewl-btn--product::after {
	box-shadow:
		0 -25px 0 var(--ewl-accent),
		23px -12px 0 #f19bc2,
		23px 12px 0 var(--ewl-accent),
		0 25px 0 #f19bc2,
		-23px 12px 0 var(--ewl-accent),
		-23px -12px 0 #f19bc2;
}

/* Старые ссылки «В закладки» в местах, которые модуль не заменяет. */
[onclick*="wishlist.add"].ewl-on {
	color: var(--ewl-accent) !important;
}

/* ---------------------------------------------------------------- шапка */

.ewl-hdr {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	color: #fff !important;
	text-decoration: none !important;
	-webkit-tap-highlight-color: transparent;
}

.ewl-hdr__ic {
	position: relative;
	display: block;
	width: 24px;
	height: 24px;
}

.ewl-hdr .ewl-ic {
	width: 24px;
	height: 24px;
}

.ewl-hdr .ewl-ic path {
	stroke-width: 1.7;
}

.ewl-count {
	position: absolute;
	top: -7px;
	right: -11px;
	display: none;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 9px;
	background: var(--ewl-accent);
	box-shadow: 0 0 0 2px #171717;
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	line-height: 18px;
	text-align: center;
	font-style: normal;
}

.ewl-has .ewl-count {
	display: block;
}

.ewl-bump .ewl-hdr__ic {
	animation: ewl-bump .5s cubic-bezier(.3, 1.6, .5, 1);
}

.ewl-bump .ewl-count {
	animation: ewl-count .5s ease-out;
}

@keyframes ewl-bump {
	0% { transform: scale(1); }
	35% { transform: scale(1.35); }
	100% { transform: scale(1); }
}

@keyframes ewl-count {
	0% { transform: scale(1); }
	40% { transform: scale(1.45); }
	100% { transform: scale(1); }
}

/* Вариант A: в чёрной панели «Меню / Каталог / Відгуки» (видна на телефоне и планшете). */
#mobile-header.ewl-bar-on {
	position: relative;
	padding-right: 48px;
}

.ewl-hdr--bar {
	position: absolute !important;
	top: 0;
	right: 0;
	width: 48px;
	height: 36px;
	border-left: 1px solid rgba(255, 255, 255, .14);
}

/* Вариант B: рядом с корзиной в шапке. */
.ewl-hdr--cart {
	float: left;
	width: 44px;
	height: 44px;
	margin-top: 34px;
}

.ewl-hdr--cart .ewl-count {
	box-shadow: 0 0 0 2px #351311;
}

/* Вариант C: в верхней строке рядом с «Мій кабінет». */
.ewl-hdr--top {
	margin-right: 6px;
	padding: 4px 10px;
	border: 1px solid rgba(255, 255, 255, .2);
	border-radius: 10px;
	background: rgba(255, 255, 255, .15);
	font-size: 13px;
	line-height: 1.6;
	vertical-align: middle;
}

/* Здесь число стоит в строку после сердечка, а не бейджем над ним. */
.ewl-hdr--top .ewl-hdr__ic {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	width: auto;
	height: auto;
}

.ewl-hdr--top .ewl-ic {
	width: 17px;
	height: 17px;
}

.ewl-hdr--top .ewl-count {
	position: static;
	box-shadow: none;
}

.ewl-hdr--top.ewl-has .ewl-count {
	display: inline-block;
}

@media (max-width: 767px) {
	.ewl-hdr--top .ewl-hdr__label {
		display: none;
	}
}

/* ---------------------------------------------------------------- полёт в шапку */

.ewl-fly {
	position: fixed;
	z-index: 100000;
	width: 0;
	height: 0;
	pointer-events: none;
	will-change: transform;
	transition: transform .62s cubic-bezier(.25, .6, .35, 1);
}

.ewl-fly__in {
	position: absolute;
	left: -15px;
	top: -15px;
	width: 30px;
	height: 30px;
	color: var(--ewl-accent);
	will-change: transform;
	transition: transform .62s cubic-bezier(.55, -0.4, .8, .3);
}

.ewl-fly .ewl-ic {
	width: 30px;
	height: 30px;
	filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .25));
}

.ewl-fly .ewl-ic path {
	fill: currentColor;
	stroke: #fff;
	stroke-width: 1.4;
}

/* ---------------------------------------------------------------- уведомление */

.ewl-toast {
	position: fixed;
	left: 50%;
	bottom: 16px;
	bottom: calc(16px + env(safe-area-inset-bottom));
	z-index: 100001;
	display: flex;
	align-items: center;
	gap: 18px;
	width: -webkit-max-content;
	width: max-content;
	max-width: calc(100% - 24px);
	padding: 12px 16px;
	border-radius: 12px;
	background: #222;
	box-shadow: 0 8px 28px rgba(0, 0, 0, .22);
	color: #fff;
	font-size: 14px;
	line-height: 1.35;
	opacity: 0;
	pointer-events: none;
	transform: translate(-50%, 140%);
	transition: transform .32s cubic-bezier(.2, .8, .3, 1), opacity .2s;
}

.ewl-toast.ewl-show {
	opacity: 1;
	pointer-events: auto;
	transform: translate(-50%, 0);
}

.ewl-toast__act {
	color: #f6a8cb !important;
	font-weight: 600;
	white-space: nowrap;
	text-decoration: none !important;
}

/* ---------------------------------------------------------------- корзина Simple */

.ewl-save {
	position: relative;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 34px !important;
	height: 34px !important;
	margin: 0 4px 0 0;
	padding: 0 !important;
	border: 1px solid #e0e0e0 !important;
	border-radius: 4px !important;
	background: #fff !important;
	color: #8e8e8e !important;
	line-height: 1 !important;
	vertical-align: middle;
}

.ewl-save:hover,
.ewl-save.ewl-on {
	color: var(--ewl-accent) !important;
	border-color: var(--ewl-accent) !important;
}

/* ---------------------------------------------------------------- страница избранного */

.ewl-page {
	max-width: 820px;
	margin: 0 auto 28px;
}

.ewl-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 4px 0 14px;
}

.ewl-title {
	margin: 0 !important;
	font-size: 24px;
	font-weight: 600;
	line-height: 1.25;
}

.ewl-title__count {
	margin-left: 6px;
	color: #8a8a8a;
	font-size: 14px;
	font-weight: 400;
	white-space: nowrap;
}

.ewl-share,
.ewl-chip,
.ewl-del,
.ewl-cart,
.ewl-btn-main,
.ewl-btn-line {
	box-shadow: none !important;
	text-transform: none !important;
	-webkit-tap-highlight-color: transparent;
	cursor: pointer;
}

.ewl-share {
	display: inline-flex !important;
	align-items: center;
	flex: none;
	gap: 6px;
	height: 36px;
	padding: 0 14px !important;
	border: 1px solid #e0e0e0 !important;
	border-radius: 18px !important;
	background: #fff !important;
	color: #333 !important;
	font-size: 14px !important;
	line-height: 1 !important;
}

.ewl-share:hover {
	border-color: #bdbdbd !important;
}

.ewl-note {
	margin: 0 0 14px;
	padding: 12px 14px;
	border-radius: 12px;
	background: var(--ewl-soft);
	background: color-mix(in srgb, var(--ewl-accent) 8%, #fff);
}

.ewl-note p {
	margin: 0 0 10px;
}

.ewl-btn-line {
	height: 38px;
	padding: 0 16px !important;
	border: 1px solid var(--ewl-accent) !important;
	border-radius: 8px !important;
	background: #fff !important;
	color: var(--ewl-accent) !important;
	font-size: 14px !important;
	font-weight: 600;
	line-height: 1 !important;
}

.ewl-chips {
	display: flex;
	gap: 8px;
	margin: 0 -2px;
	padding: 2px 2px 12px;
	overflow-x: auto;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.ewl-chips::-webkit-scrollbar {
	display: none;
}

.ewl-chip {
	flex: none;
	height: 34px;
	padding: 0 14px !important;
	border: 1px solid #e0e0e0 !important;
	border-radius: 17px !important;
	background: #fff !important;
	color: #333 !important;
	font-size: 13px !important;
	line-height: 1 !important;
}

.ewl-chip span {
	margin-left: 2px;
	color: #9a9a9a;
}

.ewl-chip.is-active {
	border-color: #222 !important;
	background: #222 !important;
	color: #fff !important;
}

.ewl-chip.is-active span {
	color: rgba(255, 255, 255, .7);
}

.ewl-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ewl-item {
	display: flex;
	gap: 12px;
	padding: 10px;
	overflow: hidden;
	border: 1px solid #ececec;
	border-radius: 12px;
	background: #fff;
	transition: height .25s ease, opacity .2s ease, padding .25s ease, margin .25s ease, border-width .25s ease;
}

.ewl-item.ewl-hide {
	display: none;
}

.ewl-item.ewl-leaving {
	height: 0 !important;
	margin-bottom: -8px;
	padding-top: 0;
	padding-bottom: 0;
	border-width: 0;
	opacity: 0;
}

.ewl-item__img {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 80px;
	height: 80px;
	overflow: hidden;
	border-radius: 8px;
	background: #f6f6f6;
}

.ewl-item__img img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.ewl-item--out .ewl-item__img img {
	opacity: .45;
}

.ewl-item__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
	min-width: 0;
}

.ewl-item__name {
	display: -webkit-box;
	overflow: hidden;
	color: #222 !important;
	font-size: 14px;
	line-height: 1.3;
	text-decoration: none !important;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.ewl-item--out .ewl-item__name {
	color: #8a8a8a !important;
}

.ewl-item__price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 6px;
}

.ewl-price {
	color: var(--ewl-price);
	font-size: 16px;
	font-weight: 600;
	white-space: nowrap;
}

.ewl-price-old {
	color: #9a9a9a;
	font-size: 13px;
	white-space: nowrap;
}

.ewl-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 6px;
	font-size: 12px;
	line-height: 1.5;
}

.ewl-badge--drop {
	background: #e7f5ec;
	color: var(--ewl-ok);
}

.ewl-stock {
	font-size: 12px;
}

.ewl-stock--low {
	color: #b4610a;
}

.ewl-stock--out {
	color: #8a8a8a;
}

.ewl-item__act {
	display: flex;
	flex: none;
	flex-direction: column;
	align-items: flex-end;
	justify-content: space-between;
	gap: 8px;
}

.ewl-del {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	margin: -6px -6px 0 0;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: transparent !important;
	color: #a8a8a8 !important;
	line-height: 1 !important;
}

.ewl-del:hover {
	color: #555 !important;
}

.ewl-cart {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 38px;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 8px !important;
	background: var(--ewl-accent) !important;
	color: #fff !important;
	line-height: 1 !important;
	transition: background-color .2s, opacity .2s !important;
}

.ewl-cart__ok {
	display: none;
}

.ewl-cart.is-done {
	background: var(--ewl-ok) !important;
}

.ewl-cart.is-done .ewl-cart__ic {
	display: none;
}

.ewl-cart.is-done .ewl-cart__ok {
	display: block;
}

.ewl-cart.is-busy {
	opacity: .6;
}

.ewl-cart--opt {
	width: auto;
	padding: 0 12px !important;
	font-size: 13px;
	text-decoration: none !important;
}

.ewl-empty {
	padding: 40px 16px 32px;
	text-align: center;
}

.ewl-empty[hidden],
.ewl-title__count[hidden] {
	display: none !important;
}

.ewl-empty__ic {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 68px;
	height: 68px;
	margin: 0 auto 14px;
	border-radius: 50%;
	background: var(--ewl-soft);
	background: color-mix(in srgb, var(--ewl-accent) 10%, #fff);
	color: var(--ewl-accent);
}

.ewl-empty__ic .ewl-ic {
	width: 32px;
	height: 32px;
}

.ewl-empty__title {
	margin: 0 0 6px;
	color: #222;
	font-size: 18px;
	font-weight: 600;
}

.ewl-empty__text {
	max-width: 340px;
	margin: 0 auto 20px;
	color: #777;
}

.ewl-btn-main {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 48px;
	padding: 0 22px !important;
	border: 0 !important;
	border-radius: 10px !important;
	background: var(--ewl-accent) !important;
	color: #fff !important;
	font-size: 15px !important;
	font-weight: 600;
	line-height: 1.2 !important;
	text-decoration: none !important;
}

.ewl-btn-main.is-busy {
	opacity: .7;
}

.ewl-guest {
	margin: 14px 2px 0;
	color: #888;
	font-size: 13px;
}

.ewl-bar {
	display: flex;
	justify-content: flex-end;
	margin-top: 16px;
}

.ewl-all {
	min-width: 320px;
	justify-content: space-between !important;
}

.ewl-all__sum {
	font-weight: 600;
	opacity: .92;
	white-space: nowrap;
}

@media (max-width: 767px) {
	.ewl-title {
		font-size: 20px;
	}

	.ewl-page--bar {
		padding-bottom: 76px;
	}

	.ewl-bar {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 1000;
		display: block;
		margin: 0;
		padding: 10px 12px;
		padding-bottom: calc(10px + env(safe-area-inset-bottom));
		background: #fff;
		box-shadow: 0 -4px 16px rgba(0, 0, 0, .08);
	}

	.ewl-all {
		width: 100%;
		min-width: 0;
	}

	.ewl-body .ewl-toast {
		bottom: 84px;
		bottom: calc(84px + env(safe-area-inset-bottom));
	}

	.ewl-share span {
		display: none;
	}

	.ewl-share {
		width: 38px;
		height: 38px;
		padding: 0 !important;
		justify-content: center;
	}
}

/* ---------------------------------------------------------------- без лишнего движения */

@media (prefers-reduced-motion: reduce) {
	.ewl-btn,
	.ewl-btn .ewl-ic,
	.ewl-item,
	.ewl-toast {
		transition: none !important;
	}

	.ewl-burst .ewl-ic,
	.ewl-burst::before,
	.ewl-burst::after,
	.ewl-bump .ewl-hdr__ic,
	.ewl-bump .ewl-count {
		animation: none !important;
	}
}
