/* PixelLife mobile bottom navigation */
.mobile-bottom-nav {
  display: none;
}

/* The category explorer is created by JavaScript only for mobile. Keep it
   explicitly hidden on desktop as a defensive fallback. */
@media (min-width: 769px) {
  .mobile-bottom-nav,
  .mobile-category-backdrop,
  .mobile-category-sheet {
    display: none !important;
  }
}

@media (max-width: 768px) {
  :root {
    --mobile-bottom-nav-height: 70px;
  }

  body {
    padding-bottom: calc(var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom));
  }

  /* Mobile header: keep only the full-width search field. */
  .header {
    padding: 10px 16px !important;
  }

  .header-inner {
    height: auto !important;
    gap: 0 !important;
  }

  .header .logo,
  .header .header-actions,
  .navbar {
    display: none !important;
  }

  .header .search-bar {
    flex: 1 1 100%;
    width: 100%;
    max-width: none;
    height: 46px;
    border-radius: 12px;
    background: #f8fafc;
  }

  .header .search-bar input {
    min-width: 0;
    font-size: 13px;
  }

  .header .search-btn {
    width: 46px;
    padding: 0;
    justify-content: center;
    font-size: 0;
  }

  .header .search-btn i {
    margin: 0;
    font-size: 20px;
  }

  .mobile-bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1800;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    height: calc(var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom));
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
    box-sizing: border-box;
    isolation: isolate;
    pointer-events: auto;
  }

  .mobile-bottom-nav__item {
    position: relative;
    display: flex;
    width: 100%;
    height: 100%;
    min-width: 0;
    align-self: stretch;
    box-sizing: border-box;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: #64748b;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.25;
    text-decoration: none;
    min-height: 56px;
    padding: 3px 0;
    cursor: pointer;
    border: 0;
    background: transparent;
    appearance: none;
    -webkit-appearance: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    pointer-events: auto;
  }

  /* متن، آیکون و بج جزئی از سطح لمس نیستند؛ کل ستون یک هدف لمس است. */
  .mobile-bottom-nav__item > * {
    pointer-events: none;
  }

  .mobile-bottom-nav__icon {
    width: 25px;
    height: 25px;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: color 0.2s ease, transform 0.2s ease;
  }

  /* آیکون اختصاصی سبد خرید، مطابق تصویر ارسالی؛ فقط در ناوبری موبایل. */
  .mobile-bottom-nav__cart-image {
    width: 25px;
    height: 25px;
    display: block;
    object-fit: contain;
    opacity: .62;
    filter: invert(1);
    transition: opacity .2s ease, transform .2s ease;
  }
  .mobile-bottom-nav__cart-icon {
    object-fit: contain;
  }

  .mobile-bottom-nav__item.is-active {
    color: #2563eb;
  }

  .mobile-bottom-nav__item.is-active .mobile-bottom-nav__icon {
    transform: translateY(-1px);
    stroke-width: 2.2;
  }
  .mobile-bottom-nav__item.is-active .mobile-bottom-nav__cart-image {
    opacity: 1;
    transform: translateY(-1px) scale(1.04);
  }

  .mobile-bottom-nav__badge {
    position: absolute;
    top: 2px;
    right: calc(50% - 18px);
    display: none;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    line-height: 12px;
    text-align: center;
    box-sizing: border-box;
  }

  .sticky-purchase-card {
    bottom: calc(var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom));
  }

  .toast {
    bottom: calc(24px + var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom));
  }

  .mobile-category-backdrop,
  .mobile-category-sheet__header,
  .mobile-category-sheet__search { touch-action: none; }

  .mobile-category-backdrop {
    position: fixed;
    inset: 0 0 calc(var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom));
    z-index: 1750;
    background: rgba(15, 23, 42, 0.3);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 240ms ease;
  }

  .mobile-category-sheet {
    position: fixed;
    right: 0;
    bottom: calc(var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom));
    left: 0;
    z-index: 1760;
    height: calc(100dvh - var(--mobile-bottom-nav-height) - env(safe-area-inset-bottom));
    min-height: 440px;
    padding: 8px 0 0;
    overflow: hidden;
    border-radius: 24px 24px 0 0;
    background: #fff;
    box-shadow: 0 -18px 48px rgba(15, 23, 42, 0.18);
    visibility: hidden;
    opacity: 1;
    pointer-events: none;
    /* بسته: به اندازهٔ آیکن دسته‌بندی کوچک و در همان نقطه؛ باز: از دل همان آیکن بزرگ می‌شود */
    opacity: 0;
    transform-origin: var(--pl-sheet-ox, 50%) var(--pl-sheet-oy, 100%);
    transform: scale(0.1);
    will-change: transform, opacity;
    transition: transform 460ms cubic-bezier(0.22, 1, 0.36, 1), opacity 200ms ease, border-radius 460ms ease;
  }

  .mobile-category-sheet.is-mounted,
  .mobile-category-backdrop.is-mounted {
    visibility: visible;
  }

  .mobile-category-sheet.is-open,
  .mobile-category-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-category-sheet.is-open {
    opacity: 1;
    transform: none;
  }
  /* محتوا کمی دیرتر پدیدار می‌شود تا ابتدا «پوسته» از دل آیکن بیرون بیاید */
  .mobile-category-sheet > * { transition: opacity 240ms ease 0ms; opacity: 0; }
  .mobile-category-sheet.is-open > * { opacity: 1; transition-delay: 140ms; }
  @media (prefers-reduced-motion: reduce) { .mobile-category-sheet { transition: opacity 150ms ease; transform: none; } }

  .mobile-category-sheet.is-dragging {
    transition: none;
  }

  .mobile-category-sheet__handle {
    width: 42px;
    height: 4px;
    margin: 0 auto 8px;
    border-radius: 999px;
    background: #cbd5e1;
    touch-action: none;
  }

  .mobile-category-sheet__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    padding: 0 16px;
    border-bottom: 1px solid #e2e8f0;
  }

  .mobile-category-sheet__title {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
  }

  .mobile-category-sheet__close {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    background: #f1f5f9;
    color: #334155;
    font-size: 20px;
  }

  .mobile-category-sheet__tabs {
    display: flex;
    align-items: center;
    height: 52px;
    padding: 0 16px;
    border-bottom: 1px solid #e2e8f0;
  }

  .mobile-category-sheet__tab {
    position: relative;
    flex: 1;
    padding: 14px 0 12px;
    color: #2563eb;
    font-size: 15px;
    font-weight: 800;
    text-align: center;
  }

  .mobile-category-sheet__tab::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 3px;
    border-radius: 999px 999px 0 0;
    background: #2563eb;
  }

  .mobile-category-sheet__search {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    margin: 9px 16px;
    padding: 0 11px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: #f8fbff;
    color: #2563eb;
  }
  .mobile-category-sheet__search svg {
    width: 19px;
    height: 19px;
    flex: 0 0 auto;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
  }
  .mobile-category-sheet__search input {
    min-width: 0;
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: #0f172a;
    font: 600 13px Vazirmatn, sans-serif;
  }
  .mobile-category-sheet__search input::placeholder {
    color: #94a3b8;
  }
  .mobile-category-sheet__layout {
    display: grid;
    grid-template-columns: 126px minmax(0, 1fr);
    height: calc(100% - 172px);
    direction: rtl;
  }

  .mobile-category-sheet__rail {
    overflow-y: auto;
    border-left: 1px solid #e2e8f0;
    background: #f8fafc;
    overscroll-behavior: contain;
  }

  .mobile-category-sheet__rail-item {
    width: 100%;
    min-height: 96px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 5px;
    border: 0;
    border-bottom: 1px solid #e2e8f0;
    border-right: 3px solid transparent;
    background: transparent;
    color: #64748b;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
  }

  .mobile-category-sheet__rail-item svg {
    width: 31px;
    height: 31px;
    stroke: currentColor;
    stroke-width: 1.6;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  /* آیکون‌های تصویری دسته‌ها: هم‌اندازهٔ آیکون‌های قبلی در موبایل */
  .mobile-category-sheet__icon-image {
    width: 31px;
    height: 31px;
    display: block;
    flex: 0 0 31px;
    object-fit: contain;
  }
  .mobile-category-sheet__content-head .mobile-category-sheet__icon-image {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
  }
  .mobile-category-sheet__thumb .mobile-category-sheet__icon-image {
    width: 20px;
    height: 20px;
    flex-basis: 20px;
  }

  .mobile-category-sheet__rail-item.is-active {
    border-right-color: #2563eb;
    background: #fff;
    color: #2563eb;
  }
  .mobile-category-sheet__rail-badge {
    max-width: 100%;
    overflow: hidden;
    padding: 2px 6px;
    border-radius: 999px;
    background: #dbeafe;
    color: #2563eb;
    font-size: 9px;
    font-weight: 800;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .mobile-category-sheet__content {
    overflow-y: auto;
    padding: 20px 18px;
    overscroll-behavior: contain;
  }
  .mobile-category-sheet__content.is-changing {
    animation: mobile-category-content-in 140ms ease both;
  }
  @keyframes mobile-category-content-in {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  .mobile-category-sheet__content-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    color: #0f172a;
    font-size: 18px;
    font-weight: 800;
  }

  .mobile-category-sheet__content-head svg {
    width: 27px;
    height: 27px;
    stroke: #2563eb;
    stroke-width: 1.8;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .mobile-category-sheet__content-desc {
    margin: -6px 0 16px;
    color: #94a3b8;
    font-size: 12px;
  }

  .mobile-category-sheet__link,
  .mobile-category-sheet__soon {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    padding: 10px 2px;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
  }

  .mobile-category-sheet__link-main {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 10px;
  }
  .mobile-category-sheet__thumb {
    width: 32px;
    height: 32px;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 9px;
    background: #eff6ff;
    color: #2563eb;
  }
  .mobile-category-sheet__thumb svg {
    width: 19px;
    height: 19px;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .mobile-category-sheet__link svg {
    width: 18px;
    height: 18px;
    stroke: #94a3b8;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .mobile-category-sheet__group {
    margin: 0 0 6px;
    border-bottom: 1px solid #f1f5f9;
  }

  .mobile-category-sheet__group > .mobile-category-sheet__link {
    min-height: 46px;
    border-bottom: 0;
  }

  .mobile-category-sheet__brand-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 0 42px 9px 0;
  }

  .mobile-category-sheet__brand-link {
    display: grid;
    min-width: 0;
    min-height: 31px;
    place-items: center;
    padding: 4px 3px;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    background: #f8fbff;
    color: #2563eb;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
  }

  .mobile-category-sheet__brand-link:nth-child(2) {
    border-color: #e2e8f0;
    background: #f8fafc;
    color: #334155;
  }

  .mobile-category-sheet__brand-link:nth-child(3) {
    border-color: #ffedd5;
    background: #fffaf3;
    color: #c2410c;
  }

  .mobile-category-sheet__soon {
    color: #94a3b8;
  }

  .mobile-category-sheet__soon small {
    color: #94a3b8;
    font-size: 11px;
    font-weight: 600;
  }

  .mobile-bottom-nav__item.is-expanded {
    color: #2563eb;
  }

  .mobile-bottom-nav__item.is-expanded .mobile-bottom-nav__icon {
    transform: translateY(-1px) scale(1.06);
    stroke-width: 2.2;
  }
  /* صفحه‌های فهرست برای کارت‌ها transition عمومی را خاموش می‌کنند. این
     استثنا باعث می‌شود پنل دسته‌بندی همیشه با حرکت کشویی طبیعی باز شود. */
  .mobile-category-backdrop {
    transition: opacity 240ms ease !important;
  }

  .mobile-category-sheet {
    transition: transform 380ms cubic-bezier(0.22, 1, 0.36, 1) !important;
  }

  .mobile-category-sheet.is-dragging {
    transition: none !important;
  }

  .mobile-category-sheet__content.is-changing {
    animation: mobile-category-content-in 140ms ease both !important;
  }

}

@media (max-width: 768px) {
  /* لینک‌های تصویری پلی‌استیشن و ایکس‌باکس در کشوی دسته‌بندی */
  .mobile-category-sheet__console-logo-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 8px 0 4px;
  }
  .mobile-category-sheet__console-logo-link {
    min-height: 82px;
    display: grid;
    place-items: center;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: #f8fbff;
  }
  .mobile-category-sheet__console-logo-link img {
    width: 54px;
    height: 54px;
    display: block;
    object-fit: contain;
  }
  .mobile-category-sheet__console-logo-link:active {
    border-color: #2563eb;
    background: #eff6ff;
  }
}


/* نوار ثابت پایین موبایل — سبک spotlight برای مسیر فعال */
@media (max-width: 768px) {
  .mobile-bottom-nav {
    overflow: visible;
    background: #1b1b1b;
    border-top: 1px solid #353535;
    box-shadow: 0 -8px 22px rgba(0, 0, 0, .28);
  }

  .mobile-bottom-nav__item {
    overflow: visible;
    color: rgba(255, 255, 255, .58);
    transition: color .22s ease;
  }

  .mobile-bottom-nav__item::before {
    content: "";
    position: absolute;
    top: -7px;
    right: 50%;
    z-index: 2;
    width: 44px;
    height: 2px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 0 12px rgba(255, 255, 255, .95);
    transform: translateX(50%) scaleX(0);
    transition: transform .28s cubic-bezier(.2, .8, .2, 1);
  }

  .mobile-bottom-nav__item::after {
    content: "";
    position: absolute;
    top: -15px;
    right: 50%;
    width: 50px;
    height: 66px;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    background: linear-gradient(to bottom, rgba(255,255,255,.34), rgba(255,255,255,0));
    
    transform: translateX(50%);
    transition: opacity .28s ease;
  }

  .mobile-bottom-nav__item.is-active,
  .mobile-bottom-nav__item.is-expanded {
    color: #fff;
  }

  .mobile-bottom-nav__item.is-active::before,
  .mobile-bottom-nav__item.is-expanded::before {
    transform: translateX(50%) scaleX(1);
  }

  .mobile-bottom-nav__item.is-active::after,
  .mobile-bottom-nav__item.is-expanded::after {
    opacity: 1;
  }

  .mobile-bottom-nav__item.is-active .mobile-bottom-nav__icon,
  .mobile-bottom-nav__item.is-expanded .mobile-bottom-nav__icon {
    transform: translateY(-2px) scale(1.05);
    stroke-width: 2.35;
  }

  .mobile-bottom-nav__badge {
    border-color: #1b1b1b;
  }
}


/* پنهان/نمایان‌شدن نوار هنگام اسکرول موبایل */
@media (max-width: 768px) {
  .mobile-bottom-nav {
    transition: transform 240ms cubic-bezier(.22, 1, .36, 1), background-color .2s ease;
    will-change: transform;
  }
  .mobile-bottom-nav.is-scroll-hidden {
    transform: translate3d(0, calc(100% + env(safe-area-inset-bottom)), 0);
    pointer-events: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .mobile-bottom-nav { transition: none !important; }
}

/* ───────── نوار پایین روشن (به‌جای مشکی)، آیکن‌های کشو هم‌اندازه و لمس‌پذیر ───────── */
@media (max-width: 768px) {
  .mobile-bottom-nav {
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -6px 20px rgba(15, 23, 42, 0.08);
  }
  .mobile-bottom-nav__item { color: #64748b; }
  .mobile-bottom-nav__item::before { background: #2563eb; box-shadow: 0 0 8px rgba(37, 99, 235, .45); }
  .mobile-bottom-nav__item::after { background: linear-gradient(to bottom, rgba(59,130,246,.16), rgba(59,130,246,0));  }
  .mobile-bottom-nav__item.is-active,
  .mobile-bottom-nav__item.is-expanded { color: #2563eb; }
  .mobile-bottom-nav__badge { border-color: #fff; }

  /* آیکن‌های ستون دسته‌ها: اندازهٔ یکسان و ناحیهٔ لمس کامل */
  .mobile-category-sheet__rail-item,
  .mobile-category-sheet__link,
  .mobile-category-sheet__console-logo-link,
  .mobile-category-sheet__brand-links a {
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
  }
  .mobile-category-sheet__rail-item { min-height: 88px; }
  .mobile-category-sheet__rail-item .mobile-category-sheet__icon-image,
  .mobile-category-sheet__rail-item > svg { width: 40px; height: 40px; flex: 0 0 40px; }
  .mobile-category-sheet__rail-item > * { pointer-events: none; }
  .mobile-category-sheet__link { min-height: 52px; }
  .mobile-category-sheet__brand-links a { min-height: 40px; display: inline-flex; align-items: center; }
  .mobile-category-sheet__console-logo-link { min-height: 88px; }
  .mobile-category-sheet__console-logo-link img { width: 52px; height: 52px; }

  /* نتایج محصول داخل جستجوی کشو */
  .mobile-category-sheet__product { display: flex; align-items: center; gap: 10px; padding: 8px 4px; }
  .mobile-category-sheet__product img { width: 46px; height: 46px; flex: 0 0 46px; object-fit: contain; border-radius: 8px; background: #fff; border: 1px solid #e5e9f0; }
  .mobile-category-sheet__product-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
  .mobile-category-sheet__product-text b { font-size: 13px; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: #0f172a; }
  .mobile-category-sheet__product-text small { font-size: 11.5px; color: #64748b; }
  .mobile-category-sheet__product em { font-style: normal; font-size: 12px; font-weight: 800; color: #0f172a; white-space: nowrap; }
  .mobile-category-sheet__product em.is-out { color: #94a3b8; font-weight: 600; }
  .mobile-category-sheet__all { color: #2563eb; font-weight: 700; justify-content: space-between; }
}

/* وقتی کشوی دسته‌ها باز است، فقط «دسته‌بندی‌ها» فعال دیده شود (نه «خانه» همزمان) */
@media (max-width: 768px) {
  .mobile-bottom-nav:has(.is-expanded) .mobile-bottom-nav__item.is-active:not(.is-expanded) { color: #64748b; }
  .mobile-bottom-nav:has(.is-expanded) .mobile-bottom-nav__item.is-active:not(.is-expanded)::before,
  .mobile-bottom-nav:has(.is-expanded) .mobile-bottom-nav__item.is-active:not(.is-expanded)::after { opacity: 0; transform: translateX(50%) scaleX(0); }
}

/* ───────── کشوی دسته‌بندی موبایل: بدون تکرار، یک الگوی یکدست ───────── */
@media (max-width: 768px) {
  .mobile-category-sheet__content-head { margin-bottom: 6px; }
  .mobile-category-sheet__all-link { display: flex; align-items: center; justify-content: space-between; min-height: 46px; margin: 0 0 6px; padding: 10px 12px; border-radius: 10px; background: #eff6ff; color: #2563eb; font-size: 13.5px; font-weight: 800; text-decoration: none; }
  .mobile-category-sheet__all-link svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .mobile-category-sheet__group-title { margin: 16px 0 2px; padding-right: 9px; border-right: 3px solid #3b82f6; font-size: 13px; font-weight: 800; color: #0f172a; line-height: 1.8; }
  /* چیپ‌های برند: همه یک‌رنگ (قبلاً هر کدام بر اساس جایگاهش رنگ دیگری داشت) */
  .mobile-category-sheet__brand-link:nth-child(2),
  .mobile-category-sheet__brand-link:nth-child(3) { border-color: #dbeafe; background: #f8fbff; color: #2563eb; }
  .mobile-category-sheet__brand-links { padding: 0 0 10px 0; }
  .mobile-category-sheet__brand-link { min-height: 36px; font-size: 12px; }
  .mobile-category-sheet__link-main > span { font-size: 14px; font-weight: 600; }
}

/* نشان تعداد سبد خرید: کوچک، گرد و تمیز؛ عدد دقیقاً وسط، گوشهٔ بالای آیکن */
@media (max-width: 768px) {
  .mobile-bottom-nav__badge {
    top: 5px;
    left: auto;
    right: calc(50% + 9px); /* لبهٔ راست نشان ثابت؛ عددهای دورقمی به سمت چپ بزرگ می‌شوند، نه روی آیکن */
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border: 1.5px solid #fff;
    background: #ef4444;
    box-shadow: 0 1px 3px rgba(239, 68, 68, 0.35);
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0;
    font-variant-numeric: tabular-nums;
  }
}

/* تیتر گروه به‌صورت لینک با فلش، مثل مگامنوی دسکتاپ */
.mobile-category-sheet__group-title { display: flex; align-items: center; gap: 6px; text-decoration: none; border-right-color: var(--blue, #2563eb) !important; }
.mobile-category-sheet__group-title svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transform: scaleX(-1); }

/* نشانهٔ فعال نوار پایین: بدون دایره/بیضی پشت آیکن؛ فقط آیکن و نوشته آبی می‌شوند. */
@media (max-width: 768px) {
  .mobile-bottom-nav__item::after,
  .mobile-bottom-nav__item.is-active::after,
  .mobile-bottom-nav__item.is-expanded::after { display: none !important; content: none !important; }
  .mobile-bottom-nav__item.is-active, .mobile-bottom-nav__item.is-expanded { background: transparent !important; }
}

/* شمارندهٔ سبد (نوار پایین موبایل): آبی و استاندارد در همهٔ صفحه‌ها، حتی صفحه‌هایی که هدر سایت ندارند
   (پرداخت، قوانین، دسته‌بندی‌ها). تک‌رقمی دایرهٔ ۲۰×۲۰، دورقمی کپسول، عدد وسط. */
html body .mobile-bottom-nav__badge {
  box-sizing: border-box !important;
  /* مثل نشان آیکن برنامه در اندروید: دایرهٔ پر و بزرگ، بدون حلقهٔ سفید، عدد درشت و بولد وسط آن */
  min-width: 18px !important; width: auto !important; height: 18px !important; padding: 0 5px !important;
  border: 0 !important; border-radius: 999px !important;
  background: #2563eb !important; color: #fff !important; box-shadow: 0 1px 4px rgba(15, 23, 42, .28) !important;
  align-items: center !important; justify-content: center !important;
  font-family: inherit !important; font-size: 12px !important; font-weight: 800 !important;
  line-height: 1 !important; letter-spacing: 0 !important; white-space: nowrap !important; text-align: center !important;
  font-variant-numeric: normal; direction: ltr; unicode-bidi: isolate;
}
@media (max-width: 768px) { html body .mobile-bottom-nav__badge { top: 0 !important; } }
html body .mobile-bottom-nav__badge { padding-top: 2px !important; }


/* ───────── انیمیشن لمس آیکن‌های نوار پایین (هر آیکن حرکت خودش را دارد) ─────────
   روی گروه داخلی آیکن اجرا می‌شود تا با حالت فعال (جابه‌جایی و بزرگ‌نمایی خود svg) تداخل نکند. */
@media (max-width: 768px) and (prefers-reduced-motion: no-preference) {
  .mobile-bottom-nav__icon .nav-g, .mobile-bottom-nav__icon .nav-g * { transform-box: fill-box; transform-origin: center; }
  .mobile-bottom-nav__icon { overflow: visible; }
  .mobile-bottom-nav__icon .nav-g { transform-origin: 50% 100%; }
  /* همهٔ قطعه‌ها در تمام فریم‌ها دیده می‌شوند (بدون ناپدید شدن و دوباره کشیده‌شدن)؛ حرکت‌ها فنری‌اند: فشردن، جهش، فرود. */
  .mobile-bottom-nav__icon .nav-draw { transform-origin: 50% 100%; }
  @keyframes plNavHop { 0% { transform: none; } 32% { transform: translateY(-4px) scale(.97, 1.05); } 66% { transform: translateY(0) scale(1.05, .93); } 100% { transform: none; } }
  @keyframes plNavDoor { 0% { transform: scale(1, .55); } 55% { transform: scale(1, 1.12); } 100% { transform: none; } }
  @keyframes plNavPop { 0% { transform: scale(1); } 30% { transform: scale(.58); } 66% { transform: scale(1.14); } 100% { transform: scale(1); } }
  @keyframes plNavDrive { 0% { transform: translateX(-6px) rotate(-6deg); } 45% { transform: translateX(1.5px) rotate(2deg); } 75% { transform: translateX(-.5px) rotate(-.6deg); } 100% { transform: none; } }
  @keyframes plNavWheel { 0% { transform: none; } 30% { transform: translateY(-1.8px); } 62% { transform: translateY(.7px); } 100% { transform: none; } }
  @keyframes plNavHead { 0% { transform: none; } 35% { transform: translateY(-3px) scale(1.1); } 70% { transform: translateY(.5px) scale(.97); } 100% { transform: none; } }
  @keyframes plNavBody { 0% { transform: scale(1, .8); } 55% { transform: scale(1, 1.07); } 100% { transform: none; } }
  .pl-anim .nav-g, .pl-anim .nav-g * { animation-timing-function: cubic-bezier(.3, 0, .2, 1); animation-fill-mode: both; }
  .pl-anim[data-nav="home"] .nav-g { animation: plNavHop .42s; }
  .pl-anim[data-nav="home"] .nav-draw { animation: plNavDoor .42s .08s; }
  .pl-anim[data-nav="categories"] .nav-pop { animation: plNavPop .42s; }
  .pl-anim[data-nav="categories"] .nav-pop:nth-child(2) { animation-delay: .04s; }
  .pl-anim[data-nav="categories"] .nav-pop:nth-child(4) { animation-delay: .08s; }
  .pl-anim[data-nav="categories"] .nav-pop:nth-child(3) { animation-delay: .12s; }
  .pl-anim[data-nav="cart"] .nav-g { animation: plNavDrive .46s; transform-origin: 50% 100%; }
  .pl-anim[data-nav="cart"] .nav-pop { animation: plNavWheel .42s .1s; }
  .pl-anim[data-nav="cart"] .nav-pop:nth-of-type(2) { animation-delay: .15s; }
  .pl-anim[data-nav="account"] .nav-head { animation: plNavHead .42s; }
  .pl-anim[data-nav="account"] .nav-draw { animation: plNavBody .42s .05s; }
}

/* لمس نام برند: منوی کشویی زیرمجموعه‌ها (همه، قاب، گلس، شارژر، کیف) نرم باز و بسته می‌شود */
@media (max-width: 768px) {
  button.mobile-category-sheet__link--toggle { width: 100%; background: none; border-top: 0; border-inline: 0; font-family: inherit; text-align: right; cursor: pointer; }
  .mobile-category-sheet__link--toggle svg { transition: transform .22s ease; }
  .mobile-category-sheet__link--toggle[aria-expanded="true"] svg { transform: rotate(-90deg); }
  .mobile-category-sheet__sub { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .26s ease; }
  .mobile-category-sheet__sub.is-open { grid-template-rows: 1fr; }
  .mobile-category-sheet__sub-inner { min-height: 0; overflow: hidden; visibility: hidden; transition: visibility 0s linear .26s; }
  .mobile-category-sheet__sub.is-open .mobile-category-sheet__sub-inner { visibility: visible; transition-delay: 0s; }
  .mobile-category-sheet__sub-list { margin: 2px 0 10px; padding: 4px 0; border-radius: 12px; background: #f8fafc; }
  .mobile-category-sheet__sub-link { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 8px 14px; color: #334155; font-size: 13.5px; font-weight: 600; text-decoration: none; }
  .mobile-category-sheet__sub-link + .mobile-category-sheet__sub-link { border-top: 1px solid #eef2f7; }
  .mobile-category-sheet__sub-link:active { background: #eff6ff; color: #2563eb; }
  .mobile-category-sheet__sub-link svg { width: 16px; height: 16px; stroke: #94a3b8; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
}
@media (prefers-reduced-motion: reduce) { .mobile-category-sheet__sub, .mobile-category-sheet__link--toggle svg { transition: none; } }

/* ───────── نوار پایین شناور (سبک دیجیکالا) ─────────
   قرص سفید گِرد و شناور، فقط آیکن؛ آیتم فعال دایرهٔ خاکستری روشن با آیکن پررنگ‌تر.
   دکمهٔ پشتیبانی (#plAssistantToggle) هم‌ردیف و در سمت چپ همین نوار است.
   ارتفاع کل (۵۶ + فاصله از لبه) داخل --mobile-bottom-nav-height (۷۰px) می‌ماند تا برگهٔ دسته‌ها و نوارهای سبد/پرداخت جابه‌جا نشوند. */
@media (max-width: 768px) {
  html body .mobile-bottom-nav {
    --pl-pill-gap: 16px;
    --pl-support-size: 56px;
    right: var(--pl-pill-gap); left: calc(var(--pl-pill-gap) + var(--pl-support-size) + 10px);
    bottom: calc(10px + env(safe-area-inset-bottom));
    height: 56px; padding: 0 8px; gap: 0;
    background: #fff; border: 0; border-radius: 28px;
    box-shadow: 0 4px 18px rgba(15, 23, 42, .16), 0 1px 3px rgba(15, 23, 42, .08);
  }
  html body .mobile-bottom-nav.is-scroll-hidden { transform: translate3d(0, calc(100% + 24px + env(safe-area-inset-bottom)), 0); }
  html body .mobile-bottom-nav__item { min-height: 0; height: 100%; padding: 0; gap: 0; color: #6b7280; }
  html body .mobile-bottom-nav__item::before { display: none !important; content: none !important; }
  html body .mobile-bottom-nav__item > span:not(.mobile-bottom-nav__badge) {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  html body .mobile-bottom-nav__icon { width: 26px; height: 26px; stroke-width: 1.7; }
  /* دایرهٔ پشت آیتم فعال */
  html body .mobile-bottom-nav__item.is-active,
  html body .mobile-bottom-nav__item.is-expanded { color: #111827; background: transparent !important; }
  html body .mobile-bottom-nav__item.is-active .mobile-bottom-nav__icon,
  html body .mobile-bottom-nav__item.is-expanded .mobile-bottom-nav__icon { stroke-width: 2.3; transform: none; }
  html body .mobile-bottom-nav__item.is-active::after,
  html body .mobile-bottom-nav__item.is-expanded::after {
    display: block !important; content: "" !important; position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; right: auto; bottom: auto;
    transform: translate(-50%, -50%); border-radius: 50%; background: #f3f4f6 !important; opacity: 1; z-index: -1;
  }
  html body .mobile-bottom-nav:has(.is-expanded) .mobile-bottom-nav__item.is-active:not(.is-expanded) { color: #6b7280; }
  html body .mobile-bottom-nav:has(.is-expanded) .mobile-bottom-nav__item.is-active:not(.is-expanded)::after { display: none !important; }
  html body .mobile-bottom-nav__badge { top: 7px !important; right: auto !important; left: calc(50% + 2px) !important; }

  /* دکمهٔ پشتیبانی: دایرهٔ گرادیان بنفش→آبی هم‌ردیف نوار، سمت چپ */
  html body:has(.mobile-bottom-nav) #plAssistantToggle {
    right: auto !important; left: var(--pl-pill-gap, 16px) !important;
    bottom: calc(10px + env(safe-area-inset-bottom)) !important;
    width: 56px !important; height: 56px !important;
    background: linear-gradient(145deg, #6f5bea 0%, #4a7ff6 100%) !important;
    box-shadow: 0 4px 18px rgba(15, 23, 42, .18), 0 1px 3px rgba(15, 23, 42, .08) !important;
    transition: transform .24s cubic-bezier(.22, 1, .36, 1), box-shadow .2s ease;
  }
  html body:has(.mobile-bottom-nav) #plAssistantToggle svg { width: 24px; height: 24px; }
  /* نوار پایین و دکمهٔ پشتیبانی دقیقاً با یک شرط، یک مسافت و یک زمان‌بندی پنهان/نمایان می‌شوند
     (هم با کلاس is-scroll-hidden و هم مستقیم با html.pl-hdr-hidden تا هیچ تأخیری بین‌شان نیفتد) */
  html.pl-hdr-hidden body .mobile-bottom-nav,
  html body .mobile-bottom-nav.is-scroll-hidden { transform: translate3d(0, calc(100% + 24px + env(safe-area-inset-bottom)), 0); pointer-events: none; }
  html body .mobile-bottom-nav { transition: transform 240ms cubic-bezier(.22, 1, .36, 1), background-color .2s ease; }
  html body:has(.mobile-bottom-nav) #plAssistantToggle { transition: transform 240ms cubic-bezier(.22, 1, .36, 1), box-shadow .2s ease; animation: none !important; will-change: transform; }
  html.pl-hdr-hidden body:has(.mobile-bottom-nav) #plAssistantToggle,
  html body:has(.mobile-bottom-nav.is-scroll-hidden) #plAssistantToggle { transform: translate3d(0, calc(100% + 24px + env(safe-area-inset-bottom)), 0) !important; pointer-events: none; }
  html body:has(.mobile-bottom-nav:not(.is-scroll-hidden)) #plAssistantToggle:hover { transform: none !important; }
  html body:has(.mobile-bottom-nav) #plAssistantMenu { right: auto !important; left: 16px !important; bottom: calc(76px + env(safe-area-inset-bottom)) !important; }
  html body:has(.mobile-bottom-nav) #plAssistant { right: 16px !important; left: auto !important; bottom: calc(76px + env(safe-area-inset-bottom)) !important; max-height: calc(100dvh - 110px) !important; }
}

/* پیام‌های کوتاه (toast) فقط نمایش‌اند: حالت پنهانشان (opacity:0) نباید روی آیکن‌های نوار پایین بنشیند و لمس را بگیرد. */
@media (max-width: 768px) {
  html body .toast, html body .undo-toast, html body .co-toast { pointer-events: none !important; }
}

/* سبد خرید و پرداخت: نوار «ثبت سفارش» و قرص ناوبری یک کادر سفید می‌شوند؛ دکمهٔ پشتیبانی نمایش داده نمی‌شود و قرص وسط می‌نشیند */
@media (max-width: 768px) {
  html body:has(.cart-mobile-bar[style*="display: block"]) #plAssistantToggle,
  html body:has(.cart-mobile-bar[style*="display: block"]) #plAssistant,
  html body:has(.cart-mobile-bar[style*="display: block"]) #plAssistantMenu,
  html body:has(.co-mobile-bar) #plAssistantToggle,
  html body:has(.co-mobile-bar) #plAssistant,
  html body:has(.co-mobile-bar) #plAssistantMenu { display: none !important; }
  html body:has(.cart-mobile-bar[style*="display: block"]) .mobile-bottom-nav,
  html body:has(.co-mobile-bar) .mobile-bottom-nav { right: 62px; left: 62px; }
}

/* ───────── حرکت برگهٔ دسته‌بندی (سبک و روان) ─────────
   فقط transform و opacity انیمیت می‌شوند (روی GPU)؛ بدون تاری پس‌زمینه، بدون تغییر گوشهٔ گرد یا سایه در حین حرکت،
   و بدون انیمیشن روی ده‌ها المان داخل برگه. نسخهٔ قبلی با این‌ها روی گوشی کند می‌شد. */
@media (max-width: 768px) {
  html body .mobile-category-sheet { border-radius: 24px 24px 0 0 !important; }
  html body .mobile-category-sheet:not(.is-dragging) {
    transition: transform 280ms cubic-bezier(.4, 0, .2, 1), opacity 160ms ease 60ms !important;
  }
  html body .mobile-category-sheet.is-open:not(.is-dragging) {
    transition: transform 420ms cubic-bezier(.16, 1, .3, 1), opacity 100ms ease !important;
  }
  html body .mobile-category-backdrop { transition: opacity 260ms ease !important; }

  @keyframes plSheetSlide { from { opacity: 0; transform: translate3d(14px, 0, 0); } to { opacity: 1; transform: none; } }
  @keyframes plNavIconPop { 0% { transform: scale(.85); } 55% { transform: scale(1.14); } 100% { transform: scale(1); } }

  /* فقط پنج دستهٔ اول ستون سمت راست کمی پله‌پله می‌آیند؛ بقیه و محتوا با خود برگه ظاهر می‌شوند */
  html body .mobile-category-sheet.is-open .mobile-category-sheet__rail-item:nth-child(-n+5) { animation: plSheetSlide 300ms cubic-bezier(.22, 1, .36, 1) both; }
  html body .mobile-category-sheet.is-open .mobile-category-sheet__rail-item:nth-child(1) { animation-delay: 140ms; }
  html body .mobile-category-sheet.is-open .mobile-category-sheet__rail-item:nth-child(2) { animation-delay: 175ms; }
  html body .mobile-category-sheet.is-open .mobile-category-sheet__rail-item:nth-child(3) { animation-delay: 210ms; }
  html body .mobile-category-sheet.is-open .mobile-category-sheet__rail-item:nth-child(4) { animation-delay: 245ms; }
  html body .mobile-category-sheet.is-open .mobile-category-sheet__rail-item:nth-child(5) { animation-delay: 280ms; }
  /* محتوا بدون تأخیر زیاد پدیدار شود */
  html body .mobile-category-sheet.is-open > * { transition-delay: 90ms; }

  html body .mobile-bottom-nav__item[data-nav="categories"].is-expanded .mobile-bottom-nav__icon { animation: plNavIconPop 380ms cubic-bezier(.34, 1.4, .64, 1); }
}
@media (prefers-reduced-motion: reduce) {
  html body .mobile-category-sheet *, html body .mobile-bottom-nav__icon { animation: none !important; }
}
