/* App-specific styles. Bootstrap itself is the prebuilt bootstrap.min.css next to this file. */

.shopping-item--checked {
  opacity: 0.55;
}

.shopping-item--checked label {
  text-decoration: line-through;
}

/* Drag-and-drop ordering (SortableJS) */
.sortable-ghost {
  opacity: 0.4;
  background: var(--bs-success-bg-subtle);
}

.sortable-chosen {
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.15);
}

/* Suggestions under a field (autocomplete controller). In a grid column the insets line it up with the
   input, since the column's gutter is padding. */
.autocomplete-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1000;
  margin-top: 0.125rem;
}

.row > * > .autocomplete-menu {
  left: calc(var(--bs-gutter-x) * 0.5);
  right: calc(var(--bs-gutter-x) * 0.5);
}

.autocomplete-menu--above {
  top: auto;
  bottom: 100%;
  margin-top: 0;
  margin-bottom: 0.125rem;
}

/* Recipe picker on the menu page: a centred panel, full screen on phones. */
.recipe-picker {
  width: min(40rem, 100% - 2rem);
  height: min(48rem, 100% - 2rem);
  padding: 0;
  border: 0;
  border-radius: var(--bs-border-radius-lg);
  box-shadow: var(--bs-box-shadow-lg);
}

.recipe-picker[open] {
  display: flex;
  flex-direction: column;
}

.recipe-picker::backdrop {
  background: rgb(0 0 0 / 0.5);
}

@media (max-width: 575.98px) {
  .recipe-picker {
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
  }
}

body:has(.recipe-picker[open]) {
  overflow: hidden;
}

.recipe-picker__form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.recipe-picker__recipes {
  flex: 1;
  overflow-y: auto;
}

.recipe-picker__servings {
  width: 7.5rem;
}

.recipe-picker__tags {
  scrollbar-width: none;
}
