/* ==============================
       CSS مودال کاتالوگ با قابلیت درگ
    ============================== */

    /* استایل‌های پایه */
    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    }
    
    body {
      background-color: #f5f5f5;
      color: #333;
      line-height: 1.6;
      min-height: 100vh;
      display: flex;
      justify-content: center;
      align-items: center;
      padding: 20px;
    }

    /* پس‌زمینه مودال */
    .modal-overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-color: rgba(0, 0, 0, 0.7);
      display: none;
      z-index: 1000;
    }

    .modal-overlay.active {
      display: flex;
    }

    /* مودال با قابلیت درگ */
    .modal {
      position: fixed;
      bottom: 0;
      left: 0;
      width: 100%;
      max-height: 90%;
      background: #fff;
      border-top-left-radius: 16px;
      border-top-right-radius: 16px;
      box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
      display: flex;
      flex-direction: column;
      transform: translateY(100%);
      touch-action: none;
      transition: transform 0s;
      z-index: 1001;
      cursor: grab;
    }

    .modal.draggable:active {
      cursor: grabbing;
    }

    .modal.draggable .modal-header {
      user-select: none;
      -webkit-user-select: none;
      -webkit-touch-callout: none;
      min-height: 60px;
      padding: 12px 16px;
      position: relative;
      touch-action: none;
    }

    /* بهبود استایل Drag Handle */
    .modal-drag-handle {
      position: absolute;
      top: 8px;
      left: 50%;
      transform: translateX(-50%);
      width: 40px;
      height: 4px;
      background: #9ca3af;
      border-radius: 3px;
      transition: all 0.2s ease;
    }

    /* حالت‌های مختلف محتوای مودال بر اساس وضعیت */
    .modal.draggable .modal-body {
      max-height: calc(90vh - 70px);
      overflow-y: auto;
      flex: 1;
      -webkit-overflow-scrolling: touch;
      touch-action: pan-y;
    }

    /* وقتی در حال drag هستیم، اسکرول را غیرفعال می‌کنیم */
    .modal.draggable.dragging .modal-body {
      touch-action: none;
      overflow: hidden;
    }

    /* بهبودهای سازگاری برای مرورگرهای مختلف */
    .modal.draggable {
      -webkit-overflow-scrolling: touch;
      overscroll-behavior: contain;
    }

    .modal-body {
      -webkit-overflow-scrolling: touch;
      overscroll-behavior: contain;
      padding: 0;
      height: 100%;
      touch-action: pan-y;
    }

/* هدر مودال - چیدمان جدید: راهنما | عنوان | سبد+بستن */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 10;
  min-height: 64px;
  gap: 8px;
}

/* سمت راست: دکمه راهنما */
.header-left-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  order: 1;
  flex-shrink: 0;
}

/* وسط: عنوان */
.modal-title {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  flex: 1;
  margin: 0 8px;
  color: #2c3e50;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60%;
  padding: 0 8px;
  transition: all 0.3s ease;
  order: 2;
}

/* سمت چپ: دکمه‌های سبد خرید و بستن */
.header-right-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  order: 3;
  flex-shrink: 0;
}

/* بهبود نمایش در دستگاه‌های کوچک */
@media (max-width: 480px) {
  .modal-title {
    font-size: 16px;
    max-width: 50%;
  }
  
  .header-left-actions,
  .header-right-actions {
    gap: 4px;
  }
}

@media (max-width: 350px) {
  .modal-title {
    font-size: 15px;
    max-width: 45%;
  }
}

@media (max-width: 280px) {
  .modal-title {
    font-size: 14px;
    max-width: 40%;
  }
}

@media (max-width: 180px) {
  .modal-title {
    font-size: 13px;
    max-width: 35%;
    padding: 0 4px;
  }
}

    .help-icon {
      background: none;
      border: none;
      font-size: 20px;
      cursor: pointer;
      color: #7f8c8d;
      width: 40px;
      height: 40px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s ease;
      order: 0;
    }

    .help-icon:hover {
      background-color: #f5f5f5;
      color: #3498db;
    }

    .modal-close-header {
      background: none;
      border: none;
      font-size: 20px;
      cursor: pointer;
      color: #7f8c8d;
      width: 40px;
      height: 40px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: background-color 0.2s;
      order: 0;
    }

    .modal-close-header:hover {
      background-color: #f5f5f5;
    }

    .modal-close, .modal-back {
      background: none;
      border: none;
      font-size: 20px;
      cursor: pointer;
      color: #7f8c8d;
      width: 40px;
      height: 40px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: background-color 0.2s;
    }

    .modal-close:hover, .modal-back:hover {
      background-color: #f5f5f5;
    }

    .cart-icon {
      position: relative;
      background: none;
      border: none;
      font-size: 20px;
      cursor: pointer;
      color: #7f8c8d;
      width: 40px;
      height: 40px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: background-color 0.2s;
    }

    .cart-icon:hover {
      background-color: #f5f5f5;
      color: #3498db;
    }

    .cart-count {
      position: absolute;
      top: -5px;
      right: -5px;
      background-color: #e74c3c;
      color: white;
      font-size: 12px;
      font-weight: 600;
      width: 20px;
      height: 20px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      border: 2px solid #fff;
      box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    }

    .hidden {
      display: none !important;
    }

    /* بدنه مودال */
    .modal-body {
      flex: 1;
      overflow-y: auto;
      padding: 0;
      position: relative;
    }

    /* صفحات - کاملاً اصلاح شده */
    .page {
      position: relative;
      padding: 16px;
      overflow-y: auto;
      display: none;
      height: 100%;
      animation: fadeIn 0.3s ease-in-out;
    }

    .page.active {
      display: block;
    }

    /* اطمینان از اینکه فقط یک صفحه نمایش داده شود */
    .modal-body .page:not(.active) {
      display: none !important;
    }

    /* گرید دسته‌بندی‌ها - مقیاس‌پذیر برای دستگاه‌های مختلف */
    .categories-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
      gap: 16px;
      padding: 8px;
    }

    /* برای صفحه نمایش کوچک (موبایل) - دو ستونه */
    @media (max-width: 480px) {
      .categories-grid {
        grid-template-columns: repeat(2, 1fr);
      }
    }

    /* برای فضای کمتر از ۲۸۰ پیکسل - یک ستونه */
    @media (max-width: 280px) {
      .categories-grid {
        grid-template-columns: 1fr;
      }
    }

    /* برای فضای کمتر از ۱۸۰ پیکسل - کوچک‌تر کردن المان‌ها */
    @media (max-width: 180px) {
      .categories-grid {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 4px;
      }
      
      .category-item {
        padding: 12px 8px;
        min-height: 100px;
      }
      
      .category-item i {
        font-size: 20px;
        margin-bottom: 8px;
      }
      
      .category-item span {
        font-size: 12px;
      }
    }

    .category-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 20px 15px;
      border-radius: 16px;
      color: white;
      text-align: center;
      cursor: pointer;
      transition: all 0.3s ease;
      box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
      min-height: 140px;
    }

    .category-item:hover {
      transform: translateY(-5px);
      box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    }

    .category-item i {
      font-size: 28px;
      margin-bottom: 12px;
    }

    .category-item span {
      font-weight: 600;
      font-size: 15px;
    }

    /* رنگ‌بندی دسته‌ها */
    .category-food {
      background: linear-gradient(135deg, #FF9A8B 0%, #FF6A88 55%, #FF99AC 100%);
    }

    .category-accessories {
      background: linear-gradient(135deg, #6A11CB 0%, #2575FC 100%);
    }

    .category-hygiene {
      background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    }

    .category-health {
      background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    }

    /* لیست عمودی */
    .vertical-list {
      display: flex;
      flex-direction: column;
      gap: 16px;
    }

    .vertical-item {
      padding: 16px;
      border: 1px solid #e0e0e0;
      border-radius: 12px;
      background-color: #fff;
      cursor: pointer;
      transition: all 0.2s ease;
      display: flex;
      align-items: center;
      justify-content: space-between;
      box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
      margin-bottom: 12px;
    }

    .vertical-item:hover {
      border-color: #3498db;
      transform: translateY(-2px);
      box-shadow: 0 4px 10px rgba(52, 152, 219, 0.15);
    }

    .vertical-item i {
      color: #95a5a6;
    }

    /* نمایش کارتی محصولات */
    .products-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
      gap: 16px;
      padding: 8px;
      margin-bottom: 20px;
    }

    /* برای صفحه نمایش کوچک (موبایل) - دو ستونه */
    @media (max-width: 480px) {
      .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
      }
    }

    /* برای فضای کمتر از ۳۵۰ پیکسل - دو ستونه با گپ کمتر */
    @media (max-width: 350px) {
      .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
      }
    }

    /* برای فضای کمتر از ۲۸۰ پیکسل - یک ستونه */
    @media (max-width: 280px) {
      .products-grid {
        grid-template-columns: 1fr;
      }
    }

    .product-card {
      background: #fff;
      border-radius: 12px;
      overflow: hidden;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
      transition: all 0.3s ease;
      cursor: pointer;
      display: flex;
      flex-direction: column;
      height: 100%;
    }

    .product-card:hover {
      transform: translateY(-4px);
      box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    }

    .product-image {
      width: 100%;
      height: 140px;
      overflow: hidden;
      position: relative;
    }

    .product-image img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      transition: transform 0.3s ease;
    }

    .product-card:hover .product-image img {
      transform: scale(1.05);
    }

    .product-info {
      padding: 12px;
      flex: 1;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .product-name {
      font-weight: 600;
      font-size: 14px;
      color: #2c3e50;
      line-height: 1.4;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
      height: 40px;
    }

    .product-price {
      font-size: 15px;
      color: #e74c3c;
      font-weight: 700;
      margin-bottom: 8px;
    }

    .product-actions {
      display: flex;
      flex-direction: column;
      gap: 8px;
      margin-top: auto;
    }

    .add-to-cart-btn {
      padding: 10px;
      border-radius: 8px;
      border: none;
      background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
      color: white;
      cursor: pointer;
      font-size: 13px;
      font-weight: 600;
      transition: all 0.2s ease;
      text-align: center;
      width: 100%;
    }

    .add-to-cart-btn:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 8px rgba(46, 204, 113, 0.3);
    }

    .quantity-control {
      display: none;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      width: 100%;
    }

    .qty-btn {
      width: 32px;
      height: 32px;
      border-radius: 6px;
      border: 1px solid #ddd;
      background-color: #f8f9fa;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 14px;
      font-weight: bold;
      transition: all 0.2s;
      flex-shrink: 0;
    }

    .qty-btn:hover {
      background-color: #e9ecef;
      border-color: #3498db;
    }

    .qty-number {
      font-weight: 700;
      font-size: 15px;
      min-width: 30px;
      text-align: center;
      color: #2c3e50;
    }

    /* صفحه سبد خرید - بهبود یافته برای نمایش همیشگی دکمه تکمیل سفارش */
    .cart-page {
      padding: 16px;
      height: 100%;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      position: relative;
    }

    .cart-items {
      margin-bottom: 20px;
      flex: 1;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      overscroll-behavior: contain;
      padding-right: 5px;
      
      /* فعال کردن اسکرول لمسی در تمام مرورگرها */
      touch-action: pan-y;
      scroll-behavior: smooth;
      
      /* محاسبه ارتفاع دینامیک برای نمایش همیشگی دکمه */
      max-height: calc(100% - 120px);
      min-height: 150px;
    }

    /* بهبود اسکرول بار برای تجربه لمسی بهتر */
    .cart-items::-webkit-scrollbar {
      width: 6px;
    }

    .cart-items::-webkit-scrollbar-track {
      background: #f1f1f1;
      border-radius: 3px;
    }

    .cart-items::-webkit-scrollbar-thumb {
      background: #c1c1c1;
      border-radius: 3px;
      transition: background 0.3s;
    }

    .cart-items::-webkit-scrollbar-thumb:hover {
      background: #a8a8a8;
    }

    /* استایل برای مرورگرهای فایرفاکس */
    .cart-items {
      scrollbar-width: thin;
      scrollbar-color: #c1c1c1 #f1f1f1;
    }

    /* بخش پایینی سبد خرید که همیشه قابل مشاهده است */
    .cart-footer {
      position: sticky;
      bottom: 0;
      background: #fff;
      padding-top: 15px;
      border-top: 2px solid #eee;
      margin-top: auto;
      z-index: 5;
    }

    .cart-total {
      padding: 15px 0;
      font-weight: 700;
      font-size: 18px;
      color: #2c3e50;
      text-align: center;
      background: #f8f9fa;
      border-radius: 8px;
      margin-bottom: 10px;
    }

    .checkout-btn {
      width: 100%;
      padding: 16px;
      background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
      color: white;
      border: none;
      border-radius: 10px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.3s;
      font-size: 16px;
      box-shadow: 0 4px 12px rgba(37, 117, 252, 0.3);
      position: relative;
      z-index: 10;
    }

    .checkout-btn:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 15px rgba(37, 117, 252, 0.4);
    }

    .checkout-btn:active {
      transform: translateY(0);
      box-shadow: 0 2px 8px rgba(37, 117, 252, 0.3);
    }

    /* عنوان Sticky برای صفحه سبد خرید */
    .cart-items h3 {
      position: sticky;
      top: 0;
      background: #fff;
      padding: 12px 0;
      margin: 0 0 16px 0;
      z-index: 1;
      font-size: 18px;
      color: #2c3e50;
      border-bottom: 2px solid #eee;
    }

    .cart-item {
      display: flex;
      align-items: center;
      padding: 15px 0;
      border-bottom: 1px solid #eee;
    }

    .cart-item-image {
      width: 60px;
      height: 60px;
      min-width: 60px;
      border-radius: 8px;
      overflow: hidden;
      margin-left: 15px;
      flex-shrink: 0;
    }

    .cart-item-image img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .cart-item-info {
      flex: 1;
      min-width: 0;
    }

    .cart-item-name {
      font-weight: 500;
      margin-bottom: 5px;
      color: #2c3e50;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .cart-item-price {
      color: #7f8c8d;
      font-size: 14px;
    }

    /* استایل‌های جدید برای کنترل تعداد در سبد خرید */
    .cart-qty-control {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-top: 8px;
    }

    .cart-qty-btn {
      width: 28px;
      height: 28px;
      border-radius: 50%;
      border: 1px solid #ddd;
      background-color: #f8f9fa;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 14px;
      transition: all 0.2s;
    }

    .cart-qty-btn:hover {
      background-color: #e9ecef;
    }

    .cart-qty-number {
      font-weight: 600;
      font-size: 16px;
      min-width: 30px;
      text-align: center;
    }

    /* بهبود استایل برای حالت خالی سبد خرید */
    .empty-cart {
      text-align: center;
      padding: 40px 20px;
      color: #7f8c8d;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      height: 100%;
    }

    .empty-cart i {
      font-size: 48px;
      margin-bottom: 16px;
      color: #bdc3c7;
    }

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

    /* بهبود واکنش‌پذیری برای صفحه‌های بسیار کوچک */
    @media (max-width: 280px) {
      .cart-items {
        max-height: calc(100% - 110px);
      }
      
      .cart-total {
        font-size: 16px;
        padding: 12px 0;
      }
      
      .checkout-btn {
        padding: 14px;
        font-size: 15px;
      }
    }

    @media (max-width: 180px) {
      .cart-items {
        max-height: calc(100% - 100px);
        min-height: 120px;
      }
      
      .cart-total {
        font-size: 14px;
        padding: 10px 0;
      }
      
      .checkout-btn {
        padding: 12px;
        font-size: 14px;
      }
    }

    /* بهبود نمایش در دستگاه‌های لمسی */
    @media (hover: none) and (pointer: coarse) {
      .cart-items {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
      }
      
      .checkout-btn {
        padding: 18px 16px;
      }
      
      .product-card {
        cursor: default;
      }
      
      .product-card:active {
        transform: scale(0.98);
      }
    }

    /* نمایش بهتر در حالت landscape موبایل */
    @media (max-height: 500px) and (orientation: landscape) {
      .cart-items {
        max-height: calc(100% - 100px);
      }
      
      .cart-item {
        padding: 10px 0;
      }
      
      .cart-item-image {
        width: 50px;
        height: 50px;
        min-width: 50px;
      }
    }

    /* منوی انتخاب روش ارسال - بهبود یافته و گریدی */
    .send-options-overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-color: rgba(0, 0, 0, 0.7);
      display: none;
      z-index: 2000;
      justify-content: center;
      align-items: flex-end;
      padding: 0;
    }

    .send-options-overlay.active {
      display: flex;
    }

    .send-options-modal {
      position: fixed;
      bottom: 0;
      left: 0;
      width: 100%;
      max-height: 90vh;
      background: #fff;
      border-top-left-radius: 16px;
      border-top-right-radius: 16px;
      box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
      display: flex;
      flex-direction: column;
      z-index: 2001;
      transform: translateY(100%);
      transition: transform 0s;
      cursor: grab;
      padding: 0;
      overflow: hidden;
    }

    .send-options-modal.draggable:active {
      cursor: grabbing;
    }

    .send-options-modal.draggable {
      touch-action: none;
    }

    .send-options-header {
      border-bottom: 1px solid #eee;
      background: #fff;
      position: relative;
      padding: 16px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      min-height: 64px;
    }

    .send-options-title {
      color: #2c3e50;
      font-size: 18px;
      font-weight: 700;
      text-align: center;
      flex: 1;
      margin: 0 8px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      max-width: 70%;
    }

    /* بهبود نمایش عنوان در دستگاه‌های کوچک */
    @media (max-width: 480px) {
      .send-options-title {
        font-size: 16px;
        max-width: 60%;
      }
    }

    @media (max-width: 350px) {
      .send-options-title {
        font-size: 15px;
        max-width: 55%;
      }
    }

    @media (max-width: 280px) {
      .send-options-title {
        font-size: 14px;
        max-width: 50%;
      }
    }

    @media (max-width: 180px) {
      .send-options-title {
        font-size: 13px;
        max-width: 45%;
        padding: 0 4px;
      }
    }

    .send-options-body {
      padding: 20px;
      overflow-y: auto;
      flex: 1;
      background: #fafafa;
    }

    /* طراحی گریدی برای دکمه‌های روش ارسال */
    .send-options-buttons {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 12px;
      margin-bottom: 20px;
    }

    /* ریسپانسیو برای صفحه‌های بسیار کوچک */
    @media (max-width: 480px) {
      .send-options-buttons {
        grid-template-columns: repeat(2, 1fr);
      }
    }

    @media (max-width: 350px) {
      .send-options-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
      }
    }

    @media (max-width: 280px) {
      .send-options-buttons {
        grid-template-columns: 1fr;
      }
    }

    @media (max-width: 180px) {
      .send-options-buttons {
        grid-template-columns: 1fr;
        gap: 8px;
      }
      
      .send-option-btn {
        padding: 10px;
        font-size: 13px;
        min-height: 45px;
      }
    }

    .send-option-btn {
      padding: 14px;
      border-radius: 10px;
      border: 1px solid #e0e0e0;
      background-color: #f8f9fa;
      color: #2c3e50;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.2s;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 6px;
      font-size: 15px;
      min-height: 80px;
      text-align: center;
    }

    .send-option-btn:hover {
      background-color: #e9ecef;
      border-color: #3498db;
      transform: translateY(-2px);
      box-shadow: 0 4px 8px rgba(52, 152, 219, 0.2);
    }

    /* استایل‌های خاص برای هر روش ارسال */
    .send-option-btn:nth-child(1) { /* واتساپ */
      background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
      color: white;
      border-color: #25D366;
    }

    .send-option-btn:nth-child(2) { /* پیامک */
      background: linear-gradient(135deg, #FFA726 0%, #FB8C00 100%);
      color: white;
      border-color: #FFA726;
    }

    .send-option-btn:nth-child(3) { /* تلگرام */
      background: linear-gradient(135deg, #0088cc 0%, #005f8c 100%);
      color: white;
      border-color: #0088cc;
    }

    .send-option-btn:nth-child(4) { /* ایمیل */
      background: linear-gradient(135deg, #EA4335 0%, #D14836 100%);
      color: white;
      border-color: #EA4335;
    }

    .cancel-option-btn {
      padding: 14px;
      border-radius: 10px;
      border: none;
      background-color: #e74c3c;
      color: white;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.2s;
      width: 100%;
      min-height: 50px;
    }

    .cancel-option-btn:hover {
      background-color: #c0392b;
      transform: translateY(-2px);
      box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3);
    }

    /* دکمه‌های بازگشت با نام دسته */
    .back-button {
      justify-content: center !important;
      text-align: center;
      background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%) !important;
      color: white !important;
      border: none !important;
      margin-top: 16px;
      transition: all 0.3s ease;
    }

    .back-button:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 15px rgba(37, 117, 252, 0.4);
    }

    .back-button i {
      margin-left: 8px;
    }

/* استایل‌های مودال راهنما - بهبود یافته برای ماندگاری */
.help-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 2001;
  justify-content: center;
  align-items: flex-end;
}

.help-modal-overlay.active {
  display: flex;
}

.help-modal {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  max-height: 90vh;
  background: #fff;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  z-index: 2002;
  transform: translateY(100%);
  transition: transform 0s;
  cursor: grab;
}

.help-modal.draggable:active {
  cursor: grabbing;
}

.help-modal.draggable {
  touch-action: none;
}

/* استایل‌های جدید برای چیدمان هدر مودال راهنما */
.help-modal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 10;
  min-height: 64px;
  gap: 8px;
}

.help-modal .header-left-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  order: 1;
  flex-shrink: 0;
}

.help-modal .header-right-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  order: 3;
  flex-shrink: 0;
}

.help-modal .modal-title {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  flex: 1;
  margin: 0 8px;
  color: #2c3e50;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60%;
  padding: 0 8px;
  transition: all 0.3s ease;
  order: 2;
}

/* بهبود نمایش در دستگاه‌های کوچک */
@media (max-width: 480px) {
  .help-modal .modal-title {
    font-size: 16px;
    max-width: 50%;
  }
  
  .help-modal .header-left-actions,
  .help-modal .header-right-actions {
    gap: 4px;
  }
}

@media (max-width: 350px) {
  .help-modal .modal-title {
    font-size: 15px;
    max-width: 45%;
  }
}

@media (max-width: 280px) {
  .help-modal .modal-title {
    font-size: 14px;
    max-width: 40%;
  }
}

@media (max-width: 180px) {
  .help-modal .modal-title {
    font-size: 13px;
    max-width: 35%;
    padding: 0 4px;
  }
}

.help-modal-body {
  padding: 25px;
  overflow-y: auto;
  background: #fafafa;
  flex: 1;
}

.help-content {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.help-step {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.help-step:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(52, 152, 219, 0.15);
}

.help-icon-step {
  width: 60px;
  height: 60px;
  min-width: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
  flex-shrink: 0;
}

/* ریسپانسیو برای صفحه‌های بسیار کوچک */
@media (max-width: 280px) {
  .help-step {
    flex-direction: column;
    text-align: center;
    gap: 12px;
    padding: 15px;
  }
  
  .help-icon-step {
    width: 50px;
    height: 50px;
    min-width: 50px;
    font-size: 20px;
  }
  
  .help-text h3 {
    font-size: 16px;
  }
  
  .help-text p {
    font-size: 14px;
  }
}

@media (max-width: 180px) {
  .help-step {
    padding: 10px;
  }
  
  .help-icon-step {
    width: 40px;
    height: 40px;
    min-width: 40px;
    font-size: 18px;
  }
}

.help-text {
  flex: 1;
  min-width: 0;
}

.help-text h3 {
  margin: 0 0 10px 0;
  color: #2c3e50;
  font-size: 18px;
  font-weight: 700;
}

.help-text p {
  margin: 0;
  color: #7f8c8d;
  line-height: 1.6;
  font-size: 15px;
}

    /* استایل‌های بهبود یافته برای نمایش تعداد محصولات در آیکن سبد خرید */
    .cart-icon {
      position: relative;
      background: none;
      border: none;
      font-size: 20px;
      cursor: pointer;
      color: #7f8c8d;
      width: 40px;
      height: 40px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s ease;
    }

    .cart-icon:hover {
      background-color: #f5f5f5;
      color: #3498db;
    }

    .cart-count {
      position: absolute;
      top: -5px;
      right: -5px;
      background-color: #e74c3c;
      color: white;
      font-size: 12px;
      font-weight: 600;
      width: 20px;
      height: 20px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      border: 2px solid #fff;
      box-shadow: 0 2px 4px rgba(0,0,0,0.2);
      transition: all 0.3s ease;
      opacity: 1;
      transform: scale(1);
    }

    .cart-count.hidden {
      opacity: 0;
      transform: scale(0);
    }

    /* بهبود نمایش در حالت‌های مختلف */
    .cart-count.pulse {
      animation: pulse 0.5s ease-in-out;
    }

    @keyframes pulse {
      0% { transform: scale(1); }
      50% { transform: scale(1.2); }
      100% { transform: scale(1); }
    }

    /* استایل‌های بهبود یافته برای نمایش در تمام دستگاه‌ها */
    @media (max-width: 320px) {
      .cart-count {
        width: 18px;
        height: 18px;
        font-size: 11px;
        top: -3px;
        right: -3px;
      }
    }

    @media (max-width: 240px) {
      .cart-count {
        width: 16px;
        height: 16px;
        font-size: 10px;
        top: -2px;
        right: -2px;
      }
    }

    /* بهبود نمایش در مرورگرهای مختلف */
    .cart-count {
      -webkit-user-select: none;
      -moz-user-select: none;
      -ms-user-select: none;
      user-select: none;
      pointer-events: none;
    }

    /* استایل‌های بهبود یافته برای نمایش در تمام مرورگرها */
    .modal, .send-options-modal, .help-modal {
      /* سازگاری با مرورگرهای مختلف */
      -webkit-transform: translateY(100%);
      -moz-transform: translateY(100%);
      -ms-transform: translateY(100%);
      -o-transform: translateY(100%);
      transform: translateY(100%);
      
      /* پشتیبانی از مرورگرهای قدیمی */
      -webkit-transition: -webkit-transform 0s;
      -moz-transition: -moz-transform 0s;
      -o-transition: -o-transform 0s;
      transition: transform 0s;
    }

    /* بهبود نمایش در Safari iOS */
    @supports (-webkit-touch-callout: none) {
      .modal, .send-options-modal, .help-modal {
        -webkit-overflow-scrolling: touch;
      }
      
      .cart-items, .modal-body, .send-options-body, .help-modal-body {
        -webkit-overflow-scrolling: touch;
      }
    }

    /* بهبود نمایش در Firefox */
    @-moz-document url-prefix() {
      .modal, .send-options-modal, .help-modal {
        scrollbar-width: thin;
      }
    }

    /* بهبود نمایش در Edge */
    @supports (-ms-ime-align: auto) {
      .modal, .send-options-modal, .help-modal {
        -ms-overflow-style: -ms-autohiding-scrollbar;
      }
    }

    /* استایل‌های جدید برای نمایش تعداد محصولات در سبد خرید */
    .cart-count-badge {
      position: absolute;
      top: -8px;
      right: -8px;
      background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
      color: white;
      border-radius: 50%;
      width: 22px;
      height: 22px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 12px;
      font-weight: 700;
      border: 2px solid #fff;
      box-shadow: 0 2px 6px rgba(231, 76, 60, 0.4);
      z-index: 10;
      transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
      opacity: 1;
      transform: scale(1);
    }

    .cart-count-badge.hidden {
      opacity: 0;
      transform: scale(0);
    }

    .cart-count-badge.pulse {
      animation: badgePulse 0.6s ease-in-out;
    }

    @keyframes badgePulse {
      0% { transform: scale(1); }
      50% { transform: scale(1.3); }
      100% { transform: scale(1); }
    }

    /* بهبود نمایش در دستگاه‌های بسیار کوچک */
    @media (max-width: 280px) {
      .cart-count-badge {
        width: 20px;
        height: 20px;
        font-size: 11px;
        top: -6px;
        right: -6px;
      }
    }

    @media (max-width: 180px) {
      .cart-count-badge {
        width: 18px;
        height: 18px;
        font-size: 10px;
        top: -5px;
        right: -5px;
      }
    }

    /* سازگاری با تمام مرورگرها */
    .cart-count-badge {
      -webkit-user-select: none;
      -moz-user-select: none;
      -ms-user-select: none;
      user-select: none;
      pointer-events: none;
      -webkit-tap-highlight-color: transparent;
    }

    /* انیمیشن‌های مودال */
    @keyframes slideUp {
      from {
        transform: translateY(100%);
      }
      to {
        transform: translateY(0);
      }
    }

    @keyframes slideDown {
      from {
        transform: translateY(0);
      }
      to {
        transform: translateY(100%);
      }
    }

    /* انیمیشن‌های جدید برای تغییر صفحات */
    @keyframes fadeIn {
      from {
        opacity: 0;
        transform: translateY(10px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    /* قانون بسیار مهم برای جلوگیری از تجمع صفحات */
    .modal-body .page {
      display: none;
    }

    .modal-body .page.active {
      display: block;
    }

    /* اطمینان از اینکه صفحات غیرفعال کاملاً مخفی هستند */
    .page:not(.active) {
      display: none !important;
      visibility: hidden !important;
      opacity: 0 !important;
      pointer-events: none !important;
    }



____________________________
کدهای زیر را اضافه کنید:
/* استایل‌های جدید برای چیدمان هدر */
.header-left-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  order: 1;
}

.header-right-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  order: 3;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 10;
  min-height: 64px;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  flex: 1;
  margin: 0 8px;
  color: #2c3e50;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60%;
  padding: 0 8px;
  transition: all 0.3s ease;
  order: 2;
}

/* در shop.css */
.cart-count-badge,
.cart-count,
.modern-stat-number,
.cart-qty-number,
.qty-number,
.product-price,
.cart-item-price,
.cart-total {
  font-family: 'Vazirmatn', sans-serif;
  direction: ltr;
  display: inline-block;
}

/* اطمینان از نمایش صحیح اعداد در مرورگرهای مختلف */
.modern-stat-number,
#productsCount, 
#categoriesCount, 
#cartItemsCount {
  font-feature-settings: "numr";
  font-variant-numeric: tabular-nums;
}

/* بهبود نمایش در دستگاه‌های کوچک */
@media (max-width: 480px) {
  .modal-title {
    font-size: 16px;
    max-width: 50%;
  }
  
  .header-left-actions,
  .header-right-actions {
    gap: 4px;
  }
}

@media (max-width: 350px) {
  .modal-title {
    font-size: 15px;
    max-width: 45%;
  }
}

@media (max-width: 280px) {
  .modal-title {
    font-size: 14px;
    max-width: 40%;
  }
}

@media (max-width: 180px) {
  .modal-title {
    font-size: 13px;
    max-width: 35%;
    padding: 0 4px;
  }
}
