@layer recipes {
  [data-scope="bottom-sheet"][data-part="backdrop"] {
    position: fixed;
    inset: 0px;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1400;

    &[data-state="open"] {
      animation: fadeIn 0.5s cubic-bezier(0.32, 0.72, 0, 1);
    }

    &[data-state="closed"] {
      animation: fadeOut 0.5s cubic-bezier(0.32, 0.72, 0, 1);
    }
  }

  [data-scope="bottom-sheet"][data-part="trigger"],
  [data-scope="bottom-sheet"][data-part="content"] > div button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: start;
    cursor: pointer;
    font-weight: 500;
    padding-inline: 1rem;
    padding-block: 0.25rem;
  }

  [data-scope="bottom-sheet"][data-part="content"]
    > div:nth-child(2)
    > div:has(> button) {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  [data-scope="bottom-sheet"][data-part="trigger"],
  [data-scope="bottom-sheet"][data-part="content"] > div button:first-child {
    background: var(--colors-bg-primary-subtle);
    color: #ffffff;
  }

  [data-scope="bottom-sheet"][data-part="content"] > div button:last-child {
    border-width: 1px;
    background: var(--colors-bg-subtle);
  }

  [data-scope="bottom-sheet"][data-part="content"] > div button {
    width: 100%;
  }

  [data-scope="bottom-sheet"][data-part="content"] {
    background: var(--colors-bg-subtle);
    transition: transform 0.5s cubic-bezier(0.32, 0.72, 0, 1);
    animation-duration: 0.5s;
    animation-timing-function: cubic-bezier(0.32, 0.72, 0, 1);
    display: flex;
    flex-direction: column;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    position: fixed;
    width: 100%;
    height: 100%;
    max-height: 400px;
    padding: 0 1.25rem;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1400;

    &[data-state="open"] {
      animation-name: slideIn;
    }

    &[data-state="closed"] {
      animation-name: slideOut;
    }
  }

  [data-scope="bottom-sheet"][data-part="content"] label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 14px;
    font-weight: 500;
  }

  [data-scope="bottom-sheet"][data-part="content"] input {
    flex: 1;
    font-size: 0.875rem;
    border-width: 1px;
    padding-inline: 0.5rem;
    padding-block: 0.25rem;
  }

  [data-scope="bottom-sheet"][data-part="title"] {
    font-weight: 500;
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
  }

  [data-scope="bottom-sheet"][data-part="close-trigger"] {
    display: flex;
    position: absolute;
    top: 3rem;
    right: 1rem;
  }

  [data-scope="bottom-sheet"][data-part="grabber"] {
    width: 100%;
    padding: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  [data-scope="bottom-sheet"][data-part="grabber"] + div {
    max-width: 28rem;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  [data-scope="bottom-sheet"][data-part="grabber-indicator"] {
    height: 4px;
    width: 40px;
    background-color: gray;
    border-radius: 1000px;
  }
}

@keyframes slideIn {
  from {
    transform: translate3d(0, 100%, 0);
  }
  to {
    transform: translate3d(0, var(--bottom-sheet-translate, 0), 0);
  }
}

@keyframes slideOut {
  from {
    transform: translate3d(0, var(--bottom-sheet-translate, 0), 0);
  }
  to {
    transform: translate3d(0, 100%, 0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}
