/* =========================================================
   ماژول: افزودن ایجکسی به سبد خرید
   ========================================================= */

/* دکمه گرید و دکمه صفحه محصول در حالت لودینگ */
.mytheme-add-to-cart.loading,
.single_add_to_cart_button.loading {
	position: relative;
	color: transparent !important;
	pointer-events: none;
	opacity: 0.8;
}

.mytheme-add-to-cart.loading::after,
.single_add_to_cart_button.loading::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 16px;
	height: 16px;
	margin: -8px 0 0 -8px;
	border: 2px solid rgba(255, 255, 255, 0.5);
	border-top-color: #fff;
	border-radius: 50%;
	animation: mytheme-spin 0.6s linear infinite;
}

@keyframes mytheme-spin {
	to { transform: rotate(360deg); }
}

/* حالت موفقیت (کوتاه‌مدت بعد از افزودن) */
.mytheme-add-to-cart.added,
.single_add_to_cart_button.added {
	background-color: var(--color-success) !important;
	border-color: var(--color-success) !important;
	transition: background-color var(--transition), border-color var(--transition);
}

/* پیام خطا */
.mytheme-cart-error {
	margin-top: 8px;
	padding: 8px 12px;
	background: #fdecea;
	color: #b71c1c;
	border: 1px solid #f5c6cb;
	border-radius: var(--radius);
	font-size: 13px;
}

/* آیکون سبد خرید هدر */
.header-cart-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px 6px 5px;
    transition: background-color var(--transition);
    font-size: 14px;
    border: 2px solid #93a254;
    border-radius: 100px;
}
.header-cart-icon:hover { background-color: #f5f5f5; }

.mytheme-cart-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 5px;
    background: var(--color-primary);
    color: #fff;
    font-size: 12px;
    border-radius: 999px;
    line-height: 1;
}

/* =========================================================
   اعلان‌های مدرن ووکامرس در صفحه محصول
   پیام‌های پیش‌فرض ووکامرس به Toast شناور تبدیل می‌شوند.
   ========================================================= */
.single-product .woocommerce-notices-wrapper {
	position: fixed;
	top: calc(var(--header-height) + 18px);
	right: 22px;
	z-index: 99990;
	width: min(410px, calc(100vw - 32px));
	margin: 0 !important;
	pointer-events: none;
}

.single-product .woocommerce-notices-wrapper > .woocommerce-message,
.single-product .woocommerce-notices-wrapper > .woocommerce-error,
.single-product .woocommerce-notices-wrapper > .woocommerce-info,
.single-product .woocommerce-notices-wrapper > ul.woocommerce-message,
.single-product .woocommerce-notices-wrapper > ul.woocommerce-error,
.single-product .woocommerce-notices-wrapper > ul.woocommerce-info {
	margin: 0 0 12px !important;
	padding: 0 !important;
	border: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	list-style: none !important;
	pointer-events: none;
}

.single-product .woocommerce-notices-wrapper .mytheme-toast-item {
position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 68px;
    padding: 15px 16px 15px 16px !important;
    border: 1px solid rgba(0, 0, 0, .07) !important;
    border-radius: 16px !important;
    background: rgba(255, 255, 255, .96) !important;
    box-shadow: 0 16px 42px rgba(25, 30, 20, .13), 0 3px 10px rgba(25, 30, 20, .06) !important;
    color: var(--color-text) !important;
    font-size: 14px;
    line-height: 1.7;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    opacity: 0;
    transform: translate3d(24px, -8px, 0) scale(.97);
    transition: opacity .32s ease, transform .42s cubic-bezier(.2, .8, .2, 1);
    pointer-events: auto;
    overflow: hidden;
}
.single-product .woocommerce-notices-wrapper .mytheme-toast-item .mytheme-toast-item a {
display:none;
}
.single-product .woocommerce-notices-wrapper .mytheme-toast-item.is-visible {
	opacity: 1;
	transform: translate3d(0,0,0) scale(1);
}

.single-product .woocommerce-notices-wrapper .mytheme-toast-item.is-leaving {
	opacity: 0;
	transform: translate3d(24px,-6px,0) scale(.97);
}

.single-product .woocommerce-notices-wrapper .mytheme-toast-item::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	right: 0;
	width: 4px;
	background: var(--color-primary);
}

.single-product .woocommerce-notices-wrapper .mytheme-toast-item::after {
	content: "✓";
	flex: 0 0 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	margin-top: 2px;
	border-radius: 50%;
	background: rgba(147,162,84,.12);
	color: var(--color-primary);
	font-size: 17px;
	font-weight: 700;
	display:none;
}

.single-product .woocommerce-notices-wrapper .mytheme-toast-item.is-error::before {
	background: #d94a4a;
}

.single-product .woocommerce-notices-wrapper .mytheme-toast-item.is-error::after {
	content: "!";
	background: rgba(217,74,74,.11);
	color: #d94a4a;
}

.single-product .woocommerce-notices-wrapper .mytheme-toast-item.is-info::before {
	background: var(--color-primary-dark);
}

.single-product .woocommerce-notices-wrapper .mytheme-toast-item.is-info::after {
	content: "i";
	background: rgba(249,137,56,.11);
	color: var(--color-primary-dark);
	font-family: Arial, sans-serif;
}

.single-product .woocommerce-notices-wrapper .mytheme-toast-item .mytheme-toast-content {
	flex: 1 1 auto;
	min-width: 0;
	padding-top: 1px;
}

.single-product .woocommerce-notices-wrapper .mytheme-toast-item a {
	color: var(--color-primary-dark) !important;
	font-weight: 700;
	text-decoration: none;
	display:none;
}

.single-product .woocommerce-notices-wrapper .mytheme-toast-close {
position: absolute;
    top: 18px;
    left: 12px;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #777;
    font: 400 21px / 30px Arial, sans-serif;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, transform .2s ease;
    background: red;
    color: #fff;
}

.single-product .woocommerce-notices-wrapper .mytheme-toast-close:hover {
	background: #f3f3f3;
	color: #222;
	transform: rotate(90deg);
}

@media (max-width: 600px) {
	.single-product .woocommerce-notices-wrapper {
		top: 74px;
		right: 12px;
		width: calc(100vw - 24px);
	}
.mytheme-mini-cart-panel {
    max-width: 320px !important;
}
	.single-product .woocommerce-notices-wrapper .mytheme-toast-item {
		padding: 13px 44px 13px 13px !important;
		border-radius: 14px !important;
		font-size: 13px;
	}
		.header-cart-icon {
    border: 1px solid #93a2545e;
}
.mytheme-cart-count {
    min-width: 20px;
    height: 20px;
}
}

@media (prefers-reduced-motion: reduce) {
	.single-product .woocommerce-notices-wrapper .mytheme-toast-item {
		transition: opacity .15s ease;
		transform: none;
	}
}

