:root {
  --allergy-row-max-height: 1.5rem;
}

@media screen and (max-width: 576px) {
  :root {
    --allergy-row-max-height: 3rem;
  }
}

.allergies--allergies-container {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  flex-direction: column;
  gap: 1rem;
}

.allergies--allergy-row {
  max-height: var(--allergy-row-max-height);

  .menus--more-options-container > button:not([data-active="true"]) {
    display: none;
  }

  &:hover > .menus--more-options-container > button {
    display: flex;
  }
}

.allergies--allergy-name {
  margin-inline: 0.75rem 0.5rem;
}

.allergies--allergy-reaction {
  font-size: var(--rem-14);
  line-height: var(--rem-22);
  color: var(--text-additional);
  margin-left: 0.5rem;
  text-wrap: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.allergies--list-container {
  max-height: calc(var(--allergy-row-max-height) * 5 + 5 * 1rem);
  transition: max-height 0.6s ease-in-out;
}

dialog.modals--main-modal:has(.allergies--modal) {
  width: 518px;
  min-width: unset;

  .modals--body {
    max-height: unset;
  }
}

.allergies--modal {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.allergies--modal-header {
  display: flex;
  position: relative;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  color: var(--text-heading);
  font-size: var(--rem-18);
  font-variation-settings: "wght" 600;
  line-height: 140%;
}

.allergies--modal-header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.allergies--modal-body {
  display: flex;
  flex-direction: column;
}

.allergies--modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--rem-8);

  button {
    width: fit-content;
  }
}

.allergies--more-options-button {
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: var(--radius-sm);
  border: none;
  background-color: white;
  &:hover {
    background-color: var(--surface-subtle);
  }

  &[data-active="true"] {
    background-color: var(--surface-secondary);
  }
}

.allergies--more-options-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
