/* Structure only. Colors, sizes, fonts and position offsets come from the settings as inline CSS. */

.dwe-recently-purchased-popup {
	position: fixed;
	z-index: 2147483647;
	display: flex;
	align-items: center;
	gap: 12px;
	box-sizing: border-box;
	overflow: hidden;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s;
}
.dwe-recently-purchased-popup * {
	box-sizing: border-box;
}

/* Hidden state of each entrance animation. Fade only changes the opacity. */
.dwe-recently-purchased-popup--animation-zoom {
	transform: scale(0.9);
}
.dwe-recently-purchased-popup--animation-pop {
	transform: scale(0.6);
	transition: opacity 0.3s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), visibility 0.5s;
}
.dwe-recently-purchased-popup--animation-flip-x {
	transform: perspective(600px) rotateX(-90deg);
}
.dwe-recently-purchased-popup--animation-flip-y {
	transform: perspective(600px) rotateY(-90deg);
}
.dwe-recently-purchased-popup--animation-rotate {
	transform: rotate(-10deg) scale(0.8);
}
.dwe-recently-purchased-popup--animation-slide-left {
	transform: translateX(-30px);
}
.dwe-recently-purchased-popup--animation-slide-right {
	transform: translateX(30px);
}
.dwe-recently-purchased-popup--animation-slide-top {
	transform: translateY(-20px);
}
.dwe-recently-purchased-popup--animation-slide-bottom {
	transform: translateY(20px);
}
.dwe-recently-purchased-popup.is-visible {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: none;
}

/* Image and message. */
.dwe-recently-purchased-popup__image-link {
	display: block;
	flex: 0 0 auto;
	line-height: 0;
}
.dwe-recently-purchased-popup__image {
	display: block;
	object-fit: cover;
}
.dwe-recently-purchased-popup__content {
	flex: 1 1 auto;
	min-width: 0;
	overflow-wrap: anywhere;
}
.dwe-recently-purchased-popup__message a {
	font-weight: 600;
	text-decoration: none;
}
.dwe-recently-purchased-popup__message a:hover {
	text-decoration: underline;
}

/* Close button. The message leaves room on the side the button is on. */
.dwe-recently-purchased-popup__close {
	position: absolute;
	top: 6px;
	width: 22px;
	height: 22px;
	padding: 0;
	border: 0;
	background: transparent;
	box-shadow: none;
	font-size: 20px;
	line-height: 22px;
	text-align: center;
	cursor: pointer;
}
.dwe-recently-purchased-popup__close:hover,
.dwe-recently-purchased-popup__close:focus {
	opacity: 0.7;
}
.dwe-recently-purchased-popup--close-right .dwe-recently-purchased-popup__close {
	right: 8px;
}
.dwe-recently-purchased-popup--close-left .dwe-recently-purchased-popup__close {
	left: 8px;
}
.dwe-recently-purchased-popup--close-right .dwe-recently-purchased-popup__content {
	padding-right: 18px;
}
.dwe-recently-purchased-popup--close-left .dwe-recently-purchased-popup__content {
	padding-left: 18px;
}

/* Layout 2: image on the right. */
.dwe-recently-purchased-popup--layout-2 {
	flex-direction: row-reverse;
}

/* Layout 3: card, full width image on top. The image height comes from the Image Size setting. */
.dwe-recently-purchased-popup--layout-3 {
	flex-direction: column;
	align-items: stretch;
	gap: 10px;
}
.dwe-recently-purchased-popup--layout-3 .dwe-recently-purchased-popup__image-link,
.dwe-recently-purchased-popup--layout-3 .dwe-recently-purchased-popup__image {
	width: 100%;
}
.dwe-recently-purchased-popup--layout-3 .dwe-recently-purchased-popup__content {
	padding-left: 0;
	padding-right: 0;
}
.dwe-recently-purchased-popup--layout-3 .dwe-recently-purchased-popup__close {
	top: 14px;
}
.dwe-recently-purchased-popup--layout-3.dwe-recently-purchased-popup--close-right .dwe-recently-purchased-popup__close {
	right: 14px;
}
.dwe-recently-purchased-popup--layout-3.dwe-recently-purchased-popup--close-left .dwe-recently-purchased-popup__close {
	left: 14px;
}

/* A round background keeps the close icon readable when it sits on top of the product image. */
.dwe-recently-purchased-popup--layout-1.dwe-recently-purchased-popup--close-left .dwe-recently-purchased-popup__close,
.dwe-recently-purchased-popup--layout-2.dwe-recently-purchased-popup--close-right .dwe-recently-purchased-popup__close,
.dwe-recently-purchased-popup--layout-3 .dwe-recently-purchased-popup__close {
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.85);
}

/* Progress bar. The script shrinks it from the left while the popup is on screen. */
.dwe-recently-purchased-popup__progress {
	position: absolute;
	left: 0;
	right: 0;
	transform-origin: left center;
	pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
	.dwe-recently-purchased-popup {
		transition: opacity 0.1s linear, visibility 0.1s;
		transform: none !important;
	}
}
