:root {
  --gray-bg: #e9edf5;
  --white: #ffffff;
  --black: #1f2d3d;
  --primary: #0056b3;
  --primary-hover: #003f8a;
  --danger: #c92a2a;
  --danger-hover: #a51111;
  --text-muted: #6c757d;
  --border: #dee2e6;
  --font: 'Roboto Mono', monospace;
  --radius: 6px;
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  --transition: all 0.2s ease-in-out;
}

/* ===== BASE STRUCTURE ===== */
body {
  margin: 0;
  font-family: var(--font);
  background-color: var(--gray-bg);
  color: var(--black);
  padding: 20px;
  font-size: 14px;
}

h1, h2, h3 {
  margin-bottom: 16px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

section {
  margin-bottom: 40px;
}

/* ===== MENU CARDS ===== */
.menu-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.dish {
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  padding: 16px;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow);
}

.dish img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 10px;
}

.dish h3 {
  margin: 4px 0 8px;
  font-size: 16px;
}

.dish p {
  margin: 3px 0;
  color: var(--text-muted);
}

.dish .price {
  font-size: 15px;
  font-weight: bold;
  color: var(--primary);
  margin-top: 8px;
}

/* ===== GENERAL CARDS ===== */
.card {
  background: var(--white);
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ===== PANIER ===== */
#cart .cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
}

input[type="number"] {
  width: 60px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
}

/* ===== BOUTONS ===== */
button {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

button:hover {
  opacity: 0.9;
}

button.primary {
  background-color: var(--primary);
  color: white;
}

button.primary:hover {
  background-color: var(--primary-hover);
}

button.danger {
  background-color: var(--danger);
  color: white;
}

button.danger:hover {
  background-color: var(--danger-hover);
}

button.info {
  background-color: #17a2b8;
  color: white;
}

/* ===== BOUTON VIDAGE HISTORIQUE SPÉCIFIQUE ===== */
#btnViderHistorique {
  margin-top: 20px;
  margin-bottom: 20px;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--primary);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-weight: 600;
  z-index: 1000;
}

/* ===== MODALE ===== */
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.modal-content {
  background: white;
  padding: 28px;
  width: 400px;
  max-width: 90%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 14px;
}

.hidden {
  display: none;
}

/* ===== SUIVI COMMANDE ===== */
#progression {
  padding: 20px;
  border: 1px solid var(--border);
  background: var(--white);
  border-radius: var(--radius);
}

#steps {
  list-style: none;
  padding: 0;
  margin: 0;
}

#steps li {
  border-left: 3px solid var(--border);
  padding-left: 12px;
  margin-bottom: 10px;
  color: var(--text-muted);
}

#steps li.active {
  border-color: var(--primary);
  font-weight: bold;
  color: var(--primary);
}

/* ===== CARTE ===== */
#map {
  width: 100%;
  height: 300px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

/* ===== HISTORIQUE / COMMANDES ===== */
#listeCommandes,
#historiqueCommandes {
  background: var(--white);
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-family: monospace;
}

details summary {
  font-weight: bold;
  cursor: pointer;
}

/* ===== RESPONSIVE ===== */
@media screen and (max-width: 768px) {
  .menu-container {
    grid-template-columns: 1fr;
  }

  button {
    width: 100%;
    margin-top: 8px;
  }
}
