.ingredient-detail-dialog:not([open]) {
  display: none;
}

.deep-layout-grid__modal[data-ingredient-dialog-source] {
  display: none;
}

html.ingredient-detail-open {
  overflow: hidden;
  overscroll-behavior: none;
  scroll-behavior: auto;
}

@media (max-width: 760px) {
  .ingredient-detail-enabled #featured-ingredients .deep-layout-grid__card {
    -webkit-tap-highlight-color: transparent;
  }
}

html.ingredient-detail-open #featured-ingredients .deep-layout-grid.has-active .deep-layout-grid__card {
  filter: none;
  opacity: 1;
}

.ingredient-detail-dialog[open] {
  --safe-top: max(16px, env(safe-area-inset-top, 0px));
  --safe-bottom: max(16px, env(safe-area-inset-bottom, 0px));
  --safe-left: max(16px, env(safe-area-inset-left, 0px));
  --safe-right: max(16px, env(safe-area-inset-right, 0px));
  --dialog-height: calc(var(--ingredient-viewport-height, 100vh) - var(--safe-top) - var(--safe-bottom));
  position: fixed;
  inset: auto;
  top: calc(var(--ingredient-viewport-top, 0px) + var(--safe-top));
  left: calc(var(--ingredient-viewport-left, 0px) + var(--safe-left));
  width: calc(var(--ingredient-viewport-width, 100vw) - var(--safe-left) - var(--safe-right));
  height: max(0px, var(--dialog-height));
  max-width: none;
  max-height: none;
  display: grid;
  place-items: center;
  overflow: visible;
  margin: 0;
  padding: 0;
  border: 0;
  color: #fff;
  background: transparent;
}

@supports (height: 100dvh) {
  .ingredient-detail-dialog[open] {
    --dialog-height: calc(var(--ingredient-viewport-height, 100dvh) - var(--safe-top) - var(--safe-bottom));
  }
}

.ingredient-detail-dialog::backdrop {
  background: rgba(8, 21, 21, 0.36);
  -webkit-backdrop-filter: blur(15px) saturate(0.85);
  backdrop-filter: blur(15px) saturate(0.85);
  touch-action: none;
}

.ingredient-detail-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100%, 550px);
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: 22px;
  background: #132220;
  box-shadow: 0 24px 68px rgba(6, 18, 17, 0.42);
}

.ingredient-detail-image {
  display: block;
  flex: none;
  width: 100%;
  height: auto;
  max-height: min(420px, calc(var(--dialog-height) * 0.56));
  object-fit: contain;
  background: #0f1b19;
}

.ingredient-detail-copy {
  min-height: 0;
  padding: 19px clamp(18px, 5vw, 27px) 23px;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.ingredient-detail-copy h3 {
  margin: 0 0 7px;
  font-size: clamp(25px, 7vw, 34px);
  line-height: 1.2;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.ingredient-detail-copy p {
  margin: 0;
  color: #edf4ef;
  font-size: 15px;
  line-height: 1.76;
  overflow-wrap: anywhere;
}

.ingredient-detail-copy p.eyebrow {
  margin: 0 0 10px;
  color: #b7d9ce;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0.14em;
}

.ingredient-detail-close {
  position: absolute;
  z-index: 1;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 50%;
  background: rgba(11, 23, 22, 0.82);
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ingredient-detail-close::before,
.ingredient-detail-close::after {
  content: "";
  grid-area: 1 / 1;
  width: 16px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transform: rotate(45deg);
}

.ingredient-detail-close::after {
  transform: rotate(-45deg);
}

.ingredient-detail-close:focus-visible,
.ingredient-detail-copy:focus-visible {
  outline: 2px solid #b7d9ce;
  outline-offset: -4px;
}
