.card {
  background-color: var(--grey-color-4);
  border-radius: var(--border-radius);
  display: flex;
  gap: 0.5rem;
  flex-direction: column;
  max-width: 30rem;
  min-height: 0;
  padding: 0.5rem;
  position: relative;
  width: 90vw;
  scroll-snap-align: center;
  /*box-shadow: var(--bs-01);*/
  /*height: fit-content; NO COMPATIBLE CON STICKY */
  overflow-y: auto;

  &.card--overflow {
    max-height: calc(100vh - 51px - 3rem);
    overflow-y: auto;

    & save-button {
      bottom: 0 !important;
    }

    @media (max-width: 768px) {
      max-height: calc(100vh - 51px - var(--navbar-size) - 3rem);
    }
  }

  & form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
  }

  &.card--xl {
    max-width: 80rem;
    width: 100%;
  }

}


.card__title {
  font-size: 1rem;
  line-height: 2.4rem;
  padding-left: 0.5rem;
  font-weight: 700;
}

.card__totals {
  padding-left: 0.5rem;
}

.card__list {
  background-color: white;
  display: flex;
  flex-direction: column;
  padding: 0.5rem;
  border-radius: var(--border-radius);
  /*min-height: calc(51px + .5rem);*/
  transition: height 0.5s ease-in-out;
  width: 100%;
  color: var(--input-color);

  &:not(:has(.card-link)) {
    background-color: var(--grey-color-4);
  }

  & > li {
    margin-top: auto;
    margin-bottom: auto;
  }
}

.card__sticky-button {
  display: block;
  bottom: 1rem;
  position: sticky;
  width: 100%;
}

.card__footer {
  position: sticky;
  display: flex;
  /*justify-content: space-between;*/
  justify-content: flex-end;
  gap: 2rem;
  bottom: -0.52rem;
  background-color: var(--grey-color-4);
  padding: 0.5rem 0;
  border-top: 1px solid var(--grey-color-4);
  /*height: calc(1rem + var(--input-height));*/
  align-items: center;
}



.card-link {
  background-color: white;
  border-radius: var(--border-radius);
  display: grid;
  gap: 0.1rem;
  min-height: 50px;
  padding: min(1rem, 2vw);
  transition: background-color var(--main-transition);
  width: 100%;
  text-decoration: none;
  color: var(--input-color);
  cursor: pointer;
  align-items: center;
  font-size: 1rem;
  text-align: left;

  &:focus,
  &:hover {
    background-color: var(--primary-color-1);
    /*outline: none;*/
  }
}

.card-link.selected {
  outline-offset: -4px;
  outline: 2px solid var(--primary-color-5);

  &:focus,
  &:hover {
    outline: 2px solid var(--primary-color-5);
  }
}

.card-link--selected {
  outline-offset: -4px;
  outline: 2px solid var(--primary-color-5);

  &:focus,
  &:hover {
    outline: 2px solid var(--primary-color-5);
  }
}

.card-link__title {
  font-size: 1rem;
  font-weight: bold;
}

.card-link__footer {
  font-size: 0.9rem;
  font-style: italic;
}
