@font-face {
  font-family: 'Vazir';
  src: url('../fonts/Vazir.woff2') format('woff2'),
       url('../fonts/Vazir.woff') format('woff');
  font-weight: normal;
  font-style: normal;
}

/* فرم کلی */
.amib-wrapper {
  direction: rtl;
  background: #fff;
  padding: 20px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-family: 'Vazir', sans-serif;
  max-width: 900px;
  margin: auto;
}

/* عنوان و انتخاب حالت */
.amib-wrapper h2 {
  margin-bottom: 10px;
  font-size: 22px;
  color: #333;
}

#invoice_mode {
  padding: 6px 10px;
  font-size: 15px;
  margin-bottom: 20px;
}

/* لوگو فروشگاه */
.amib-logo img {
  max-width: 150px;
  height: auto;
  margin-bottom: 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

/* فیلدهای بالا */
input[type="text"],
input[type="number"],
input[type="file"],
textarea {
  padding: 6px 10px;
  font-size: 15px;
  border: 1px solid #ccc;
  border-radius: 6px;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 10px;
}

/* جدول پیش‌فاکتور */
.amib-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.amib-table th,
.amib-table td {
  border: 1px solid #ccc;
  padding: 8px;
  text-align: center;
  font-size: 14px;
}

.amib-table th {
  background-color: #f9f9f9;
}

/* ستون نام محصول بزرگ‌تر */
.amib-table td:nth-child(2),
.amib-table th:nth-child(2) {
  width: 30%;
}

.amib-name {
  width: 100%;
  min-width: 250px;
  font-size: 15px;
  padding: 6px;
  box-sizing: border-box;
}

/* فیلدهای عددی با عرض پویا */
.amib-qty,
.amib-unit,
.amib-total {
  font-size: 15px;
  padding: 6px;
  text-align: center;
  transition: width 0.2s ease;
  min-width: 80px;
  max-width: 180px;
  overflow-x: auto;
  white-space: nowrap;
}

/* دکمه‌ها */
button {
  padding: 8px 14px;
  font-size: 15px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 10px;
}

#amib-add-row {
  background-color: #10b981;
  color: white;
}

.amib-remove {
  background-color: #ef4444;
  color: white;
}

#amib-save {
  background-color: #2563eb;
  color: white;
  margin-right: 10px;
}

#download_pdf {
  background-color: #111827;
  color: white;
}

/* جمع کل */
#invoice-total {
  margin-top: 20px;
  font-weight: bold;
  font-size: 16px;
}

/* پیشنهاد محصول (autocomplete) */
.amib-suggestion-box {
  list-style: none;
  padding: 0;
  margin: 0;
  border: 1px solid #ccc;
  max-height: 200px;
  overflow-y: auto;
  position: absolute;
  background: #fff;
  z-index: 9999;
  width: 100%;
  text-align: right;
}

.amib-suggestion-box li {
  padding: 6px 8px;
  cursor: pointer;
}

.amib-suggestion-box li:hover {
  background: #f0f0f0;
}

.amib-suggestion-box li:active {
  background-color: #e0e0e0;
}

/* فیلد آپلود لوگو سفارشی */
#custom_logo_upload {
  margin-top: 10px;
}

/* واکنش‌گرایی برای موبایل */
@media screen and (max-width: 600px) {
  .amib-table th,
  .amib-table td {
    font-size: 12px;
    padding: 6px;
  }

  .amib-name,
  .amib-qty,
  .amib-unit,
  .amib-total {
    font-size: 13px;
  }

  button {
    font-size: 14px;
    padding: 6px 10px;
  }
}
