/* "View Ingredients & Allergens" -- the labels under a dish on the menu and the
 * pop-up they open (public/js/dish-info.js, partials/dish-info-line.blade.php).
 *
 * Same dark card, gold edge and red accent as the dish photo lightbox and the
 * package menu pop-up, so it reads as part of the existing menu. Allergen
 * labels are solid amber with a warning icon (the words are always there, so
 * colour is never the only signal); cross-contact is a dashed outline; "not
 * yet verified" is a muted outline.
 */

/* ---- under a dish on the menu ------------------------------------------ */

.dish-info-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.3;
}

.dish-chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.dish-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(214, 166, 64, .55);
  background: rgba(214, 166, 64, .2);
  color: #f6dc93;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.25;
  text-transform: uppercase;
  /* wraps rather than spilling out of a narrow phone-width card */
  max-width: 100%;
  white-space: normal;
}

.dish-chip--cross {
  background: transparent;
  border-style: dashed;
  color: #e8c16b;
  font-weight: 600;
}

.dish-chip--unverified {
  background: transparent;
  border-color: rgba(255, 255, 255, .28);
  color: rgba(255, 255, 255, .7);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

.dish-info-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 4px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #e8c16b;
  font: inherit;
  font-weight: 600;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.dish-info-btn i { flex: none; }

.dish-info-btn:hover,
.dish-info-btn:focus-visible {
  color: #fff;
  background: rgba(214, 166, 64, .18);
}

/* Where the row sits in each list: lined up under the dish name. */
.package-menu-item > .dish-info-line { padding: 0 10px 10px; }
.menu-editor-option-row > .dish-info-line { padding: 0 10px 8px; }
.menu-dishes li > .dish-info-line { flex: 1 0 100%; margin-top: 0; padding-left: 48px; }

/* ---- the pop-up -------------------------------------------------------- */

dialog.dish-info-dialog {
  box-sizing: border-box;
  width: min(560px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(214, 166, 64, .45);
  border-top: 3px solid #8d1d12;
  border-radius: 14px;
  background: #242424;
  color: #fff;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .6);
  font-family: inherit;
}

dialog.dish-info-dialog[open] {
  display: flex;
  flex-direction: column;
}

dialog.dish-info-dialog::backdrop {
  background: rgba(10, 8, 8, .75);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.dish-info-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, .45);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

.dish-info-close:hover,
.dish-info-close:focus-visible {
  background: rgba(255, 255, 255, .22);
}

.dish-info-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .25) transparent;
}

.dish-info-photo {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
}

.dish-info-head {
  padding: 16px 52px 4px 20px;
}

.dish-info-head h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
}

.dish-info-sub {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  color: rgba(255, 255, 255, .65);
}

.dish-info-section {
  padding: 12px 20px 0;
}

.dish-info-section h3 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #e8c16b;
}

.dish-info-section p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(255, 255, 255, .88);
}

.dish-info-ingredients {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 4px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
}

.dish-info-ingredients li {
  position: relative;
  padding-left: 14px;
  color: rgba(255, 255, 255, .9);
}

.dish-info-ingredients li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .6em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #d6a640;
}

.dish-info-allergens {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dish-info-allergens .dish-chip {
  padding: 5px 12px;
  font-size: 12px;
}

.dish-info-notice {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .05);
  font-size: 13.5px;
  line-height: 1.5;
  color: rgba(255, 255, 255, .88);
}

.dish-info-notice strong {
  display: block;
  margin-bottom: 2px;
  color: #fff;
}

.dish-info-notice--warn {
  border-color: rgba(214, 166, 64, .55);
  background: rgba(214, 166, 64, .1);
}

.dish-info-foot {
  margin-top: 14px;
  padding: 12px 20px 16px;
  border-top: 1px solid rgba(255, 255, 255, .1);
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255, 255, 255, .62);
}

.dish-info-foot .dish-info-updated {
  display: block;
  margin-top: 6px;
}

.dish-info-state {
  padding: 40px 20px;
  text-align: center;
  color: rgba(255, 255, 255, .75);
}

@media (max-width: 520px) {
  dialog.dish-info-dialog {
    width: calc(100vw - 16px);
    border-radius: 12px;
  }

  .dish-info-photo { max-height: 160px; }
  .dish-info-ingredients { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: no-preference) {
  dialog.dish-info-dialog[open] { animation: dish-info-in .16s ease-out; }
  @keyframes dish-info-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
}
