dialog {
  background-color: var(--color-white);
  color: var(--color-black);
  border: none;
  width: calc(100% - var(--gutter-half));
  min-width: calc(100% - var(--gutter-half));
  max-width: calc(100% - var(--gutter-half));
  max-height: 85vh;
  position: fixed;
  opacity: 0;
  transform: translateY(100vh); /* Start position at the bottom */
  transition: all 150ms ease-out;
  /* Allow discrete transitions for display and overlay properties */
  transition-behavior: allow-discrete;
  padding: 0;
  overflow: visible;
}

@media (min-width: 768px) {
  dialog {
    width: fit-content;
    min-width: fit-content;
    max-width: calc(100% - var(--gutter-half));
  }
}

dialog .title {
  display: flex;
  gap: calc(var(--gutter-half) / 2);
  color: var(--color-black);
  font-size: var(--font-size-medium);
  font-weight: var(--font-weight-600);
  justify-content: center;
  align-items: center;
  border-bottom: solid 1px var(--color-gray-light);
  padding: var(--gutter-half);
}

@media (min-width: 992px) {
  dialog .title {
    font-size: var(--font-size-large);
    border-bottom: 0;
  }
}

dialog .title button {
  position: absolute;
  top: 0;
  left: 0;
  right: auto;
  padding: calc(var(--gutter-half) / 3);
  border: 0;
  background-color: transparent;
  width: 55px;
  height: 55px;
}
dialog .title button:hover {
  background-color: transparent;
}
dialog .title button:hover svg {
  stroke: var(--color-black);
}
dialog .title button svg,
dialog .title button i {
  stroke: var(--color-black);
  width: 36px;
  min-width: 36px;
  max-width: 36px;
  height: 36px;
  min-height: 36px;
  max-height: 36px;
}

@media (min-width: 992px) {
  dialog .title button {
    right: 0;
    left: auto;
    transform: translateX(100%);
    width: auto;
    height: auto;
  }
  dialog .title button svg,
  dialog .title button i {
    stroke: white;
  }
  dialog .title button:hover {
    background-color: white;
  }
}

dialog .context:not(:empty) {
  display: block;
  text-align: center;
  margin-bottom: var(--gutter-half);
  font-size: var(--font-size-regular);
  padding-top: var(--gutter-half);
}
@media (min-width: 992px) {
  dialog .context:not(:empty) {
    padding-top: 0;
  }
}

dialog[open] {
  opacity: 1;
  transform: translateY(0); /* End position at its default location */
}
@starting-style {
  dialog[open] {
    opacity: 0; /* Ensures the element starts animating from opacity 0 on entry */
    transform: translateY(10px); /* Ensures the element starts animating from bottom on entry */
  }
}

dialog::backdrop {
  background: rgba(51, 51, 51, 0.9);
  cursor: pointer;
  transition: opacity 350ms ease-out;
}
dialog[open]::backdrop {
  opacity: 0.9; /* Fade in the backdrop */
}

dialog section {
  padding: var(--gutter-half);
}

dialog .actions {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--gutter-half) / 2);
  place-content: center !important;
  padding: var(--gutter-half);
  padding-top: 0;
}

@media only screen and (min-width: 992px) {
  dialog::before {
    font-size: var(--font-size-large);
  }
  dialog .actions {
    flex-direction: row;
  }
}
