/* =========================================================
   Mr Amniat - Header Icons + Off-canvas Panels
   ========================================================= */

.mae-header-icons-widget {
	display: contents;
}

/* ---------- Icon row ---------- */
.mae-header-icons {
	display: flex;
	align-items: center;
	gap: 18px;
	direction: ltr; /* ترتیب فیزیکی ثابت: سبد خرید - علاقه‌مندی - حساب کاربری، مستقل از rtl صفحه */
}

.mae-icon-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: none;
	padding: 4px;
	cursor: pointer;
	color: #3A3F4B;
	line-height: 0;
}

.mae-icon-btn svg {
	width: 22px;
	height: 22px;
	stroke: currentColor;
	transition: color 0.2s ease;
}

.mae-icon-btn i {
	font-size: 20px;
	transition: color 0.2s ease;
}

.mae-icon-btn:hover svg,
.mae-icon-btn:hover i {
	color: #14B8A6;
}

.mae-badge {
	position: absolute;
	top: -6px;
	left: -8px;
	min-width: 18px;
	height: 18px;
	padding: 0 4px;
	border-radius: 9px;
	background-color: #14B8A6;
	color: #FFFFFF;
	font-size: 11px;
	font-weight: 600;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

/* ---------- Overlay ---------- */
.mae-overlay {
	position: fixed;
	inset: 0;
	background-color: rgba(15, 23, 42, 0.55);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
	z-index: 99998;
}

.mae-overlay.mae-open {
	opacity: 1;
	visibility: visible;
}

/* ---------- Panel base ---------- */
.mae-panel {
	--mae-panel-width: 440px;
	position: fixed;
	top: 16px;
	bottom: 16px;
	left: 16px;
	width: var(--mae-panel-width);
	max-width: calc(100vw - 32px);
	background-color: #FFFFFF;
	border-radius: 20px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transform: translateX(-120%);
	transition: transform 0.35s ease;
	z-index: 99999;
	direction: rtl;
}

.mae-panel.mae-open {
	transform: translateX(0);
}

/* ---------- Panel header ---------- */
.mae-panel-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	direction: ltr; /* بستن همیشه چپ، عنوان همیشه راست - مستقل از rtl */
	padding: 18px 22px;
	border-bottom: 1px solid #EEF0F3;
	flex: 0 0 auto;
}

.mae-panel-close {
	background: none;
	border: none;
	cursor: pointer;
	color: #6B7280;
	display: inline-flex;
	padding: 4px;
}

.mae-panel-close svg {
	width: 20px;
	height: 20px;
}

.mae-panel-title {
	display: flex;
	align-items: center;
	gap: 10px;
	direction: ltr;
	font-size: 16px;
	font-weight: 700;
	color: #1A1D29;
}

.mae-panel-title-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 8px;
	background-color: #14B8A6;
}

.mae-panel-title-icon svg {
	width: 16px;
	height: 16px;
}

/* ---------- Panel body ---------- */
.mae-panel-body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 18px 22px;
	direction: rtl;
}

/* ---------- Buttons ---------- */
.mae-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 13px 16px;
	border-radius: 12px;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	box-sizing: border-box;
	border: 1px solid transparent;
}

.mae-btn svg {
	width: 16px;
	height: 16px;
}

.mae-btn-primary {
	background-color: #16213E;
	color: #FFFFFF;
}

.mae-btn-primary:hover {
	opacity: 0.92;
}

.mae-btn-outline,
.mae-btn-outline.mae-btn {
	background-color: transparent;
	border: 1px solid #14B8A6;
	color: #14B8A6;
}

.mae-cart-actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 16px;
}

/* ---------- Cart: trust badge + count line ---------- */
.mae-cart-trust-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	font-weight: 600;
	color: #14B8A6;
	background-color: #ECFDF8;
	padding: 8px 12px;
	border-radius: 10px;
	margin-bottom: 12px;
}

.mae-cart-trust-badge svg {
	width: 16px;
	height: 16px;
}

.mae-cart-count-line {
	font-size: 13px;
	color: #6B7280;
	margin-bottom: 14px;
}

/* ---------- Cart items ---------- */
.mae-cart-items {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.mae-cart-item {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding-bottom: 14px;
	border-bottom: 1px solid #F1F2F5;
	direction: ltr; /* تصویر همیشه چپ‌ترین، دکمه حذف همیشه راست‌ترین */
}

.mae-cart-item:last-child {
	border-bottom: none;
}

.mae-cart-item-thumb {
	order: 1;
	flex: 0 0 auto;
	width: 64px;
	height: 64px;
	border: 1.5px solid #B9E4DD;
	border-radius: 10px;
	overflow: hidden;
}

.mae-cart-item-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.mae-cart-item-info {
	order: 2;
	flex: 1 1 auto;
	min-width: 0;
	direction: rtl;
	text-align: right;
}

.mae-cart-item-remove {
	order: 3;
	flex: 0 0 auto;
	background: none;
	border: none;
	color: #A3A8B3;
	cursor: pointer;
	padding: 2px;
}

.mae-cart-item-remove svg {
	width: 16px;
	height: 16px;
}

.mae-cart-item-title {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: #1A1D29;
	text-decoration: none;
	margin-bottom: 4px;
}

.mae-cart-item-meta {
	font-size: 11.5px;
	color: #8A8F99;
	margin-bottom: 4px;
}

.mae-cart-item-price {
	font-size: 13px;
	font-weight: 700;
	color: #14B8A6;
	margin-bottom: 8px;
}

.mae-qty-stepper {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	border: 1px solid #14B8A6;
	border-radius: 20px;
	padding: 4px 10px;
	width: fit-content;
}

.mae-qty-stepper button {
	background: none;
	border: none;
	cursor: pointer;
	font-size: 15px;
	line-height: 1;
	color: #14B8A6;
	width: 16px;
}

.mae-qty-stepper button:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.mae-qty-value {
	font-size: 13px;
	font-weight: 600;
	min-width: 14px;
	text-align: center;
	color: #1A1D29;
}

/* ---------- Empty cart ---------- */
.mae-cart-empty {
	text-align: center;
	padding: 40px 10px;
	color: #6B7280;
}

.mae-cart-empty svg {
	width: 48px;
	height: 48px;
	margin-bottom: 12px;
	color: #C9CDD4;
}

.mae-cart-empty p {
	margin: 0 0 16px;
	font-size: 14px;
}

/* ---------- Shipping note ---------- */
.mae-cart-shipping-note {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12.5px;
	color: #6B7280;
	background-color: #F7F8FA;
	border-radius: 10px;
	padding: 10px 12px;
	margin: 16px 0;
}

.mae-cart-shipping-note svg {
	width: 18px;
	height: 18px;
	flex: 0 0 auto;
}

.mae-cart-shipping-active {
	color: #14B8A6;
	background-color: #ECFDF8;
}

/* ---------- Coupon ---------- */
.mae-cart-coupon {
	border-top: 1px solid #F1F2F5;
	border-bottom: 1px solid #F1F2F5;
	padding: 12px 0;
	margin: 6px 0 16px;
}

.mae-coupon-toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	background: none;
	border: none;
	cursor: pointer;
	font-size: 13.5px;
	font-weight: 600;
	color: #1A1D29;
	padding: 0;
}

.mae-coupon-toggle svg {
	width: 16px;
	height: 16px;
	color: #6B7280;
	transition: transform 0.2s ease;
}

.mae-cart-coupon.mae-open .mae-coupon-toggle svg {
	transform: rotate(180deg);
}

.mae-coupon-body {
	display: none;
	align-items: center;
	gap: 8px;
	margin-top: 12px;
	direction: ltr;
}

.mae-cart-coupon.mae-open .mae-coupon-body {
	display: flex;
}

.mae-coupon-input {
	flex: 1 1 auto;
	border: 1px solid #E3E5E9;
	border-radius: 10px;
	padding: 10px 12px;
	font-size: 13px;
	direction: rtl;
	text-align: right;
}

.mae-coupon-apply {
	flex: 0 0 auto;
	border-radius: 10px;
	padding: 10px 18px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	background: transparent;
}

.mae-coupon-message {
	margin-top: 8px;
	font-size: 12px;
}

.mae-coupon-message.mae-error { color: #D9534F; }
.mae-coupon-message.mae-success { color: #14B8A6; }

/* ---------- Totals ---------- */
.mae-cart-totals {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 16px;
}

.mae-totals-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 13.5px;
	color: #6B7280;
}

.mae-totals-value {
	font-weight: 600;
	color: #1A1D29;
}

.mae-totals-final {
	padding-top: 10px;
	border-top: 1px solid #F1F2F5;
	font-size: 15px;
	font-weight: 700;
}

.mae-totals-final .mae-totals-label {
	color: #1A1D29;
	font-weight: 700;
}

.mae-totals-final .mae-totals-value {
	color: #16213E;
	font-size: 17px;
}

/* =========================================================
   حساب کاربری
   ========================================================= */
.mae-account-profile {
	display: flex;
	align-items: center;
	gap: 12px;
	padding-bottom: 18px;
	margin-bottom: 12px;
	border-bottom: 1px solid #F1F2F5;
}

.mae-account-avatar img {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	display: block;
}

.mae-account-name {
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.mae-account-name strong {
	font-size: 14.5px;
	color: #16213E;
}

.mae-account-name span {
	font-size: 12px;
	color: #8A8F99;
}

.mae-account-menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
}

.mae-account-menu-item a {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 13px 4px;
	text-decoration: none;
	color: #1A1D29;
	font-size: 14px;
	border-bottom: 1px solid #F5F6F8;
	transition: color 0.2s ease;
}

.mae-account-menu-item:last-child a {
	border-bottom: none;
}

.mae-account-menu-item a:hover {
	color: #14B8A6;
}

.mae-account-menu-item svg {
	width: 19px;
	height: 19px;
	flex: 0 0 auto;
	color: #6B7280;
}

.mae-account-menu-item a:hover svg {
	color: #14B8A6;
}

.mae-account-menu-item span {
	flex: 1 1 auto;
}

.mae-menu-arrow {
	width: 14px !important;
	height: 14px !important;
	color: #C9CDD4 !important;
}

.mae-endpoint-customer-logout a {
	color: #D9534F;
}

.mae-endpoint-customer-logout svg {
	color: #D9534F !important;
}

/* ---------- Login / Register (native WooCommerce form) ---------- */
.mae-account-auth .woocommerce-form-login,
.mae-account-auth .woocommerce-form-register {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.mae-account-auth .woocommerce-form-row label {
	display: block;
	font-size: 13px;
	color: #1A1D29;
	margin-bottom: 6px;
}

.mae-account-auth input[type="text"],
.mae-account-auth input[type="password"],
.mae-account-auth input[type="email"] {
	width: 100%;
	border: 1px solid #E3E5E9;
	border-radius: 10px;
	padding: 11px 14px;
	font-size: 13.5px;
	box-sizing: border-box;
	direction: rtl;
}

.mae-account-auth button[type="submit"] {
	background-color: #16213E;
	color: #FFFFFF;
	border: none;
	border-radius: 12px;
	padding: 13px 16px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	width: 100%;
}

.mae-account-auth .woocommerce-LostPassword {
	font-size: 12.5px;
	text-align: center;
}

.mae-account-auth .woocommerce-LostPassword a,
.mae-account-auth a {
	color: #14B8A6;
}

.mae-account-auth .u-column1,
.mae-account-auth .u-column2 {
	width: 100%;
	float: none;
}

.mae-account-auth p.form-row.create-account {
	margin-top: 10px;
}

/* =========================================================
   علاقه‌مندی‌ها (YITH restyle)
   ========================================================= */
.mae-wishlist-shortcode-wrap table.shop_table_responsive {
	width: 100%;
	border: none;
}

.mae-wishlist-shortcode-wrap table.shop_table_responsive thead {
	display: none;
}

.mae-wishlist-shortcode-wrap table.shop_table_responsive tr {
	display: flex;
	align-items: center;
	gap: 12px;
	border-bottom: 1px solid #F1F2F5;
	padding: 12px 0;
}

.mae-wishlist-shortcode-wrap table.shop_table_responsive td {
	border: none;
	padding: 0;
}

.mae-wishlist-shortcode-wrap td.product-thumbnail img {
	width: 60px;
	height: 60px;
	object-fit: cover;
	border: 1.5px solid #B9E4DD;
	border-radius: 10px;
}

.mae-wishlist-shortcode-wrap td.product-name a {
	font-size: 13px;
	font-weight: 600;
	color: #1A1D29;
	text-decoration: none;
}

.mae-wishlist-shortcode-wrap td.product-price del {
	display: none;
}

.mae-wishlist-shortcode-wrap td.product-price,
.mae-wishlist-shortcode-wrap .price {
	color: #14B8A6;
	font-weight: 700;
	font-size: 13px;
}

.mae-wishlist-shortcode-wrap td.product-add-to-cart a.button,
.mae-wishlist-shortcode-wrap a.add_to_cart_button {
	background-color: #16213E;
	color: #fff;
	border-radius: 10px;
	padding: 8px 14px;
	font-size: 12px;
	text-decoration: none;
	white-space: nowrap;
}

.mae-wishlist-shortcode-wrap td.product-remove {
	order: 99;
}

.mae-wishlist-shortcode-wrap a.remove_from_wishlist {
	color: #A3A8B3;
	font-size: 18px;
	text-decoration: none;
}

.mae-wishlist-missing,
.mae-wishlist-login-required {
	text-align: center;
	padding: 30px 10px;
	color: #6B7280;
	font-size: 13.5px;
}

/* =========================================================
   موبایل
   ========================================================= */
@media (max-width: 480px) {
	.mae-panel {
		left: 8px;
		right: 8px;
		top: 8px;
		bottom: 8px;
		width: auto;
		max-width: none;
	}
}

.mae-hide-trust-badge .mae-cart-trust-badge {
	display: none;
}

body.mae-panel-active {
	overflow: hidden;
}
