/* حرکت نرم: ورود صفحه، ورود پلکانی کارت‌ها، نوار پیشرفت، اسکلت بارگذاری. همه زیر .wsw-shop. */
.wsw-shop { --wsw-ease: cubic-bezier(.22, 1, .36, 1); }
@media (min-width: 901px) { html:has(.wsw-shop) { scrollbar-gutter: stable; } }
html:has(.wsw-shop) { overscroll-behavior-y: none; }

@keyframes wsw-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes wsw-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@keyframes wsw-flash { 0% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--wsw-primary) 40%, transparent); } 100% { box-shadow: 0 0 0 0 transparent; } }

/* فقط وقتی JS آماده است مخفی می‌کنیم تا بدون JS محتوا هیچ‌وقت پنهان نماند */
/* ورود پلکانی و محو شدن محتوا برداشته شد: متن‌ها یک لحظه کمرنگ دیده می‌شد و صفحه کند به نظر می‌رسید. محتوا همیشه کامل و فوری نمایش داده می‌شود. */

.wsw-shop .wsw-flash { animation: wsw-flash .9s ease-out; }

.wsw-shop .wsw-skeleton { display: block; height: 14px; border-radius: 7px; background: linear-gradient(90deg, var(--wsw-line, #e5e7eb) 25%, color-mix(in srgb, var(--wsw-line, #e5e7eb) 40%, var(--wsw-surface, #fff)) 50%, var(--wsw-line, #e5e7eb) 75%); background-size: 200% 100%; animation: wsw-shimmer 1.2s linear infinite; }

/* نوار پیشرفت بالای صفحه (در body، پس مستقل از .wsw-shop) */
body #wsw-bar { position: fixed; top: 0; inset-inline: 0; height: 3px; width: 0; z-index: 99999; pointer-events: none; opacity: 0; background: linear-gradient(90deg, var(--wsw-primary, #2563eb), color-mix(in srgb, var(--wsw-primary, #2563eb) 55%, #fff)); box-shadow: 0 0 8px color-mix(in srgb, var(--wsw-primary, #2563eb) 60%, transparent); transition: width .6s cubic-bezier(.22, 1, .36, 1), opacity .25s ease; }
body #wsw-bar.is-on { opacity: 1; width: 78%; }
body #wsw-bar.is-done { opacity: 0; width: 100%; transition: width .2s ease, opacity .35s ease .15s; }

.wsw-shop button:not(:disabled):active, .wsw-shop a.wsw-btn:active { transform: scale(.98); }
.wsw-shop .wsw-btn, .wsw-shop .wsw-card, .wsw-shop .wsw-addr, .wsw-shop .wsw-rate { transition: transform .18s var(--wsw-ease), box-shadow .2s ease, border-color .15s ease, background-color .15s ease; }

@media (prefers-reduced-motion: reduce) {
	.wsw-shop *, .wsw-shop *::before, .wsw-shop *::after { animation: none !important; transition: none !important; }
	.wsw-js .wsw-shop [data-wsw-rise] { opacity: 1; }
	body #wsw-bar { display: none; }
}

/* ---------- لمس: حس نرم و فوری ---------- */
html:has(.wsw-shop) { scroll-behavior: smooth; }
.wsw-shop .wsw-days, .wsw-shop .wsw-sidebar__links, .wsw-shop .wsw-modal__box, .wsw-shop .wsw-tabs { -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.wsw-shop .wsw-order, .wsw-shop .wsw-cart__item { content-visibility: auto; contain-intrinsic-size: auto 140px; }

/* بازخورد فوری فشردن (جایگزین hover روی لمسی‌ها) */
.wsw-shop .wsw-btn, .wsw-shop .wsw-qty__btn, .wsw-shop .wsw-iconbtn, .wsw-shop .wsw-navlink, .wsw-shop .wsw-bottomnav__link, .wsw-shop .wsw-addr, .wsw-shop .wsw-rate, .wsw-shop .wsw-tile, .wsw-shop .wsw-chip-btn,
.wsw-shop .woocommerce-checkout-payment li.wc_payment_method, body.wsw-canvas .wsw-canvas__navlink { transition: transform .12s var(--wsw-ease), background-color .15s ease, box-shadow .2s ease, border-color .15s ease, opacity .15s ease; }
.wsw-shop .wsw-btn:active, .wsw-shop .wsw-qty__btn:active, .wsw-shop .wsw-iconbtn:active { transform: scale(.95); }
.wsw-shop .wsw-addr:active, .wsw-shop .wsw-rate:active, .wsw-shop .wsw-tile:active, .wsw-shop .wsw-chip-btn:active, .wsw-shop .woocommerce-checkout-payment li.wc_payment_method:active { transform: scale(.985); }
.wsw-shop .wsw-navlink:active, .wsw-shop .wsw-bottomnav__link:active, body.wsw-canvas .wsw-canvas__navlink:active { background: color-mix(in srgb, var(--wsw-primary) 12%, transparent); transform: scale(.96); }

/* بخشی که منتظر پاسخ سرور است (به‌روزرسانی خوش‌بینانه سبد) */
.wsw-shop .is-pending { opacity: .6; transition: opacity .2s ease; }

/* کشیدن سایدبار و پنل پایین با انگشت: حین کشیدن transition قطع می‌شود */
.wsw-shop .is-dragging { transition: none !important; will-change: transform; }

/* دستگیره پنل پایین (موبایل) */
.wsw-shop .wsw-modal__box { position: relative; }
@media (max-width: 900px) {
	.wsw-shop .wsw-modal__box::before { content: ""; display: block; width: 42px; height: 5px; border-radius: 99px; margin: -8px auto 14px; background: color-mix(in srgb, var(--wsw-ink, #0f172a) 22%, transparent); }
	.wsw-shop .wsw-modal { transition: background-color .2s ease; }
}
@media (hover: none) { .wsw-shop .wsw-btn:hover, .wsw-shop .wsw-card:hover { transform: none; } }
