/* ==========================================================================
   OMAR POPUP  —  scoped & hardened against theme bleed
   ========================================================================== */
#omar-popup-root {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
	--omar-popup-primary: #1f2937;
	--omar-popup-accent: #2563eb;
	--omar-popup-text: #1f2937;
	--omar-popup-btn-text: #ffffff;
	--omar-popup-btn-radius: 8px;
	--omar-popup-line: #ececec;
	font-size: 14px;
	line-height: 1.5;
}
#omar-popup-root.is-open {
	display: block;
}
#omar-popup-root *,
#omar-popup-root *::before,
#omar-popup-root *::after {
	box-sizing: border-box;
}

/* ---- overlay ---- */
.omar-popup__overlay {
	position: absolute;
	inset: 0;
	background: rgba(17, 24, 39, 0.55);
	opacity: 0;
	transition: opacity 0.2s ease;
}
#omar-popup-root.is-open .omar-popup__overlay {
	opacity: 1;
}
#omar-popup-root.omar-popup--no-overlay .omar-popup__overlay {
	background: transparent;
}

/* ---- box ---- */
.omar-popup__box {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%) scale(0.97);
	width: min(620px, calc(100vw - 24px));
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	background: #fff;
	color: var(--omar-popup-text);
	border-radius: 12px;
	box-shadow: 0 24px 70px rgba(17, 24, 39, 0.35);
	padding: 40px 36px 32px;
	opacity: 0;
	transition: opacity 0.2s ease, transform 0.2s ease;
	text-align: start;
}
#omar-popup-root.is-open .omar-popup__box {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1);
}
#omar-popup-root.omar-popup--top .omar-popup__box {
	top: 28px;
	transform: translate(-50%, -12px) scale(0.97);
}
#omar-popup-root.omar-popup--top.is-open .omar-popup__box {
	transform: translate(-50%, 0) scale(1);
}
#omar-popup-root.omar-popup--bottom-right .omar-popup__box {
	left: auto;
	right: 24px;
	top: auto;
	bottom: 24px;
	width: min(400px, calc(100vw - 24px));
	transform: translateY(20px) scale(0.98);
}
#omar-popup-root.omar-popup--bottom-right.is-open .omar-popup__box {
	transform: translateY(0) scale(1);
}

/* ---- close ---- */
#omar-popup-root .omar-popup__close {
	position: absolute;
	top: 8px;
	inset-inline-end: 12px;
	width: 32px !important;
	min-width: 0 !important;
	height: 32px !important;
	border: 0 !important;
	background: none !important;
	box-shadow: none !important;
	font-size: 24px !important;
	line-height: 1 !important;
	color: #9ca3af !important;
	cursor: pointer;
	padding: 0 !important;
	margin: 0 !important;
}
#omar-popup-root .omar-popup__close:hover {
	color: #111827;
}

/* ---- success banner ---- */
.omar-popup__banner {
	display: flex;
	align-items: center;
	gap: 10px;
	background: var(--omar-popup-banner-bg, #e7f6ec);
	color: var(--omar-popup-banner-text, #1e5631);
	border-radius: 10px;
	padding: 16px 18px;
	font-weight: 600;
	font-size: 15px;
	margin-bottom: 22px;
}
.omar-popup__check {
	flex: 0 0 22px;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--omar-popup-banner-text, #1e5631);
	color: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
}
.omar-popup__banner-text {
	color: var(--omar-popup-banner-text, #1e5631);
}

/* ---- "Your cart" heading ---- */
.omar-popup__cart-heading {
	text-align: center;
	margin: 0 0 6px;
	overflow: hidden;
}
.omar-popup__cart-heading span {
	display: inline-block;
	position: relative;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: 0.01em;
	padding: 0 16px;
}
.omar-popup__cart-heading span::before,
.omar-popup__cart-heading span::after {
	content: "";
	position: absolute;
	top: 50%;
	width: 100vw;
	height: 1px;
	background: var(--omar-popup-line);
}
.omar-popup__cart-heading span::before {
	inset-inline-end: 100%;
}
.omar-popup__cart-heading span::after {
	inset-inline-start: 100%;
}

/* ---- cart lines ---- */
.omar-popup__lines {
	transition: opacity 0.15s ease;
}
.omar-popup__lines.is-busy {
	opacity: 0.45;
	pointer-events: none;
}
.omar-popup__line {
	display: grid;
	grid-template-columns: 56px minmax(0, 1fr) auto auto;
	align-items: center;
	column-gap: 14px;
	padding: 14px 0;
	border-bottom: 1px solid var(--omar-popup-line);
}
.omar-popup__line--single {
	grid-template-columns: 56px minmax(0, 1fr);
}
.omar-popup__line-thumb {
	width: 56px;
}
.omar-popup__line-thumb img {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 6px;
}
.omar-popup__line-info {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}
#omar-popup-root .omar-popup__line-name {
	font-weight: 600;
	font-size: 13.5px;
	color: var(--omar-popup-text);
	text-decoration: none;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	margin: 0 !important;
	padding: 0 !important;
}
#omar-popup-root a.omar-popup__line-name:hover {
	text-decoration: underline;
}
.omar-popup__line-sku {
	font-size: 11.5px;
	color: #9ca3af;
}
.omar-popup__line-unit {
	font-size: 12.5px;
	color: #6b7280;
}
.omar-popup__line-sub {
	font-weight: 700;
	font-size: 13.5px;
	white-space: nowrap;
	text-align: end;
}
.omar-popup__line-qtytext {
	color: #6b7280;
	white-space: nowrap;
}

/* ---- quantity stepper (fully controlled) ---- */
.omar-popup__stepper {
	display: inline-flex;
	align-items: center;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
}
#omar-popup-root .omar-popup__step {
	box-sizing: border-box;
	appearance: none !important;
	-webkit-appearance: none !important;
	flex: 0 0 30px !important;
	width: 30px !important;
	min-width: 30px !important;
	max-width: 30px !important;
	height: 32px !important;
	padding: 0 !important;
	margin: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: #f9fafb !important;
	color: #374151 !important;
	font-size: 15px !important;
	font-weight: 600 !important;
	line-height: 1 !important;
	text-align: center !important;
	cursor: pointer !important;
	box-shadow: none !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
}
#omar-popup-root .omar-popup__step:hover {
	background: #f3f4f6 !important;
}
#omar-popup-root .omar-popup__step-input {
	box-sizing: border-box;
	appearance: none !important;
	-webkit-appearance: none !important;
	flex: 0 0 40px !important;
	width: 40px !important;
	min-width: 40px !important;
	max-width: 40px !important;
	height: 32px !important;
	padding: 0 !important;
	margin: 0 !important;
	border: 0 !important;
	border-inline: 1px solid #e5e7eb !important;
	border-radius: 0 !important;
	background: #fff !important;
	color: #111827 !important;
	font-size: 13px !important;
	line-height: 32px !important;
	text-align: center !important;
	box-shadow: none !important;
	-moz-appearance: textfield;
}
#omar-popup-root .omar-popup__step-input::-webkit-outer-spin-button,
#omar-popup-root .omar-popup__step-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* ---- total ---- */
.omar-popup__total {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	padding: 16px 2px 4px;
	font-weight: 700;
	font-size: 15px;
}
.omar-popup__total-amount {
	color: var(--omar-popup-accent);
}

/* ---- action buttons ---- */
.omar-popup__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	margin-top: 22px;
}
/* Custom style: only when the theme "button" class is NOT present */
#omar-popup-root .omar-popup__btn:not(.button) {
	box-sizing: border-box;
	appearance: none !important;
	-webkit-appearance: none !important;
	display: inline-block !important;
	flex: 0 1 auto;
	width: auto !important;
	min-width: 150px;
	height: auto !important;
	padding: 12px 22px !important;
	border: 1.5px solid var(--omar-popup-primary) !important;
	border-radius: var(--omar-popup-btn-radius) !important;
	background: var(--omar-popup-primary) !important;
	color: var(--omar-popup-btn-text) !important;
	font-size: 13.5px !important;
	font-weight: 600 !important;
	line-height: 1.2 !important;
	text-align: center !important;
	text-decoration: none !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	cursor: pointer;
	box-shadow: none !important;
	margin: 0 !important;
	transition: opacity 0.15s ease;
}
#omar-popup-root .omar-popup__btn:not(.button):hover {
	opacity: 0.88;
	color: var(--omar-popup-btn-text) !important;
}
#omar-popup-root .omar-popup__btn--ghost:not(.button) {
	background: #fff !important;
	color: var(--omar-popup-primary) !important;
}
#omar-popup-root .omar-popup__btn--primary:not(.button) {
	background: var(--omar-popup-accent) !important;
	border-color: var(--omar-popup-accent) !important;
	color: #fff !important;
}
/* Theme style: keep the theme's paint, just normalise spacing */
#omar-popup-root .omar-popup__btn.button {
	margin: 0;
	flex: 0 1 auto;
}

/* ---- cross-sells ---- */
.omar-popup__crosssells {
	margin-top: 22px;
	border-top: 1px solid var(--omar-popup-line);
	padding-top: 16px;
}
.omar-popup__crosssells-title {
	margin: 0 0 12px;
	font-weight: 700;
	text-align: center;
	font-size: 14px;
}
.omar-popup__crosssells-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 12px;
}
.omar-popup__crosssell {
	font-size: 11.5px;
	text-align: center;
}
#omar-popup-root .omar-popup__crosssell a {
	display: block;
	text-decoration: none;
	color: inherit;
}
.omar-popup__crosssell img {
	width: 100%;
	height: auto;
	border-radius: 6px;
	margin-bottom: 6px;
}
.omar-popup__crosssell-name {
	display: block;
	font-weight: 600;
}
.omar-popup__crosssell-price {
	display: block;
	color: #6b7280;
	margin-bottom: 6px;
}
#omar-popup-root .omar-popup__crosssell .button {
	font-size: 11px;
	padding: 5px 9px;
}

/* ---- RTL ---- */
#omar-popup-root[dir="rtl"] .omar-popup__line-name,
#omar-popup-root[dir="rtl"] .omar-popup__line-sku,
#omar-popup-root[dir="rtl"] .omar-popup__line-unit {
	text-align: right;
}
#omar-popup-root[dir="rtl"] .omar-popup__stepper {
	flex-direction: row-reverse;
}

/* ---- responsive ---- */
@media (max-width: 560px) {
	.omar-popup__box {
		padding: 32px 16px 24px;
		border-radius: 10px;
	}
	.omar-popup__line {
		grid-template-columns: 48px minmax(0, 1fr) auto;
		row-gap: 8px;
	}
	.omar-popup__line-thumb {
		width: 48px;
	}
	.omar-popup__line-sub {
		grid-column: 2 / 4;
		text-align: start;
	}
	.omar-popup__crosssells-list {
		grid-template-columns: repeat(2, 1fr);
	}
	.omar-popup__actions {
		flex-direction: column;
	}
	#omar-popup-root .omar-popup__btn {
		width: 100%;
	}
}
