.dialog-overlay {
  position: fixed;
  z-index: 50;
  animation-duration: var(--default-transition-duration);
  animation-timing-function: var(--ease-out);
  background-color: rgb(0 0 0 / 50%);
  inset: 0;

  /* State */
  &[data-state="open"] {
    animation-name: var(--animate-in);
  }

  &[data-state="closed"] {
    animation-name: var(--animate-out);
  }
}

.dialog-content {
  display: grid;
  position: fixed;
  z-index: 50;
  left: 50%;
  width: 100%;
  max-width: calc(100% - 2rem);
  padding: calc(var(--spacing) * 6);
  transform: translate(-50%, -50%);
  transition: all var(--default-transition-duration)
    var(--default-transition-timing-function);
  animation-duration: var(--default-transition-duration);
  animation-timing-function: var(--ease-out);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background-color: var(--color-background);
  box-shadow: var(--shadow-lg);
  inset-block-start: 50%;
  gap: calc(var(--spacing) * 4);

  /* State */
  &[data-state="open"] {
    animation-name: var(--animate-fade-zoom-in);
  }

  &[data-state="closed"] {
    animation-name: var(--animate-fade-zoom-out);
  }

  .dialog-close {
    position: absolute;
    border: none;
    border-radius: var(--radius-xs);
    outline: none;
    opacity: 0.7;
    background-color: transparent;
    color: inherit;
    inset-inline-end: calc(var(--spacing) * 4);
    inset-block-start: calc(var(--spacing) * 4);

    /* State */
    &[data-state="open"] {
      background-color: var(--color-accent);
      color: var(--color-muted-foreground);
    }

    /* Icon */
    & > svg {
      flex-shrink: 0;
      width: calc(var(--spacing) * 4);
      height: calc(var(--spacing) * 4);
      pointer-events: none;
    }

    /* Hover */
    &:hover {
      opacity: 1;
    }

    /* Focus */
    &:focus {
      box-shadow: 0 0 0 2px var(--color-ring);
    }

    /* Disabled */
    &:disabled {
      opacity: 0.7;
      pointer-events: none;
    }
  }

  .dialog-header {
    display: flex;
    flex-direction: column;
    text-align: center;
    gap: calc(var(--spacing) * 2);
  }

  .dialog-footer {
    display: flex;
    flex-direction: column-reverse;
    gap: calc(var(--spacing) * 2);
  }

  .dialog-title {
    font-size: var(--text-lg);
    font-weight: var(--font-weight-semibold);
    line-height: var(--text-lg--line-height);
  }

  .dialog-description {
    color: var(--color-muted-foreground);
    font-size: var(--text-sm);
    line-height: var(--text-sm--line-height);
  }
}

@media (width >= 640px) {
  .dialog-content {
    max-width: 32rem;

    .dialog-header {
      text-align: start;
    }

    .dialog-footer {
      flex-direction: row;
      justify-content: end;
    }
  }
}
