/* ===================================================================
   استایل صفحه‌ی منوی دیجیتال و وضعیت سفارش
   از همان متغیرهای رنگی style.css استفاده می‌کند
   =================================================================== */

.menu-page {
  background: var(--cream);
  padding-bottom: 90px; /* جا برای نوار پایین سبد سفارش */
}

/* ---------- هدر ساده صفحه منو ---------- */
.menu-header {
  background: var(--espresso);
  color: var(--cream);
  position: sticky; top: 0; z-index: 40;
}
.menu-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
}
.menu-header .brand-name { color: var(--cream); font-weight: 900; }
.menu-header-actions { display: flex; align-items: center; gap: 10px; }
.table-badge {
  background: var(--copper); color: var(--espresso);
  padding: 6px 16px; border-radius: 999px; font-weight: 700; font-size: 0.9rem;
}
.lang-switch-menu { border-color: var(--cream); color: var(--cream); }
.lang-switch-menu:hover { background: var(--cream); color: var(--espresso); }

.menu-main { padding: 20px 16px 40px; max-width: 900px; }

.menu-page-title { font-size: 1.3rem; margin-bottom: 18px; text-align: center; }

/* ---------- نوار انتخاب شماره میز (بالای صفحه‌ی دسته‌بندی‌ها) ---------- */
.table-select-bar {
  background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 18px; margin-bottom: 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.table-select-bar label {
  font-weight: 700; color: var(--espresso); font-size: 0.95rem; white-space: nowrap;
}
.table-select-bar input,
.table-select-bar select {
  font-family: inherit; font-size: 1.05rem; font-weight: 700; text-align: center;
  padding: 10px 14px; border-radius: 10px; border: 1.5px solid var(--copper);
  background: var(--cream); width: 130px; color: var(--espresso); cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%232C3320'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 10px center; background-size: 16px;
  padding-left: 32px;
}
.table-select-bar input:focus,
.table-select-bar select:focus { outline: none; border-color: var(--copper-dark); box-shadow: 0 0 0 3px rgba(176,138,52,0.2); }

/* ---------- صفحه‌ی اول: گرید دسته‌بندی‌ها ---------- */
.category-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px;
}
.category-card {
  background: var(--paper); border: none; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px 12px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  cursor: pointer; font-family: inherit; -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease;
}
.category-card:active { transform: scale(0.96); background: #F1E9D6; }
.category-icon { font-size: 2.1rem; line-height: 1; }
.category-name { font-weight: 700; font-size: 0.95rem; color: var(--espresso); text-align: center; }
.category-count { font-size: 0.75rem; color: var(--ink-muted); }

.category-card.has-image {
  background-size: cover; background-position: center; min-height: 120px;
  justify-content: flex-end; position: relative; padding-bottom: 14px;
}
.category-card.has-image::before {
  content: ''; position: absolute; inset: 0; border-radius: var(--radius);
  background: linear-gradient(to top, rgba(20,15,8,0.75) 0%, rgba(20,15,8,0.15) 55%, rgba(20,15,8,0) 100%);
}
.category-card.has-image .category-name,
.category-card.has-image .category-count {
  position: relative; z-index: 1; color: #FBF7F0;
}
.category-card.has-image .category-count { color: rgba(251,247,240,0.8); }

/* ---------- صفحه‌ی دوم: آیتم‌های یک دسته ---------- */
.back-to-categories {
  background: none; border: none; color: var(--copper-dark); font-weight: 700; font-family: inherit;
  cursor: pointer; font-size: 0.95rem; padding: 8px 0; margin-bottom: 6px;
  -webkit-tap-highlight-color: transparent;
}

.menu-category { margin-top: 4px; }

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

.menu-item {
  background: var(--paper); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.menu-item-image { height: 110px; background-size: cover; background-position: center; background-color: #E3DCC1; }
.menu-item-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.menu-item-body h3 { font-size: 1rem; margin: 0; }
.menu-item-body p { font-size: 0.85rem; margin: 0; }
.menu-item-footer {
  margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.price { font-weight: 700; color: var(--copper-dark); font-size: 0.9rem; }

.qty-control { display: flex; align-items: center; gap: 8px; }
.qty-btn {
  width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--espresso);
  background: var(--paper); font-size: 1.1rem; cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center; color: var(--espresso);
}
.qty-btn:active { background: var(--espresso); color: var(--cream); }
.qty-value { min-width: 18px; text-align: center; font-weight: 700; }

/* ---------- نوار پایین سبد سفارش ---------- */
.cart-bar {
  position: fixed; bottom: 0; right: 0; left: 0; z-index: 50;
  background: var(--espresso); color: var(--cream);
  box-shadow: 0 -6px 20px rgba(0,0,0,0.15);
}
.cart-bar-inner {
  display: flex; align-items: center; justify-content: space-between; padding: 14px 24px;
}
.cart-bar .btn-primary { padding: 10px 22px; }

/* ---------- پنل سبد سفارش ---------- */
.cart-panel {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(44,51,32,0.55);
}
.cart-panel:not([hidden]) {
  display: flex; align-items: flex-end;
}
.cart-panel-inner {
  background: var(--cream); width: 100%; max-height: 85vh; overflow-y: auto;
  border-radius: 20px 20px 0 0; padding: 24px; margin: 0 auto; max-width: 560px;
}
.cart-panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.close-btn { background: none; border: none; font-size: 1.8rem; cursor: pointer; color: var(--espresso); line-height: 1; }

.cart-items-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.cart-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cart-line-info { min-width: 0; flex: 1; }
.cart-line-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-line-price { color: var(--ink-muted); font-size: 0.85rem; }
.cart-line-controls { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.cart-line-remove { color: var(--copper-dark); background: none; border: none; cursor: pointer; font-weight: 700; font-size: 0.85rem; }

.qty-control-sm .qty-btn { width: 26px; height: 26px; font-size: 0.95rem; }
.qty-control-sm .qty-value { min-width: 16px; font-size: 0.9rem; }

.cart-field { display: flex; flex-direction: column; gap: 6px; font-weight: 700; margin-bottom: 14px; font-size: 0.9rem; }
.cart-field input, .cart-field textarea {
  font-family: inherit; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--espresso);
  background: var(--paper); font-size: 0.95rem; resize: vertical;
}

.cart-table-display {
  background: var(--cream); border-radius: 10px; padding: 10px 14px; margin: 0 0 14px;
  font-weight: 700; color: var(--espresso); font-size: 0.9rem;
}
.cart-table-display strong { color: var(--copper-dark); }

.cart-total {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; border-top: 1.5px dashed var(--ink-muted); margin-bottom: 16px; font-size: 1.05rem;
}

.submit-order-btn { width: 100%; text-align: center; border: none; cursor: pointer; font-size: 1rem; }
.order-error { color: #B23A3A; font-weight: 700; margin-top: 10px; text-align: center; }

/* ---------- صفحه وضعیت سفارش ---------- */
.status-page { display: flex; justify-content: center; padding-top: 40px; }
.status-card {
  background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 32px; max-width: 480px; width: 100%; text-align: center;
}
.status-steps { display: flex; justify-content: space-between; gap: 4px; margin: 24px 0; }
.step {
  flex: 1; font-size: 0.72rem; font-weight: 700; color: var(--ink-muted);
  padding-top: 14px; position: relative;
}
.step::before {
  content: ''; position: absolute; top: 0; right: 0; left: 0; height: 4px;
  background: #DDD5C0; border-radius: 4px;
}
.step.done::before { background: var(--leaf); }
.step.current::before { background: var(--copper); }
.step.current { color: var(--copper-dark); }

.order-lines { text-align: start; margin-top: 20px; }
.order-line { display: flex; justify-content: space-between; padding: 6px 0; font-size: 0.92rem; }
.order-total-line { border-top: 1.5px dashed var(--ink-muted); margin-top: 6px; padding-top: 12px; font-size: 1rem; }
.order-note { margin-top: 14px; font-style: italic; color: var(--ink-muted); }
.back-to-menu { margin-top: 20px; display: inline-block; }

@media (max-width: 560px) {
  .item-grid { grid-template-columns: 1fr; }
  .menu-header-inner { padding: 12px 16px; }
  .brand-logo { width: 36px; height: 36px; }
  .brand-name { font-size: 0.95rem; }
  .category-card { padding: 18px 10px; }
  .category-icon { font-size: 1.8rem; }
  .menu-item-image { height: 130px; }
  .qty-btn { width: 38px; height: 38px; font-size: 1.3rem; }
}

@media (max-width: 360px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
