@import (reference) "../PrimitivePrompt/PrimitivePrompt.vars.less";

.wds-action-prompt {
  --Prompt-padding-x: var(--size-16);
  --Prompt-padding-y: var(--size-16);
  --Prompt-actions-gap: var(--size-8);
  --Prompt-gap: var(--size-10) var(--size-16);
  --Prompt-border-radius: var(--radius-large);

  // Responsive to the prompt's own width rather than the viewport, so it adapts to narrow
  // containers. Named so ancestor containers can't intercept the queries.
  container: wds-action-prompt / inline-size;

  &--media-image {
    width: var(--size-48);
    height: var(--size-48);
    object-fit: contain;
  }

  @container wds-action-prompt (width < @wds-prompt-actions-full-width-max) {
    .wds-prompt__actions-wrapper {
      grid-column: span 2;
      width: 100%;
    }

    .wds-prompt__content-wrapper--with-dismiss .wds-prompt__actions-wrapper {
      grid-column: span 3;
    }

    .wds-action-prompt__action {
      width: 100%;
    }
  }

  &--with-two-actions {
    @container wds-action-prompt (width < @wds-prompt-actions-full-width-max) {
      .wds-action-prompt__action {
        flex: 1 1 calc(50% - (var(--Prompt-actions-gap) / 2));
        min-width: fit-content;
      }
    }
  }

  &__content {
    max-width: calc(var(--size-48) * 10);
  }
}
