/* =========================================================
   Nexora — درج السلة المنزلق (بأسلوب الصفحة الرئيسية)
   ========================================================= */
.nx-drawer[hidden] { display: none !important; }

.nx-drawer { position: fixed; inset: 0; z-index: 1000; }

.nx-drawer__overlay {
	position: absolute;
	inset: 0;
	background: rgba(20, 19, 25, .38);
	backdrop-filter: blur(2px);
	opacity: 0;
	transition: opacity .3s ease;
	cursor: pointer;
}

.nx-drawer__panel {
	position: absolute;
	inset-block: 0;
	left: 0;
	width: min(430px, 92vw);
	background: var(--surface);
	border-radius: 0 28px 28px 0;
	box-shadow: var(--shadow-lg);
	display: flex;
	flex-direction: column;
	transform: translateX(-102%);
	transition: transform .36s cubic-bezier(.2, .7, .2, 1);
	will-change: transform;
	overflow: hidden;
}

.nx-drawer.is-open .nx-drawer__overlay { opacity: 1; }
.nx-drawer.is-open .nx-drawer__panel { transform: translateX(0); }

/* ---- الرأس ---- */
.nx-drawer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 22px 24px;
	border-bottom: 1px solid var(--line);
}
.nx-drawer__title {
	display: flex;
	align-items: center;
	gap: 10px;
	font-family: var(--font-head);
	font-weight: 700;
	font-size: 18px;
	color: var(--ink);
}
.nx-tick {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--good);
	color: #fff;
	display: grid;
	place-items: center;
	flex: none;
	transform: scale(0);
	transition: transform .34s cubic-bezier(.2, 1.6, .4, 1);
}
.nx-tick svg { width: 14px; height: 14px; stroke-dasharray: 24; stroke-dashoffset: 24; }
.nx-drawer.is-added .nx-tick { transform: scale(1); }
.nx-drawer.is-added .nx-tick svg { animation: nx-draw .42s ease .14s forwards; }
@keyframes nx-draw { to { stroke-dashoffset: 0; } }

.nx-drawer__close {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 1px solid var(--line);
	background: var(--surface);
	color: var(--ink-soft);
	display: grid;
	place-items: center;
	cursor: pointer;
	flex: none;
	transition: border-color .15s, color .15s;
}
.nx-drawer__close:hover { border-color: var(--accent); color: var(--accent); }

/* ---- الجسم ---- */
.nx-drawer__body { flex: 1; overflow-y: auto; padding: 6px 24px; }

.nx-drawer .woocommerce-mini-cart { margin: 0; padding: 0; list-style: none; }

.nx-drawer .woocommerce-mini-cart-item {
	display: grid;
	grid-template-columns: 72px 1fr auto;
	gap: 14px;
	align-items: start;
	padding: 18px 0;
	border-bottom: 1px solid var(--line);
}
.nx-drawer .woocommerce-mini-cart-item img {
	grid-row: span 2;
	width: 72px !important;
	height: 72px;
	object-fit: contain;
	background: var(--surface-muted);
	border: 1px solid var(--line);
	border-radius: 16px;
	padding: 8px;
	margin: 0 !important;
	float: none !important;
}
.nx-drawer .woocommerce-mini-cart-item a:not(.remove) {
	font-family: var(--font-head);
	font-weight: 700;
	font-size: 14px;
	color: var(--ink);
	line-height: 1.45;
	display: block;
}
.nx-drawer .woocommerce-mini-cart-item a:not(.remove):hover { color: var(--accent); }
.nx-drawer .woocommerce-mini-cart-item .quantity {
	grid-column: 2;
	font-family: var(--font-head);
	font-weight: 700;
	font-size: 13px;
	color: var(--ink-soft);
}
.nx-drawer .woocommerce-mini-cart-item .quantity .amount { color: var(--ink); }
.nx-drawer .woocommerce-mini-cart-item a.remove {
	grid-column: 3;
	grid-row: 1;
	width: 26px;
	height: 26px;
	display: grid;
	place-items: center;
	border: 1px solid var(--line);
	border-radius: 50%;
	color: var(--ink-soft) !important;
	font-size: 15px;
	line-height: 1;
	text-decoration: none;
	transition: border-color .15s, color .15s;
}
.nx-drawer .woocommerce-mini-cart-item a.remove:hover {
	border-color: #E23D3D;
	color: #E23D3D !important;
	background: transparent;
}

.nx-drawer .woocommerce-mini-cart__empty-message {
	padding: 64px 0;
	text-align: center;
	color: var(--ink-soft);
	font-size: 14.5px;
}
.nx-drawer .woocommerce-mini-cart__total {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	padding: 18px 0 6px;
	margin: 0;
	border: 0;
	font-size: 14px;
	color: var(--ink-soft);
}
.nx-drawer .woocommerce-mini-cart__total strong { font-family: var(--font-head); color: var(--ink); font-weight: 700; }
.nx-drawer .woocommerce-mini-cart__total .amount {
	font-family: var(--font-head);
	font-weight: 700;
	font-size: 19px;
	color: var(--ink);
}
.nx-drawer .woocommerce-mini-cart__buttons { display: none !important; }

/* ---- التذييل ---- */
.nx-drawer__foot {
	border-top: 1px solid var(--line);
	padding: 18px 24px 22px;
	display: grid;
	gap: 10px;
	background: var(--bg);
}
.nx-drawer__foot.is-empty { display: none; }
.nx-block {
	width: 100%;
	justify-content: center;
	padding-block: 14px;
	font-size: 15px;
	font-family: var(--font-head);
	font-weight: 700;
}
.nx-drawer__keep {
	background: none;
	border: 0;
	cursor: pointer;
	padding: 6px;
	font-family: var(--font-body);
	font-size: 13.5px;
	color: var(--ink-soft);
}
.nx-drawer__keep:hover { color: var(--accent); }

/* ---- زر السلة في الهيدر ---- */
.cart-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 1px solid var(--line);
	background: var(--surface);
	color: var(--ink);
	cursor: pointer;
	flex: none;
	transition: border-color .15s, color .15s;
}
.cart-btn:hover { border-color: var(--accent); color: var(--accent); }
.cart-btn svg { width: 17px; height: 17px; }
.cart-btn .cart-count {
	position: absolute;
	top: -4px;
	inset-inline-start: -4px;
	min-width: 19px;
	height: 19px;
	padding: 0 5px;
	border-radius: var(--radius-pill);
	background: var(--accent);
	color: #fff;
	font-family: var(--font-head);
	font-weight: 700;
	font-size: 11px;
	line-height: 19px;
	text-align: center;
}
.cart-btn .cart-count.is-zero { display: none; }

@media (max-width: 760px) {
	.nx-drawer__panel { width: 100%; border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) {
	.nx-drawer__overlay,
	.nx-drawer__panel,
	.nx-tick,
	.nx-tick svg { transition: none !important; animation: none !important; }
	.nx-drawer.is-open .nx-drawer__panel { transform: translateX(0); }
}
