/* ==========================================================
   order.css — Modal de pedido, cobro, ticket
   ========================================================== */

/* MODAL ORDER LAYOUT */
.modal-order-body {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 0;
  padding: 0 !important;
  height: calc(88vh - 68px);
  overflow: hidden;
}

/* ---- PANEL IZQUIERDO: CARTA ---- */
.order-menu-panel {
  display: flex; flex-direction: column;
  border-right: 1px solid var(--gray-100);
  background: var(--off-white);
  overflow: hidden;
}

.menu-search-bar {
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-100);
  background: var(--white);
}
.menu-search-wrap {
  position: relative;
}
.menu-search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--gray-400); font-size: 0.9rem; pointer-events: none;
}
.menu-search-wrap input {
  padding-left: 36px;
  background: var(--gray-50);
  border-color: var(--gray-100);
}

/* CATEGORY TABS */
.menu-cats {
  display: flex; gap: 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--gray-100);
  overflow-x: auto; flex-shrink: 0;
  background: var(--white);
  gap: 6px;
}
.menu-cats::-webkit-scrollbar { height: 0; }
.cat-tab {
  padding: 7px 16px; border-radius: 20px;
  font-size: 0.8rem; font-weight: 700;
  cursor: pointer; white-space: nowrap;
  border: 1.5px solid var(--gray-200);
  background: var(--white); color: var(--gray-600);
  transition: all var(--transition);
  font-family: 'Outfit', sans-serif;
}
.cat-tab:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-light); }
.cat-tab.active { background: var(--brand); border-color: var(--brand); color: var(--white); box-shadow: 0 2px 8px rgba(255,87,34,.3); }

/* ITEMS GRID */
.menu-items-grid {
  flex: 1; overflow-y: auto;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  align-content: start;
}
.menu-item-card {
  background: var(--white);
  border: 1.5px solid var(--gray-100);
  border-radius: var(--radius);
  padding: 14px 12px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex; flex-direction: column; gap: 7px;
  position: relative; overflow: hidden;
}
.menu-item-card:hover {
  border-color: var(--brand);
  box-shadow: 0 4px 16px rgba(255,87,34,.12);
  transform: translateY(-2px);
}
.menu-item-card:active { transform: scale(.97); }
.menu-item-card::after {
  content: '+'; position: absolute; top: 8px; right: 10px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--brand); color: white;
  font-size: 1rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity var(--transition);
  line-height: 1;
}
.menu-item-card:hover::after { opacity: 1; }
.item-emoji { font-size: 1.7rem; }
.item-name { font-size: 0.8rem; font-weight: 700; color: var(--gray-800); line-height: 1.25; }
.item-price {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.92rem; font-weight: 700;
  color: var(--brand); margin-top: auto;
}

/* ---- PANEL DERECHO: PEDIDO ---- */
.order-summary-panel {
  display: flex; flex-direction: column;
  background: var(--white); overflow: hidden;
}
.order-panel-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: space-between;
}
.order-panel-title { font-size: 0.88rem; font-weight: 800; color: var(--gray-800); }
.order-count {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--brand); color: white;
  font-size: 0.72rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

.order-lines { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 6px; }

/* ORDER LINE */
.order-line {
  background: var(--off-white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  display: flex; align-items: center; gap: 7px;
  animation: lineIn .15s ease;
}
@keyframes lineIn { from { opacity:0; transform:translateX(8px); } to { opacity:1; transform:none; } }
.line-emoji { font-size: 1rem; flex-shrink: 0; }
.line-name { flex: 1; font-size: 0.8rem; font-weight: 600; color: var(--gray-800); line-height: 1.2; }
.line-controls { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.qty-btn {
  width: 24px; height: 24px; border-radius: 6px;
  background: var(--white); border: 1.5px solid var(--gray-200);
  color: var(--gray-600); font-size: 0.9rem; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all var(--transition); line-height: 1;
}
.qty-btn:hover { background: var(--gray-100); border-color: var(--gray-400); }
.qty-btn.del { color: var(--red); border-color: var(--red-border); background: var(--red-bg); }
.qty-btn.del:hover { background: var(--red); color: white; border-color: var(--red); }
.line-qty { font-family: 'JetBrains Mono', monospace; font-size: 0.88rem; font-weight: 700; min-width: 22px; text-align: center; }
.line-total { font-family: 'JetBrains Mono', monospace; font-size: 0.82rem; font-weight: 700; color: var(--brand); min-width: 54px; text-align: right; flex-shrink: 0; }

/* TOTALS */
.order-totals {
  border-top: 1px solid var(--gray-100);
  padding: 12px 16px;
  display: flex; flex-direction: column; gap: 6px;
  background: var(--off-white);
}
.tot-row {
  display: flex; justify-content: space-between;
  font-size: 0.83rem; color: var(--gray-600); font-weight: 500;
}
.tot-row span:last-child { font-family: 'JetBrains Mono', monospace; font-weight: 600; }
.tot-final {
  font-size: 1.05rem; font-weight: 800; color: var(--gray-900);
  padding-top: 8px; border-top: 1.5px solid var(--gray-200); margin-top: 2px;
}
.tot-final span:last-child { color: var(--brand); font-size: 1.2rem; }

/* ORDER ACTIONS */
.order-actions {
  padding: 12px 14px; display: flex; gap: 8px;
  border-top: 1px solid var(--gray-100);
}
.order-actions .btn { flex: 1; }

/* CHECKOUT MODAL */
.checkout-display {
  text-align: center; padding: 20px 0 16px;
  display: flex; flex-direction: column; gap: 4px;
}
.checkout-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--gray-400); }
.checkout-amount { font-family: 'JetBrains Mono', monospace; font-size: 2.8rem; font-weight: 700; color: var(--brand); }

.pay-methods { display: flex; gap: 8px; margin-bottom: 18px; }
.pay-btn {
  flex: 1; padding: 13px 10px; border-radius: var(--radius-sm);
  border: 2px solid var(--gray-200); background: var(--white);
  color: var(--gray-600); font-size: 0.82rem; font-weight: 700;
  font-family: 'Outfit', sans-serif; cursor: pointer;
  transition: all var(--transition); text-align: center;
}
.pay-btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-light); }
.pay-btn.active { border-color: var(--brand); background: var(--brand); color: white; box-shadow: 0 2px 10px rgba(255,87,34,.3); }

.cash-group { display: flex; flex-direction: column; gap: 8px; }
.change-row {
  background: var(--green-bg); border: 1.5px solid var(--green-border);
  border-radius: var(--radius-sm); padding: 10px 14px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.85rem; font-weight: 700; color: #00a844;
}
.change-row span:last-child { font-family: 'JetBrains Mono', monospace; font-size: 1rem; }

/* TICKET */
.ticket-wrap {
  background: #fff; border: 1px dashed var(--gray-300);
  border-radius: var(--radius-sm); padding: 20px;
  font-family: 'JetBrains Mono', monospace; font-size: 0.8rem;
  line-height: 1.7; color: #111;
}
.ticket-wrap .t-center { text-align: center; }
.ticket-wrap .t-bold { font-weight: 700; }
.ticket-wrap .t-sep { border: none; border-top: 1px dashed #bbb; margin: 8px 0; }
.ticket-wrap .t-row { display: flex; justify-content: space-between; }
.ticket-wrap .t-big { font-size: 1rem; font-weight: 700; }
