// =============================================================================
// Styles specific to ShoppingListPage — colocated next to
// ShoppingListPage.tsx since nothing else uses these classes. Same page
// shell/status conventions as planning-page.scss (`.planning-page__header`/
// `__status`), a simple grouped list rather than a grid below it.
// =============================================================================

.shopping-list-page {
  height: 100%;
  display: flex;
  flex-direction: column;

  &__header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
  }

  &__status {
    color: var(--color-text-muted);
    font-size: var(--font-size-md);
  }

  &__status--error {
    color: var(--color-error);
  }
}

// --- The list itself, grouped by aisle --------------------------------------
.shopping-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.shopping-list__group-title {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin: 0 0 var(--space-sm);
  font-size: var(--font-size-md);
  font-weight: 700;
  color: var(--color-text);

  svg {
    width: 1.2rem;
    height: 1.2rem;
    color: var(--color-text-muted);
  }
}

.shopping-list__items {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.shopping-list__item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--color-border);

  &:last-child {
    border-bottom: none;
  }

  &-icon {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    color: var(--color-text-muted);

    svg {
      width: 1.25rem;
      height: 1.25rem;
    }
  }

  &-name {
    flex: 1;
    min-width: 0;
    color: var(--color-text);
  }

  &-quantity {
    flex-shrink: 0;
    font-weight: 600;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
  }
}
