/**
 * Sahel EDD Cart Dropdown
 */

/* ===== کانتینر و لینک هدر ===== */
.top-navigation .sahel-edd-cart {
	position: relative;
}

.top-navigation .sahel-cart-menu-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	position: relative;
	text-decoration: none;
	padding: 8px;
}

.top-navigation .sahel-cart-icon {
	display: block;
	flex-shrink: 0;
	fill: #7f7db9;
}

.top-navigation .sahel-cart-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	border-radius: 50px;
	background: var(--sahel-primary-color, #2563eb);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	box-sizing: border-box;
}

/* ===== پنل کشویی (Dropdown) ===== */
.top-navigation .sahel-cart-dropdown {
	position: absolute;
	top: 100%;
	right: 0;
	z-index: 99999;
	width: 340px;
	max-width: calc(100vw - 24px);
	padding-top: 12px;
	visibility: hidden;
	opacity: 0;
	pointer-events: none;
	transform: translateY(8px);
	transition:
		opacity 0.2s ease,
		transform 0.2s ease,
		visibility 0.2s ease;
}

.top-navigation .sahel-cart-dropdown-inner {
	padding: 16px;
	max-height: 350px;
	overflow-y: auto;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	background: #fff;
	color: #1f2937;
	box-shadow: 0 12px 35px rgba(0, 0, 0, 0.14);
	text-align: right;
	direction: rtl;
}

/* نمایش پنل هنگام هاور یا فوکوس */
.top-navigation .sahel-edd-cart:hover > .sahel-cart-dropdown,
.top-navigation .sahel-edd-cart:focus-within > .sahel-cart-dropdown,
.top-navigation .sahel-edd-cart.is-open > .sahel-cart-dropdown {
	visibility: visible;
	opacity: 1;
	pointer-events: auto;
	transform: translateY(0);
}

/* ===== لیست اقلام سبد (کد PHP سفارشی ما) ===== */
.sahel-cart-dropdown .sahel-cart-items {
	list-style: none;
	margin: 0 0 12px 0;
	padding: 0;
	display: block;
}

.sahel-cart-dropdown .sahel-cart-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	padding: 10px 0;
	border-bottom: 1px solid #f1f1f1;
	font-size: 13px;
	line-height: 1.8;
}

.sahel-cart-dropdown .sahel-cart-item:last-child {
	border-bottom: 0;
}

.sahel-cart-dropdown .sahel-cart-item-title {
	color: #1f2937;
	font-weight: 500;
	flex: 1 1 auto;
	min-width: 0;
	overflow-wrap: anywhere;
}

.sahel-cart-dropdown .sahel-cart-item-price {
	color: #666;
	font-size: 12px;
	font-weight: 700;
	flex-shrink: 0;
	white-space: nowrap;
}

/* ===== جمع کل ===== */
.sahel-cart-dropdown .sahel-cart-total {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 12px 0;
	border-top: 1px solid #eee;
	font-size: 14px;
	font-weight: 700;
	color: #1f2937;
}

.sahel-cart-dropdown .sahel-cart-total span {
	font-weight: 500;
	color: #6b7280;
}

/* ===== دکمه تسویه حساب ===== */
.sahel-cart-dropdown .sahel-cart-actions {
	margin-top: 12px;
}

.sahel-cart-dropdown .sahel-cart-checkout-btn {
	display: block;
	text-align: center;
	background: var(--sahel-primary-color, #2563eb);
	color: #fff !important;
	padding: 11px 15px;
	border-radius: 7px;
	text-decoration: none;
	font-size: 13px;
	font-weight: 700;
	transition: background-color 0.2s ease;
}

.sahel-cart-dropdown .sahel-cart-checkout-btn:hover {
	background: var(--sahel-primary-dark, #1d4ed8);
	color: #fff;
}

/* ===== حالت سبد خالی ===== */
.sahel-cart-dropdown .sahel-cart-empty {
	margin: 0;
	text-align: center;
	color: #777;
	font-size: 13px;
	padding: 10px 0;
	overflow-wrap: anywhere;
}

/* ===== رسپانسیو (موبایل) ===== */
@media (max-width: 767px) {
	.top-navigation .sahel-edd-cart {
		position: static;
	}

	.top-navigation .sahel-cart-dropdown {
		position: absolute;
		top: 100%;
		right: 12px;
		left: 12px;
		width: auto;
		max-width: none;
		padding-top: 8px;
	}

	.top-navigation .sahel-edd-cart.is-cart-open > .sahel-cart-dropdown {
		visibility: visible;
		opacity: 1;
		pointer-events: auto;
		transform: translateY(0);
	}
}
