/**
 * Side cart: opens after "add to cart" and from the header's cart button. From the left on
 * large screens, from the bottom on phones.
 */

.zm-drawer {
	--zd-p: var(--zm-color-primary, #732bed);
	--zd-a: var(--zm-color-accent, #c01dfb);
	--zd-d: var(--zm-color-heading, #1c1c25);
	--zd-m: var(--zm-color-muted, #707486);
	--zd-s: var(--zm-color-subtle, #a4a8ba);
	--zd-b: var(--zm-color-border, #eceef3);
	--zd-soft: color-mix(in srgb, var(--zd-p) 7%, #ffffff);
	--zd-ease: cubic-bezier(0.22, 1, 0.36, 1);
	position: fixed;
	inset: 0;
	z-index: 9990;
}

/* The side cart only: another ".zm-drawer" rule of the theme must not change its layer. */
.zm-drawer[data-zm-drawer] {
	position: fixed;
	inset: 0;
	z-index: 99990;
	display: block;
	width: auto;
	height: auto;
	transform: none;
}

.zm-drawer[data-zm-drawer][hidden] {
	display: none;
}

.zm-drawer *,
.zm-drawer *::before,
.zm-drawer *::after {
	box-sizing: border-box;
}

.zm-drawer__veil {
	position: absolute;
	inset: 0;
	background: rgba(15, 2, 21, 0.45);
	opacity: 0;
	backdrop-filter: blur(3px);
	transition: opacity 0.35s ease;
}

.zm-drawer__panel {
	position: absolute;
	top: 12px;
	bottom: 12px;
	left: 12px;
	display: flex;
	flex-direction: column;
	width: min(410px, calc(100% - 24px));
	overflow: hidden;
	background: #ffffff;
	border-radius: 32px;
	box-shadow: 0 30px 80px rgba(15, 2, 21, 0.3);
	outline: none;
	transform: translateX(calc(-100% - 24px));
	transition: transform 0.45s var(--zd-ease);
}

.zm-drawer.is-open .zm-drawer__veil {
	opacity: 1;
}

.zm-drawer.is-open .zm-drawer__panel {
	transform: none;
}

html.zm-drawer-open {
	overflow: hidden;
}

.zm-drawer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 22px 24px 14px;
}

.zm-drawer__head h2 {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	font-size: 17px;
	font-weight: 800;
	color: var(--zd-d);
}

.zm-drawer__count {
	padding: 2px 10px;
	font-size: 12px;
	font-weight: 600;
	color: var(--zd-p);
	background: var(--zd-soft);
	border-radius: 999px;
}

.zm-drawer__close {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	color: var(--zd-d);
	background: #f4f5f8;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	transition: background 0.2s, transform 0.3s var(--zd-ease);
}

.zm-drawer__close:hover {
	background: #eceef3;
	transform: rotate(90deg);
}

.zm-drawer__close svg {
	width: 20px;
	height: 20px;
}

.zm-drawer__added {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 24px 12px;
	padding: 10px 14px;
	font-size: 12.5px;
	line-height: 1.7;
	color: #0f7a55;
	background: #e9f8f1;
	border-radius: 16px;
	animation: zm-drawer-pop 0.35s var(--zd-ease);
}

.zm-drawer__added[hidden] {
	display: none;
}

.zm-drawer__added::before {
	content: "";
	flex: 0 0 24px;
	height: 24px;
	background: #12a372 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center / 14px no-repeat;
	border-radius: 50%;
}

.zm-drawer__added.is-error {
	color: #b4083a;
	background: #fdecef;
}

.zm-drawer__added.is-error::before {
	background: var(--zm-color-sale, #e80c4a) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M12 7v6M12 16.8v.1'/%3E%3C/svg%3E") center / 14px no-repeat;
}

@keyframes zm-drawer-pop {
	from {
		opacity: 0;
		transform: translateY(-6px);
	}
}

.zm-drawer__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-height: 0;
	transition: opacity 0.2s;
}

.zm-drawer.is-loading .zm-drawer__body {
	opacity: 0.55;
	pointer-events: none;
}

/* Free shipping (small) */
.zm-drawer .zm-free {
	display: block;
	margin: 0 24px;
	padding: 12px 14px;
	border: 0;
	background: linear-gradient(120deg, var(--zd-soft), color-mix(in srgb, var(--zd-a) 5%, #ffffff));
	border-radius: 18px;
}

.zm-drawer .zm-free__icon {
	display: none;
}

.zm-drawer .zm-free__text {
	margin: 0 0 8px;
	font-size: 12px;
	line-height: 1.7;
	color: var(--zd-d);
}

.zm-drawer .zm-free__text b {
	color: var(--zd-p);
}

.zm-drawer .zm-free__bar {
	position: relative;
	height: 6px;
	background: #ffffff;
	border-radius: 999px;
}

.zm-drawer .zm-free__bar span {
	position: absolute;
	inset-block: 0;
	inset-inline-start: 0;
	max-width: 100%;
	background: linear-gradient(270deg, var(--zd-a), var(--zd-p));
	border-radius: inherit;
	transition: width 0.8s var(--zd-ease);
}

.zm-drawer .zm-free.is-done {
	background: #e9f8f1;
}

.zm-drawer .zm-free.is-done .zm-free__text b {
	color: #0f8a5f;
}

.zm-drawer .zm-free.is-done .zm-free__bar span {
	background: #12a372;
}

/* Items */
.zm-drawer__list {
	flex: 1;
	margin: 0;
	padding: 6px 24px;
	overflow-y: auto;
	overscroll-behavior: contain;
	list-style: none;
}

.zm-drawer__item {
	display: grid;
	grid-template-columns: 72px minmax(0, 1fr) auto;
	gap: 14px;
	align-items: center;
	padding: 14px 0;
	border-bottom: 1px dashed #e6e8ee;
	transition: opacity 0.2s;
}

.zm-drawer__item:last-child {
	border-bottom: 0;
}

.zm-drawer__item.is-busy {
	opacity: 0.5;
	pointer-events: none;
}

.zm-drawer__img {
	display: block;
	aspect-ratio: 1;
	padding: 5px;
	background: linear-gradient(160deg, var(--zd-soft), color-mix(in srgb, var(--zd-a) 5%, #ffffff));
	border-radius: 18px;
}

.zm-drawer__img img {
	display: block;
	width: 100%;
	max-width: none;
	height: 100%;
	object-fit: contain;
	background: #ffffff;
	border: 3px solid #ffffff;
	border-radius: 13px;
	box-shadow: 0 6px 14px rgba(60, 30, 90, 0.1);
}

.zm-drawer__info {
	min-width: 0;
}

.zm-drawer__name {
	margin: 0 0 2px;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.7;
	color: var(--zd-d);
}

.zm-drawer__name a {
	color: inherit;
	text-decoration: none;
}

.zm-drawer__name a:hover {
	color: var(--zd-p);
}

.zm-drawer__meta {
	display: block;
	font-size: 11px;
	color: var(--zd-s);
}

.zm-drawer__price {
	margin-top: 4px;
	font-size: 13.5px;
	font-weight: 800;
	color: var(--zd-d);
}

.zm-drawer__price .woocommerce-Price-currencySymbol {
	font-size: 10.5px;
	font-weight: 400;
	color: var(--zd-m);
}

/* Quantity, upright */
.zm-qty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	padding: 4px;
	border: 1.5px solid var(--zd-b);
	border-radius: 999px;
}

.zm-qty button {
	display: grid;
	place-items: center;
	width: 26px;
	height: 26px;
	padding: 0;
	font: inherit;
	font-size: 15px;
	line-height: 1;
	color: var(--zd-d);
	background: var(--zd-soft);
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	transition: background 0.2s, color 0.2s;
}

.zm-qty button:hover {
	color: #ffffff;
	background: var(--zd-p);
}

.zm-qty button:disabled {
	opacity: 0.4;
	pointer-events: none;
}

.zm-qty button.is-del {
	color: var(--zm-color-sale, #e80c4a);
	background: #fdecef;
}

.zm-qty button.is-del:hover {
	color: #ffffff;
	background: var(--zm-color-sale, #e80c4a);
}

.zm-qty button svg {
	width: 14px;
	height: 14px;
}

.zm-qty b {
	font-size: 13px;
	color: var(--zd-d);
}

/* Total and buttons */
.zm-drawer__foot {
	padding: 18px 24px 22px;
	background: #fafbfc;
	border-top: 1px solid var(--zd-b);
}

.zm-drawer__total {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 14px;
	font-size: 13px;
	color: var(--zd-m);
}

.zm-drawer__total b {
	font-size: 19px;
	font-weight: 900;
	color: var(--zd-d);
}

.zm-drawer__total .woocommerce-Price-currencySymbol {
	font-size: 11px;
	font-weight: 400;
	color: var(--zd-m);
}

.zm-drawer__btns {
	display: grid;
	grid-template-columns: 1fr 1.4fr;
	gap: 10px;
}

.zm-drawer__view,
.zm-drawer__go {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 52px;
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
	border-radius: 999px;
	transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.zm-drawer__view {
	color: var(--zd-d);
	background: #ffffff;
	border: 1.5px solid #dcdfe7;
}

.zm-drawer__view:hover {
	color: var(--zd-p);
	border-color: color-mix(in srgb, var(--zd-p) 40%, transparent);
}

.zm-drawer__go {
	padding: 0 18px 0 56px;
	color: #ffffff;
	background: linear-gradient(135deg, var(--zd-a), color-mix(in srgb, var(--zd-a) 40%, var(--zd-p)));
	box-shadow: 0 12px 26px color-mix(in srgb, var(--zd-a) 32%, transparent);
}

.zm-drawer__go:hover {
	color: #ffffff;
	transform: translateY(-2px);
}

.zm-drawer__go i {
	position: absolute;
	top: 6px;
	left: 6px;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	background: var(--zd-d);
	border-radius: 50%;
}

.zm-drawer__go svg {
	width: 18px;
	height: 18px;
}

/* Empty */
.zm-drawer__empty {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	padding: 30px 24px 50px;
	text-align: center;
}

.zm-drawer__empty-icon {
	display: grid;
	place-items: center;
	width: 96px;
	height: 96px;
	color: var(--zd-p);
	background: radial-gradient(circle, #ffffff 0 40%, transparent 41%), linear-gradient(160deg, var(--zd-soft), color-mix(in srgb, var(--zd-a) 8%, #ffffff));
	border-radius: 50%;
}

.zm-drawer__empty-icon svg {
	width: 40px;
	height: 40px;
}

.zm-drawer__empty p {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	color: var(--zd-d);
}

.zm-drawer__shop {
	display: inline-flex;
	align-items: center;
	height: 46px;
	padding: 0 26px;
	font-size: 13.5px;
	font-weight: 700;
	color: #ffffff;
	text-decoration: none;
	background: var(--zd-d);
	border-radius: 999px;
}

.zm-drawer__shop:hover {
	color: #ffffff;
	background: var(--zd-p);
}

.zm-drawer :is(a, button):focus-visible {
	outline: 2px solid var(--zd-p);
	outline-offset: 2px;
}

/* Phones: a sheet from the bottom */
@media (max-width: 767px) {
	.zm-drawer__panel {
		top: auto;
		right: 0;
		bottom: 0;
		left: 0;
		width: auto;
		max-height: 86vh;
		max-height: 86dvh;
		border-radius: 30px 30px 0 0;
		transform: translateY(100%);
	}

	.zm-drawer__panel::before {
		content: "";
		position: absolute;
		top: 8px;
		left: 50%;
		width: 44px;
		height: 5px;
		background: #e1e3ea;
		border-radius: 9px;
		transform: translateX(-50%);
	}

	.zm-drawer__head {
		padding: 24px 18px 12px;
	}

	.zm-drawer__added,
	.zm-drawer .zm-free {
		margin-inline: 18px;
	}

	.zm-drawer__list {
		padding-inline: 18px;
	}

	.zm-drawer__foot {
		padding: 14px 18px calc(16px + env(safe-area-inset-bottom));
	}
}

@media (prefers-reduced-motion: reduce) {
	.zm-drawer__panel,
	.zm-drawer__veil {
		transition: none;
	}
}



/* Discounted item: regular price struck through next to the price */

.zm-drawer .zm-pricecut {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0 8px;
}

.zm-drawer .zm-pricecut__was {
	order: 2;
	font-size: 11.5px;
	font-weight: 400;
	color: var(--zd-s);
	text-decoration: line-through;
}

.zm-drawer .zm-pricecut__now {
	background: none;
	text-decoration: none;
	color: inherit;
}