@use "../base/mixins";
@use "../vars/variables";

.grid-size {
  &__items {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.25rem;
    overflow: hidden;
    width: 100%;

    &__row {
      display: flex;
      flex-direction: row;
      gap: 0.25rem;
      width: 100%;
    }

    &--error {
      .grid-size__item--active {
        background-color: var(--uc-error-error-60);
        border-color: var(--uc-error-error-60);
        transition: background-color 0.15s;
      }
    }
  }

  &__item {
    border-radius: 0.25rem;
    border: 1px solid var(--uc-bg-bg-surface-2);
    background-color: transparent;
    flex: 1;
    aspect-ratio: 1/1;
    cursor: pointer;
    transition: background-color 0.15s;

    &--preview {
      background: var(--uc-bg-bg-surface-2);
      border-color: transparent;
      transition: background-color 0.15s;
    }

    &--active {
      background-color: var(--uc-foreground);
      border-color: var(--uc-foreground);
      transition: background-color 0.15s;
    }
  }

  &__value {
    @include mixins.body-small;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 1.25rem;
  }
}

.grid-size-modal {
  .modal-secondary {
    &__container {
      @media screen and (min-width: 993px) and (max-height: 700px) {
        top: 3rem !important;
      }

      @media screen and (min-width: 993px) and (max-width: 1150px) {
        margin-left: -6rem;
      }

      @media screen and (max-width: variables.$bp-phone) {
        left: calc(50% - 7.5rem) !important;
        top: 3rem !important;
      }
    }

    &__body {
      overflow: visible;
    }

    &__footer {
      margin: 0;

      button {
        width: 100%;
      }
    }
  }
}
