/**
 * Cart engagement popups.
 */

.shofy-ce-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	z-index: 99998;
	opacity: 0;
	transition: opacity 0.25s ease;
}

.shofy-ce-overlay.is-visible {
	opacity: 1;
}

.shofy-ce-popup {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -48%) scale(0.96);
	width: min(560px, calc(100vw - 32px));
	max-height: calc(100vh - 40px);
	background: var(--tp-common-white, #fff);
	border-radius: 12px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
	z-index: 99999;
	opacity: 0;
	transition: opacity 0.25s ease, transform 0.25s ease;
	overflow: hidden;
}

.shofy-ce-popup.is-visible {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1);
}

.shofy-ce-popup--abandon {
	width: min(520px, calc(100vw - 32px));
}

.shofy-ce-popup__close {
	position: absolute;
	top: 12px;
	left: 12px;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.06);
	color: var(--tp-common-black, #111);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 2;
	transition: background 0.2s ease;
}

.shofy-ce-popup__close:hover {
	background: rgba(0, 0, 0, 0.12);
}

.shofy-ce-popup__inner {
	padding: 24px;
	max-height: calc(100vh - 40px);
	overflow-y: auto;
}

body.shofy-ce-open {
	overflow: hidden;
}

/* Recommendations popup */
.shofy-ce-rec__head {
	margin-bottom: 16px;
	padding-left: 40px;
}

.shofy-ce-rec__title {
	margin: 0 0 6px;
	font-size: 18px;
	font-weight: 700;
	color: var(--tp-common-black, #111);
}

.shofy-ce-rec__desc {
	margin: 0;
	font-size: 13px;
	color: var(--tp-text-body, #666);
}

.shofy-cart-rec--popup {
	padding: 0;
	border: 0;
}

.shofy-cart-rec--popup .shofy-cart-rec__heading {
	display: none;
}

.shofy-cart-rec--popup .shofy-cart-rec__list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
	overflow: visible;
}

.shofy-cart-rec--popup .shofy-cart-rec__item {
	flex: unset;
	min-width: 0;
}

.shofy-cart-rec--popup .shofy-cart-rec__thumb img {
	height: 110px;
}

/* Abandoned cart popup */
.shofy-ce-abandon__head {
	margin-bottom: 16px;
	padding-left: 40px;
}

.shofy-ce-abandon__title {
	margin: 0 0 6px;
	font-size: 18px;
	font-weight: 700;
	color: var(--tp-common-black, #111);
}

.shofy-ce-abandon__desc {
	margin: 0;
	font-size: 13px;
	color: var(--tp-text-body, #666);
	line-height: 1.6;
}

.shofy-ce-abandon__items {
	list-style: none;
	margin: 0 0 16px;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.shofy-ce-abandon__item {
	display: grid;
	grid-template-columns: 56px 1fr auto;
	gap: 10px;
	align-items: center;
	padding: 10px;
	border: 1px solid rgba(129, 129, 129, 0.18);
	border-radius: 8px;
}

.shofy-ce-abandon__thumb img {
	width: 56px;
	height: 56px;
	object-fit: cover;
	border-radius: 6px;
}

.shofy-ce-abandon__info {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.shofy-ce-abandon__name {
	font-size: 13px;
	font-weight: 600;
	color: var(--tp-common-black, #111);
	line-height: 1.4;
}

.shofy-ce-abandon__qty {
	font-size: 12px;
	color: var(--tp-text-body, #777);
}

.shofy-ce-abandon__price {
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
}

.shofy-ce-abandon__total {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 12px 0;
	border-top: 1px solid rgba(129, 129, 129, 0.18);
	margin-bottom: 16px;
	font-size: 14px;
}

.shofy-ce-abandon__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.shofy-ce-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 16px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	border: 0;
	cursor: pointer;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.shofy-ce-btn:hover {
	opacity: 0.92;
	transform: translateY(-1px);
	color: inherit;
}

.shofy-ce-btn--primary {
	background: var(--tp-theme-primary, #0984e3);
	color: #fff;
}

.shofy-ce-btn--ghost {
	background: rgba(0, 0, 0, 0.05);
	color: var(--tp-common-black, #111);
}

.shofy-ce-btn--secondary {
	background: #00b894;
	color: #fff;
}

.shofy-ce-abandon__sms {
	margin-top: 18px;
	padding-top: 16px;
	border-top: 1px dashed rgba(129, 129, 129, 0.25);
}

.shofy-ce-abandon__sms p {
	margin: 0 0 10px;
	font-size: 12px;
	color: var(--tp-text-body, #666);
}

.shofy-ce-abandon__sms-form {
	display: flex;
	gap: 8px;
}

.shofy-ce-abandon__sms-form input {
	flex: 1;
	min-width: 0;
	padding: 10px 12px;
	border: 1px solid rgba(129, 129, 129, 0.25);
	border-radius: 8px;
	font-size: 13px;
}

.shofy-ce-abandon__sms-msg {
	margin-top: 8px;
	font-size: 12px;
}

.shofy-ce-abandon__sms-msg.is-success {
	color: #00b894;
}

.shofy-ce-abandon__sms-msg.is-error {
	color: #e74c3c;
}

@media (max-width: 575px) {
	.shofy-cart-rec--popup .shofy-cart-rec__list {
		grid-template-columns: 1fr;
	}

	.shofy-ce-abandon__sms-form {
		flex-direction: column;
	}

	.shofy-ce-abandon__actions {
		flex-direction: column;
	}

	.shofy-ce-btn {
		width: 100%;
	}
}

[dir="rtl"] .shofy-ce-popup__close,
.rtl .shofy-ce-popup__close {
	left: auto;
	right: 12px;
}

[dir="rtl"] .shofy-ce-rec__head,
.rtl .shofy-ce-rec__head,
[dir="rtl"] .shofy-ce-abandon__head,
.rtl .shofy-ce-abandon__head {
	padding-left: 0;
	padding-right: 40px;
}
