/* ==================== Fonts ==================== */
@font-face {
  font-family: "Vazir";
  src: url(../font/Vazir-Medium-FD.woff2) format("woff2");
  font-weight: normal;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Vazir", Arial, sans-serif;
  background: linear-gradient(135deg, #d02d00 0%, #a02300 100%);
  color: #333;
  min-height: 100vh;
  direction: rtl;
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  transition: all 0.3s ease;
}

/* ==================== App Container ==================== */
.app-container {
  width: 100%;
  min-height: 100vh;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.app-wrapper {
  width: 100%;
  max-width: 1400px;
  display: flex;
  gap: 24px;
  flex-direction: row-reverse;
  flex-wrap: wrap;
}

/* ==================== Menu Section ==================== */
.menu-section {
  flex: 1;
  min-width: 300px;
  background-color: #ddd;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  max-height: 100vh;
}

.restaurant-header {
  background-color: #27ae60;
  color: white;
  padding: 16px;
  text-align: center;
  border-bottom: 3px solid #8a1a00;
}

.restaurant-header h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.menu-items-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ==================== Menu Items ==================== */
.menu-item {
  background-color: white;
  border-radius: 8px;
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.menu-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.menu-item-image {
  width: 90px;
  height: 70px;
  object-fit: contain;
  flex-shrink: 0;
  background-color: #f5f5f5;
  border-radius: 6px;
  padding: 4px;
}

.menu-item-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-item-name {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  line-height: 1.4;
}

.menu-item-price {
  font-size: 12px;
  color: #666;
}

.menu-item-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: #f5f5f5;
  border-radius: 6px;
  padding: 4px;
}

.quantity-btn {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background-color: #d02d00;
  color: white;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.quantity-btn:hover {
  background-color: #a02300;
}

.quantity-display {
  width: 28px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.item-total-price {
  font-size: 13px;
  font-weight: 600;
  color: #d02d00;
  min-width: 80px;
  text-align: left;
}

/* ==================== Right Section (Payment & Invoice) ==================== */
.right-section {
  flex: 0 0 380px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ==================== Payment Panel ==================== */
.payment-panel {
  background-color: #ddd;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.payment-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: #444;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.price-row .label {
  font-weight: 500;
}

.price-row .value {
  font-weight: 600;
  color: #333;
}

.price-row.discount-value {
  color: #27ae60;
}

/* Discount Input Group */
.discount-input-group {
  display: flex;
  gap: 8px;
  margin: 8px 0;
  width: 100%;
}

.discount-input {
  flex: 1;
  padding: 10px 12px;
  border: 2px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.3s;
}

.discount-input:focus {
  outline: none;
  border-color: #d02d00;
}

.discount-apply-btn {
  width: 44px;
  height: 44px;
  background-color: #d02d00;
  color: white;
  border-radius: 6px;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.discount-apply-btn:hover {
  background-color: #a02300;
}

/* Total Bill */
.total-bill {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #ffa500;
  padding: 14px;
  border-radius: 8px;
  margin: 8px 0;
  font-weight: 600;
}

.total-bill .value {
  font-size: 16px;
  color: #333;
}

/* Submit Order Button */
.submit-order-btn {
  width: 100%;
  padding: 12px;
  background-color: #d02d00;
  color: white;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  margin-top: 8px;
}

.submit-order-btn:hover {
  background-color: #a02300;
}

.submit-order-btn:active {
  transform: scale(0.98);
}

/* ==================== Invoice Container ==================== */
.invoice-container {
  background-color: white;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  min-height: 300px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.invoice-title {
  font-size: 16px;
  font-weight: 600;
  color: #d02d00;
  text-align: center;
  padding-bottom: 12px;
  border-bottom: 2px solid #d02d00;
}

.invoice-items-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 350px;
  overflow-y: auto;
  padding-right: 8px;
}

.invoice-items-list::-webkit-scrollbar {
  width: 6px;
}

.invoice-items-list::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 3px;
}

.invoice-items-list::-webkit-scrollbar-thumb {
  background: #d02d00;
  border-radius: 3px;
}

.invoice-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background-color: #f9f9f9;
  border-radius: 6px;
  border-right: 3px solid #d02d00;
}

.invoice-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.invoice-item-name {
  font-size: 13px;
  font-weight: 600;
  color: #333;
}

.invoice-item-quantity {
  font-size: 12px;
  color: #666;
}

.invoice-item-price {
  font-size: 13px;
  font-weight: 600;
  color: #d02d00;
  white-space: nowrap;
  margin-right: 8px;
}

/* Invoice Footer */
.invoice-footer {
  border-top: 2px solid #eee;
  padding-top: 12px;
}

.invoice-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #ffa500;
  padding: 12px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
}

.invoice-total span:last-child {
  color: #333;
  font-size: 15px;
}

/* ==================== Responsive Design ==================== */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
  .app-wrapper {
    gap: 16px;
  }

  .right-section {
    flex: 0 0 320px;
  }

  .menu-section {
    flex: 1;
    min-width: 250px;
  }

  .restaurant-header h2 {
    font-size: 18px;
  }

  .menu-items-container {
    padding: 16px;
    gap: 14px;
  }

  .menu-item {
    padding: 12px;
  }

  .menu-item-image {
    width: 80px;
    height: 60px;
  }

  .menu-item-name {
    font-size: 13px;
  }

  .payment-panel {
    padding: 16px;
  }

  .invoice-container {
    min-height: 250px;
    padding: 16px;
  }
}

/* Mobile (480px - 768px) */
@media (max-width: 768px) {
  .app-container {
    padding: 12px;
  }

  .app-wrapper {
    flex-direction: column;
    gap: 12px;
  }

  .menu-section {
    max-height: 500px;
    order: 1;
  }

  .right-section {
    flex: 1;
    width: 100%;
    order: 2;
    flex-direction: row;
    gap: 12px;
  }

  .payment-panel {
    flex: 1;
    min-width: 160px;
    padding: 14px;
  }

  .invoice-container {
    flex: 1;
    min-width: 160px;
    padding: 14px;
    min-height: auto;
  }

  .restaurant-header h2 {
    font-size: 16px;
  }

  .menu-items-container {
    padding: 12px;
    gap: 12px;
  }

  .menu-item {
    padding: 12px;
    gap: 10px;
  }

  .menu-item-image {
    width: 70px;
    height: 55px;
  }

  .menu-item-name {
    font-size: 12px;
  }

  .menu-item-price {
    font-size: 11px;
  }

  .price-row {
    font-size: 12px;
    padding: 6px 0;
  }

  .total-bill {
    padding: 10px;
    margin: 6px 0;
  }

  .discount-input-group {
    margin: 6px 0;
  }

  .discount-input {
    padding: 8px 10px;
    font-size: 12px;
  }

  .discount-apply-btn {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .submit-order-btn {
    padding: 10px;
    font-size: 14px;
  }

  .invoice-title {
    font-size: 14px;
    padding-bottom: 8px;
  }

  .invoice-items-list {
    max-height: 250px;
    gap: 8px;
  }

  .invoice-item {
    padding: 8px;
    border-right-width: 2px;
  }

  .invoice-item-name {
    font-size: 12px;
  }

  .invoice-item-quantity {
    font-size: 11px;
  }

  .invoice-item-price {
    font-size: 12px;
    margin-right: 6px;
  }

  .invoice-total {
    padding: 10px;
    font-size: 12px;
  }
}

/* Small Mobile (< 480px) */
@media (max-width: 480px) {
  .app-container {
    padding: 8px;
  }

  .app-wrapper {
    gap: 8px;
  }

  .menu-section {
    max-height: 400px;
  }

  .right-section {
    gap: 8px;
  }

  .restaurant-header h2 {
    font-size: 14px;
    padding: 12px 8px;
  }

  .menu-items-container {
    padding: 10px;
    gap: 10px;
  }

  .menu-item {
    padding: 10px;
    gap: 8px;
  }

  .menu-item-image {
    width: 60px;
    height: 50px;
  }

  .menu-item-name {
    font-size: 11px;
  }

  .menu-item-price {
    font-size: 10px;
  }

  .menu-item-controls {
    gap: 8px;
  }

  .quantity-btn {
    width: 24px;
    height: 24px;
    font-size: 14px;
  }

  .quantity-display {
    width: 20px;
    font-size: 12px;
  }

  .item-total-price {
    font-size: 11px;
  }

  .payment-panel {
    padding: 12px;
  }

  .invoice-container {
    padding: 12px;
  }

  .price-row {
    font-size: 11px;
    padding: 4px 0;
  }

  .total-bill {
    padding: 8px;
    font-size: 11px;
  }

  .total-bill .value {
    font-size: 13px;
  }

  .discount-input {
    padding: 6px 8px;
    font-size: 11px;
  }

  .discount-apply-btn {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .submit-order-btn {
    padding: 8px;
    font-size: 13px;
  }

  .invoice-title {
    font-size: 12px;
  }

  .invoice-item {
    padding: 6px;
    font-size: 11px;
  }

  .invoice-item-name {
    font-size: 11px;
  }

  .invoice-item-quantity {
    font-size: 10px;
  }

  .invoice-item-price {
    font-size: 11px;
  }

  .invoice-total {
    padding: 8px;
    font-size: 11px;
  }

  .invoice-total span:last-child {
    font-size: 13px;
  }
}

/* Empty State for Invoice */
.invoice-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: #999;
  text-align: center;
  gap: 8px;
}

.invoice-empty-state-icon {
  font-size: 48px;
  opacity: 0.5;
}

.invoice-empty-state-text {
  font-size: 13px;
}
