/* === VARIABLES DE COLOR === */
:root {
  --color-primary: #de1000;        /* tu color principal */
  --color-secondary: #f5f5f5;      /* fondo claro */
  --color-dark: #333;              /* texto oscuro */
  --color-light: #fff;             /* blanco para tarjetas */
  --color-success: #28a745;        /* verde éxito */
  --color-warning: #ffc107;        /* amarillo */
  --color-danger: #dc3545;         /* rojo */
  --shadow: 0 4px 6px rgba(0,0,0,0.1);
  --radius: 8px;
}

/* === ESTILOS GENERALES === */
* {
  margin:0;
  padding:0;
  box-sizing:border-box;
  font-family: 'Roboto', sans-serif;
}

body {
  background: var(--color-secondary);
  color: var(--color-dark);
  line-height: 1.5;
}

header {
  background: var(--color-dark);
  color: #fff;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.page-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-primary);
}

.mesa-info {
  font-size: 1rem;
  font-weight: 500;
}

.estado-comanda {
  padding: 5px 10px;
  border-radius: var(--radius);
  font-weight: 700;
  text-align:center;
  min-width:120px;
}

.estado-pendiente { background:#FFF3CD; color:#856404; }
.estado-preparacion { background:#D1ECF1; color:#0C5460; }
.estado-lista { background:#D4EDDA; color:#155724; }

.main-container {
  display: flex;
  flex-wrap: wrap;
  height: calc(100vh - 70px);
  overflow: hidden;
}

.product-panel {
  flex: 2;
  padding: 20px;
  overflow-y: auto;
}

.order-panel {
  flex: 1;
  padding: 20px;
  background: var(--color-light);
  box-shadow: -4px 0 10px rgba(0,0,0,0.05);
  overflow-y: auto;
}

h2 {
  margin-bottom: 15px;
  color: var(--color-primary);
}

/* === FILTRO POR CATEGORIAS === */
.category-filter {
  margin-bottom: 15px;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.category-btn {
  padding:8px 12px;
  border:1px solid #ccc;
  background: var(--color-light);
  cursor:pointer;
  border-radius: var(--radius);
  transition: all 0.2s;
}

.category-btn.active,
.category-btn:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* === PRODUCTOS === */
.product-grid {
  display:grid;
  grid-template-columns: repeat(auto-fill,minmax(150px,1fr));
  gap:15px;
}

.product-card {
  background: var(--color-light);
  border-radius: var(--radius);
  padding:10px;
  text-align:center;
  cursor:pointer;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.product-name {
  font-weight: 600;
  margin-bottom: 5px;
}

.product-price {
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 3px;
}

.product-category {
  font-size:0.75rem;
  color:#666;
}

/* === COMANDA === */
.client-section {
  border:1px solid #eee;
  padding:12px;
  border-radius: var(--radius);
  margin-bottom:12px;
  background: var(--color-secondary);
}

.client-header {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:8px;
}

.client-header h4 {
  margin:0;
  color: var(--color-primary);
}

.order-item {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:6px;
  padding-bottom:4px;
  border-bottom:1px dotted #ccc;
}

.item-details {
  flex:1;
}

.item-actions button {
  padding:5px 8px;
  margin-left:5px;
  border:none;
  border-radius: var(--radius);
  cursor:pointer;
  background:#f0f0f0;
  transition: 0.2s;
}

.item-actions button:hover { background: var(--color-primary); color:#fff; }

.item-actions .remove-btn { color: var(--color-danger); font-weight:700; }

.totals-section { margin-top:15px; padding-top:10px; border-top:2px solid var(--color-dark); }

.total-item { display:flex; justify-content:space-between; font-weight:700; margin-bottom:5px; }

.total-mesa { font-size:1.3rem; color: var(--color-primary); }

/* === BOTONES === */
.action-buttons button, .btn-add-client {
  width:100%;
  padding:12px;
  font-size:1rem;
  margin-top:10px;
  border:none;
  border-radius: var(--radius);
  cursor:pointer;
  font-weight:700;
  transition: all 0.2s;
}

.btn-save { background: var(--color-success); color:#fff; }
.btn-save:hover { background:#218838; }

.btn-add-client { background: var(--color-primary); color:#fff; }
.btn-add-client:hover { background:#a70b00; }

/* === MODAL === */
.modal-overlay {
  position: fixed;
  top:0; left:0;
  width:100%; height:100%;
  background: rgba(0,0,0,0.7);
  display:flex; justify-content:center; align-items:center;
  z-index:100;
}

.modal-content {
  background: var(--color-light);
  padding:25px;
  border-radius: var(--radius);
  text-align:center;
  max-width:400px;
  width:90%;
}

.mesa-select {
  padding:10px;
  font-size:1rem;
  margin-bottom:15px;
  width:100%;
  border-radius: var(--radius);
  border:1px solid #ccc;
}

/* === RESPONSIVE CELULAR === */
@media(max-width: 768px){
  .main-container { flex-direction: column; height:auto; }
  .product-panel, .order-panel { flex:1; width:100%; }
  header { flex-direction: column; align-items:flex-start; gap:5px; }
  .estado-comanda { width:100%; text-align:left; }
  .category-filter { justify-content:flex-start; }
}
