
.modal {
  position: fixed;
  inset: 0;
  display: none;             /* se activa desde JS */
  align-items: center;
  justify-content: center;
  background: rgba(24, 24, 24, 0.55); 
  backdrop-filter: blur(4px); 
  z-index: 9999;
  transition: opacity 0.3s ease;
}

/* Estado visible */
.modal.visible {
  display: flex;
  animation: modalFade 0.35s ease forwards;
}

@keyframes modalFade {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

/* Caja principal */
.modal-content {
  background: white;
  border-radius: 16px;
  padding: 28px;
  width: min(780px, 90%);
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  animation: modalSlide 0.35s ease forwards;
}

@keyframes modalSlide {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Botón X */
.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  border: none;
  background: #ffffff;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 20px;
  cursor: pointer;
  color: #444;
  transition: background 0.2s, transform 0.2s;
  box-shadow: 0px 0px 8px rgba(0,0,0,0.1);
}

.modal-close:hover {
  background: #f2f2f2;
  transform: scale(1.1);
}

/* Layout interior */
.modal-body {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.modal-left img {
  width: 240px;
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.08);
}

/* Textos */
.modal-right {
  flex: 1;
  min-width: 220px;
}

#modal-nombre {
  margin-bottom: 14px;
  font-size: 1.7rem;
  letter-spacing: 0.3px;
  color: #222;
  font-weight: 600;
}

.linea {
  margin-bottom: 12px;
  font-size: 0.97rem;
  line-height: 1.45;
  color: #444;
}

.linea strong {
  color: #222;
  font-weight: 600;
}




.lista-alergenos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}


.icono-alergeno {
  
  

  display: flex;
  align-items: center;
  gap: 6px;
  background: #f7f1e5;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid #e2d5bc;
  font-size: 0.85rem;
  color: #333;
  white-space: nowrap;
}

.icono-alergeno svg {
  width: 22px;
  height: 22px;
  stroke: #1b1c24;
  stroke-width: 1.6;
  fill: #cba75b; /* dorado suave */
}

.icono-alergeno span {
  font-weight: 500;
}

/* Icono SIN GLUTEN destacado */
.icono-alergeno.icono-sin-gluten {
  background: #e0f9e0;            /* verde suave */
  border-color: #9ad79a;
}

.icono-alergeno.icono-sin-gluten svg {
  fill: #4CAF50; /* verde más vivo */
}

.icono-sin-gluten {
  flex-basis: 100%; /* ocupa la línea completa */
}


/* ocultar líneas vacías */
.hidden {
  display: none;
}









/* Responsive: apilar en móvil */
@media (max-width: 700px) {
  .modal-body { flex-direction: column; }
  .modal-left { flex-basis: auto; }
}
