/* ============================================================
   Menú AR — Estilos de la web del cliente
   ============================================================ */

:root {
  --primario: #e74c3c;
  --primario-oscuro: #c0392b;
  --fondo: #faf6f2;
  --texto: #2c3e50;
  --texto-suave: #7f8c8d;
  --blanco: #ffffff;
  --sombra: 0 2px 10px rgba(0,0,0,0.08);
  --radio: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--fondo);
  color: var(--texto);
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- Header ---------- */
.app-header {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white;
  padding: 24px 20px;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.restaurante-info h1 { font-size: 1.6em; font-weight: 700; }
.restaurante-info .subtitulo { opacity: 0.9; font-size: 0.95em; margin-top: 4px; }

/* ---------- Filtros ---------- */
.filtros-bar {
  background: var(--blanco);
  padding: 14px 16px;
  box-shadow: var(--sombra);
  position: sticky;
  top: 0;
  z-index: 9;
}
.buscador {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  font-size: 1em;
  outline: none;
}
.buscador:focus { border-color: var(--primario); }

.filtros-etiquetas {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0 4px;
  scrollbar-width: none;
}
.filtros-etiquetas::-webkit-scrollbar { display: none; }

.chip-filtro {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 20px;
  background: #f0f0f0;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 0.9em;
  white-space: nowrap;
  user-select: none;
  transition: all 0.2s;
}
.chip-filtro.activo {
  background: var(--primario);
  color: white;
  border-color: var(--primario);
}

/* ---------- Lista de platos ---------- */
.menu-lista { padding: 16px; max-width: 700px; margin: 0 auto; }
.cargando { text-align: center; color: var(--texto-suave); padding: 40px 0; }

.categoria-titulo {
  font-size: 1.2em;
  font-weight: 700;
  color: var(--texto);
  margin: 20px 0 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--primario);
}

.tarjeta-plato {
  background: var(--blanco);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  margin-bottom: 14px;
  overflow: hidden;
  display: flex;
  transition: transform 0.15s;
}
.tarjeta-plato:active { transform: scale(0.99); }

.plato-img {
  width: 110px;
  min-height: 110px;
  background: #eee center/cover;
  flex-shrink: 0;
}
.plato-img svg {
  width: 100%;
  height: 100%;
  color: #ccc;
}

.plato-info { padding: 14px; flex: 1; }
.plato-nombre {
  font-weight: 700;
  font-size: 1.05em;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.plato-precio { color: var(--primario); font-weight: 800; white-space: nowrap; }
.plato-desc {
  color: var(--texto-suave);
  font-size: 0.9em;
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.plato-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.mini-tag {
  font-size: 0.72em;
  padding: 3px 8px;
  border-radius: 10px;
  background: #fdf2e9;
  color: #e67e22;
}

.plato-acciones { display: flex; gap: 8px; margin-top: 10px; }
.btn-3d, .btn-add {
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 0.85em;
  font-weight: 600;
}
.btn-3d { background: #3498db; color: white; }
.btn-add { background: var(--primario); color: white; }

/* ---------- Modal 3D ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); }
.modal-contenido {
  position: relative;
  background: white;
  border-radius: var(--radio);
  padding: 20px;
  width: 92%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 1;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}
.modal-cerrar {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 1.8em;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--texto-suave);
  line-height: 1;
}
.modal-contenido h2 { margin-bottom: 4px; padding-right: 30px; }
.modal-precio { color: var(--primario); font-size: 1.4em; font-weight: 800; }
.modal-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0; }
.modal-desc { color: var(--texto-suave); margin-bottom: 14px; }

model-viewer {
  width: 100%;
  height: 320px;
  background: #eee;
  border-radius: 10px;
  --poster-color: transparent;
}
.ar-btn {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primario);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 24px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.modal-nota { font-size: 0.8em; color: var(--texto-suave); margin-top: 10px; text-align: center; }

/* ---------- Carrito flotante ---------- */
.carrito-flotante {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--primario);
  color: white;
  border: none;
  padding: 14px 20px;
  border-radius: 30px;
  font-size: 1em;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(231,76,60,0.4);
  z-index: 50;
}

/* ---------- Modal pedido ---------- */
.pedido-lineas { margin: 12px 0; max-height: 300px; overflow-y: auto; }
.pedido-linea {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}
.pedido-linea-nombre { flex: 1; }
.pedido-linea-cant { color: var(--texto-suave); font-size: 0.85em; }

.pedido-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.2em;
  font-weight: 800;
  margin: 14px 0;
}

.pedido-form input, .pedido-form textarea {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.95em;
  font-family: inherit;
  resize: vertical;
}

.btn-primario {
  width: 100%;
  background: var(--primario);
  color: white;
  border: none;
  padding: 14px;
  border-radius: 10px;
  font-size: 1em;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
}
.btn-primario:disabled { opacity: 0.6; cursor: not-allowed; }

.pedido-confirmacion {
  text-align: center;
  color: #27ae60;
  font-weight: 600;
  margin-top: 12px;
}
