/* نسخه حرفه‌ای استایل یادداشت سفارش - هماهنگ با تم Mizino */

/* جلوگیری از اسکرول صفحه وقتی مودال باز است */
body.mz-ovh { overflow: hidden; }

/* --- دکمه شناور (FAB) --- */
#mzNoteFab {
  position: fixed;
  z-index: 9990; /* زیر لودر ولی روی بقیه عناصر */
  width: 40px;
  height: 40px;
  border-radius: 100%;
  border: 0;
  cursor: pointer;
  
  /* استفاده از رنگ‌های تم رستوران */
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  
  /* سایه رنگی و مدرن */
  box-shadow: 0 10px 25px -5px color-mix(in srgb, var(--primary), transparent 40%);
  
  display: flex;
  align-items: center;
  justify-content: center;
  
  /* انیمیشن برای ورود و خروج نرم */
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
  transform: scale(1);
  opacity: 85%;
  
  /* موقعیت پیش‌فرض */
  bottom: 24px;
}

/* موقعیت در حالت راست‌چین (فارسی) - پایین سمت چپ */
html[dir="rtl"] #mzNoteFab {
  left: 15px;
  right: auto;
}
/* موقعیت در حالت چپ‌چین - پایین سمت راست */
html[dir="ltr"] #mzNoteFab {
  right: 24px;
  left: auto;
}

/* کلاس برای مخفی کردن دکمه هنگام باز شدن مودال */
#mzNoteFab.is-hidden {
  transform: scale(0) rotate(90deg);
  opacity: 0;
  pointer-events: none;
}

/* آیکون داخل دکمه */
#mzNoteFab .ic {
  font-size: 20px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* بج (شمارنده) روی دکمه */
#mzNoteFab .badge {
  position: absolute;
  top: -8px;
  right: -2px;
  min-width: 20px;
  height: 20px;
  background: #ef4444; /* قرمز استاندارد برای هشدار */
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  border-radius: 99px;
  display: none; /* توسط JS مدیریت می‌شود */
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  box-shadow: 0 4px 10px rgba(239,68,68,0.4);
  animation: mz-bounce 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  font-family: var(--font);
}

html[dir="rtl"] #mzNoteFab .badge {
  right: -2px;
  left: auto;
}

/* --- مودال (Popup) --- */
#mzNoteModal {
  position: fixed;
  inset: 0;
  z-index: 9995;
  display: none;
  align-items: flex-end; /* در موبایل از پایین باز شود */
  justify-content: center;
  transition: opacity 0.3s ease;
}

@media (min-width: 576px) {
  #mzNoteModal { align-items: center; }
}

#mzNoteModal.open {
  display: flex;
  animation: mz-fade-in 0.2s forwards;
}

/* پس‌زمینه تاریک پشت مودال */
#mzNoteModal .mz-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* بدنه مودال */
#mzNoteModal .mz-modal {
  position: relative;
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  background: #fff;
  color: #1f2937;
  border-radius: 24px 24px 0 0; /* گرد در بالا برای موبایل */
  box-shadow: 0 -10px 40px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: mz-slide-up 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (min-width: 576px) {
  #mzNoteModal .mz-modal {
    border-radius: 24px; /* گرد کامل در دسکتاپ */
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 90vw;
    animation: mz-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
}

/* هدر مودال */
.mz-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: #fff;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.mz-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #111;
}

.mz-x {
  background: #f3f4f6;
  border: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  color: #4b5563;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.mz-x:hover { background: #e5e7eb; color: #000; }

/* محتوای لیست */
.mz-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  background: #f9fafb;
}

.mz-empty {
  padding: 40px 20px;
  text-align: center;
  color: #9ca3af;
  font-size: 0.95rem;
}

.mz-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mz-list li {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.05);
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.mz-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mz-name {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 6px;
  color: #374151;
}

.mz-details {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.mz-price-grp {
  font-size: 0.9rem;
  color: #6b7280;
  font-weight: 500;
}

.mz-qty-ctrl {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f3f4f6;
  padding: 4px;
  border-radius: 12px;
}

.mz-qty-ctrl button {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 0;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  cursor: pointer;
  font-weight: 900;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.mz-qty-ctrl button:active { transform: scale(0.95); }

.mz-qty-ctrl span {
  font-weight: 700;
  font-size: 1rem;
  min-width: 20px;
  text-align: center;
}

.mz-del {
  margin-right: auto; /* Push to left in RTL */
  background: #fee2e2;
  color: #ef4444;
  border: 0;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
html[dir="rtl"] .mz-del { margin-right: 0; margin-left: 10px; }

/* فوتر مودال */
.mz-foot {
  background: #fff;
  padding: 16px 24px;
  border-top: 1px solid rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mz-sum-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.1rem;
}
.mz-total-lbl { color: #6b7280; }
.mz-total-val { font-weight: 800; color: var(--primary); }

.mz-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mz-btn {
  padding: 12px;
  border-radius: 14px;
  border: 0;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.2s;
}
.mz-btn:active { opacity: 0.8; }

.mz-btn.copy {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--primary), transparent 60%);
}

.mz-btn.clear {
  background: #fee2e2;
  color: #ef4444;
}

/* Animations */
@keyframes mz-bounce { 0%{transform:scale(0)} 50%{transform:scale(1.2)} 100%{transform:scale(1)} }
@keyframes mz-fade-in { from{opacity:0} to{opacity:1} }
@keyframes mz-slide-up { from{transform:translateY(100%)} to{transform:translateY(0)} }
@keyframes mz-pop { from{opacity:0; transform:scale(0.9)} to{opacity:1; transform:scale(1)} }