/* Shared Modal Component — used by menu.html and index.html */

.modal::backdrop {
  background: rgba(30, 18, 24, 0.7);
  backdrop-filter: blur(4px);
}

dialog.modal {
  padding: 0;
  border: none;
  background: transparent;
  max-width: 100vw;
  max-height: 100vh;
  margin: auto;
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

dialog.modal:not([open]) {
  display: none;
}

.modal__panel {
  background: var(--color-surface);
  border-radius: 24px;
  width: min(600px, 90vw);
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  animation: modalIn 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(12px); }
  to   { opacity: 1; transform: none; }
}

.modal__close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: var(--radius-full);
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 1.25rem;
  color: var(--color-text);
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.modal__close:hover {
  background: var(--color-bg);
  color: var(--color-accent);
}

.modal__close:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.modal__image-wrapper {
  display: block;
}

.modal__image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 24px 24px 0 0;
}

.modal__body {
  padding: var(--space-6);
}

.modal__title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  margin-bottom: var(--space-2);
}

.modal__price {
  font-weight: 700;
  color: var(--color-accent);
  font-size: var(--text-lg);
  margin-bottom: var(--space-4);
}

.modal__price:empty {
  display: none;
}

.modal__description {
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: var(--space-6);
}

.modal__order-link {
  width: 100%;
  text-align: center;
}

.modal__form-link {
  text-align: center;
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .modal__panel {
    animation: none;
  }
}

/* Ingredients pill row — used by homepage modal openers */
.modal__ingredients {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-5) 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
}

.modal__ingredients li {
  background: rgba(224, 96, 126, 0.1);
  color: var(--color-text);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.875rem;
}

.modal__ingredients-heading {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--text-sm);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin: 0 0 var(--space-3) 0;
}

/* When the description OR ingredients is empty, hide it so layout stays tight */
.modal__description:empty { display: none; }
.modal__ingredients:empty + .modal__ingredients-heading,
.modal__ingredients-heading + .modal__ingredients:empty { display: none; }
